/

CVE-2026-25548

Severity:

CRITICAL RISK

(9.1)

Remote Code Execution via Local File Inclusion and Log

CVE-2026-25548

Analyzed

Vulnerability type

Category:

Remote Code Execution via Local File Inclusion and Log Injection

CWE:

CWE-94, CWE-98, CWE-117

Impact:

Remote Code Execution by authenticated administrator

Severity:

CRITICAL RISK

(9.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

InvoicePlane 1.7.0 contains a critical Remote Code Execution vulnerability where an authenticated administrator can chain Local File Inclusion (LFI) with log poisoning to execute arbitrary system commands on the server.

By pointing the public_invoice_template setting at a log file that has been poisoned with PHP code, the application ends up interpreting attacker-controlled content as executable script, leading to full server compromise in affected deployments.

Affected context

The vulnerability appears in InvoicePlane 1.7.0 installations where:

  • The application is configured to render invoice templates from file paths controlled by the public_invoice_template setting.
  • Application or web server logs are writable and can be influenced by user-supplied data (e.g., request parameters, headers, or content).
  • The PHP runtime is configured to interpret included files as PHP code when they are referenced as templates.

It primarily affects environments where administrators have direct access to configuration options for invoice templates and logs are stored on the same filesystem as the application.

Exploit preconditions

  • Attack surface: Web-based administration interface of InvoicePlane.
  • Required access: Authenticated administrator privileges capable of changing the public_invoice_template configuration.
  • Additional conditions:
  • Ability for the attacker to inject controlled content into an application or web server log file (log poisoning).
  • The log file must be stored in a location accessible to the PHP interpreter and reachable by the template inclusion logic.
  • Trigger point: Rendering a public invoice that uses the configured public_invoice_template, which is set to a poisoned log file.
  • Why exploitation is possible: The template mechanism trusts a configurable file path and includes it as executable PHP, and the logging subsystem records unsanitized attacker input that can contain PHP code. This combination allows arbitrary code to be written to a log file and then interpreted via Local File Inclusion.

Why this happens

The core issue is the unsafe combination of:

  • A file-include-based template system that accepts administrator-controlled paths, and
  • Logging of attacker-influenced data without sanitization, followed by inclusion of those log files as PHP.

This maps primarily to:

  • CWE-98: Improper Control of Filename for Include/Require Statement in PHP Program, where an include path is controlled in a way that allows unintended files to be executed.
  • CWE-94: Improper Control of Generation of Code ('Code Injection'), since user-controlled content in the logs is ultimately executed as PHP code.
  • CWE-117: Improper Output Neutralization for Logs, as unneutralized user input is written to log files, enabling log poisoning.

Abstractly, the pattern is: "configurable file inclusion of PHP templates" + "logs containing untrusted, executable content" = a code execution sink reachable through configuration rather than direct arbitrary file upload.

Potential impact

  • Execution of arbitrary PHP code and system commands under the web server or PHP process account.
  • Complete compromise of the InvoicePlane application, including access to invoices, client information, and payment-related data.
  • Installation of web shells or persistent backdoors on the server.
  • Pivoting to other internal systems or databases accessible from the compromised host.
  • Tampering with invoice content, payment details, or financial records.
  • Theft or exposure of sensitive customer and business information.

General mitigation guidance

Effective mitigation focuses on breaking the chain between log poisoning and file inclusion, and on removing execution semantics from user-influenced content:

  • Constrain template resolution:
  • Restrict template selection to a fixed set of known-safe templates or to a whitelisted directory.
  • Avoid directly including arbitrary filesystem paths; use logical template names mapped to vetted files.
  • Treat templates as data, not code:
  • Use non-PHP template engines where template files are not interpreted as executable code.
  • If PHP templates are unavoidable, prevent runtime evaluation of file content that can be influenced indirectly (e.g., via logs).
  • Harden logging behavior:
  • Neutralize or encode user-supplied data before writing to logs to prevent it from being valid executable code.
  • Store logs outside of directories that are web-accessible or used for application templates.
  • Apply least privilege and isolation:
  • Run the application with minimal filesystem permissions so it cannot write into directories that are executed or included as code.
  • Separate execution directories from data/log directories with strict permissions.
  • Configuration hygiene:
  • Limit who can change high-impact configuration parameters like template paths.
  • Review and document configuration settings that map directly to file system resources or execution context.

How teams detect issues like this

Detection can focus on both code-level and operational indicators:

  • Static analysis and code review:
  • Search for dynamic include, require, or template rendering calls that accept configuration or user-controlled file paths (CWE-98 patterns).
  • Identify any log file paths that can be referenced by template or include mechanisms.
  • Flag logging of raw user input without encoding or neutralization (CWE-117 patterns).
  • Configuration and filesystem review:
  • Audit configuration options related to templates or themes to ensure they cannot point to arbitrary files or log directories.
  • Check webroot and application directories for the presence of log files that are readable and executable by the web server.
  • Runtime monitoring:
  • Monitor logs and telemetry for unusual template path changes or inclusion of non-template files (e.g., .log files).
  • Detect sudden execution of atypical PHP functions or system command execution originating from log file paths.
  • Automated tooling:
  • Use security scanners or SAST tools configured to detect dynamic file inclusion and log injection patterns.
  • Integrate checks into CI/CD pipelines to prevent introduction of new file-include-based templating features without strict path controls.

Sources

SourceLink
github.comgithub.com/InvoicePlane/InvoicePlane/commit/93622f2df88a860d89bfee56012cabb2942061d6
github.comgithub.com/InvoicePlane/InvoicePlane/security/advisories/GHSA-g6rw-m9mf-33ch

Frequently asked

questions

Yes, but it requires authenticated administrative access to the InvoicePlane interface. Once an attacker has such access, they can exploit the issue over HTTP(S) without direct filesystem access.

The attack requires valid administrator credentials or an equivalent ability to modify the public_invoice_template setting. Without administrative control over configuration, direct exploitation as described is not feasible.

The safest approach is to eliminate arbitrary file inclusion for templates and restrict rendering to a fixed, vetted set of template files stored in a non-executable context. Additionally, ensure that logs and other user-influenced data are never interpreted or executed as code.

Prevention relies on designing systems where configuration values select from safe options instead of providing raw paths, ensuring logs and other untrusted data are properly neutralized and stored outside executable directories, and avoiding runtime execution of content that can be influenced by users, directly or indirectly. Regular security code reviews and automated checks for dynamic file inclusion and log injection patterns also help catch these issues early.

Find out what's already
exploitable in your codebase.