/

CVE-2026-130848

Severity:

HIGH RISK

(8.8)

Code Injection (CWE-94) in Dolibarr Website Import

CVE-2026-130848

Received

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Remote Code Execution

Severity:

HIGH RISK

(8.8)

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

Dolibarr's website template import can allow PHP code embedded in a template's javascript.js.php file to execute when the public endpoint includes it. A website editor may be able to trigger this behavior without having PHP permission, potentially running code with the web server's privileges.

Affected context

The issue occurs in Dolibarr's Website::importWebSite() template-import functionality. It may put a deployment at risk when a website editor can import a template containing PHP code in javascript.js.php and the public endpoint later includes that file for execution.

Exploit preconditions

  • Attack surface: Website template import and the public javascript.js.php endpoint
  • Required access: Ability to import website templates as a website editor; PHP permission is not required according to the description
  • Trigger point: The endpoint includes the imported javascript.js.php file
  • Why exploitation is possible: PHP code in the imported file is treated as executable code when included by the endpoint

Why this happens

The import and serving path permits template content to cross from data into executable PHP. Including an imported PHP-bearing file allows its contents to run rather than treating them as inert website assets, which is a code injection flaw mapped to CWE-94.

Potential impact

  • An attacker may execute code with the web server user's privileges.
  • The application or its accessible data could be compromised.
  • An attacker could alter website content or disrupt service.
  • The web server's access to other resources could increase the scope of impact.

General mitigation guidance

Defensive patterns include treating imported templates as untrusted data, validating and constraining their contents, and keeping uploaded assets outside executable paths. Where practical, use static asset formats and serve them without a PHP include or interpreter. Apply least-privilege permissions to the web server and restrict template-import capabilities to trusted users.

How teams detect issues like this

  • Review import and asset-serving code for paths where uploaded files can reach dynamic include or execution operations.
  • Use static analysis to flag dynamic includes and execution of files from user-writable or import-controlled locations.
  • Inspect imported template archives and deployment directories for unexpected PHP files or content.
  • Enforce policies that separate uploaded assets from executable code and prevent interpreters from running in asset directories.

Sources

SourceLink
github.comgithub.com/Dolibarr/dolibarr/blob/24.0.3/htdocs/website/class/website.class.php#L1364-L1365
github.comgithub.com/Dolibarr/dolibarr/commit/71e0009105ed83057e66b11c94b552b0c378d32c
vulncheck.comvulncheck.com/advisories/dolibarr-erp-crm-through-24.0.3-code-injection-via-website-template-import

Frequently asked

questions

The described path involves website template import followed by inclusion through a public endpoint. Exploitation depends on access to the import capability and the endpoint being reached.

The description identifies website editor access as sufficient to import a template; PHP permission is not required.

Keep imported content non-executable: validate and constrain templates, store assets outside executable paths, and avoid including imported files as PHP.

Treat uploads as untrusted, limit who can import templates, separate data from executable code, and run the web server with minimal privileges.

Find out what's already
exploitable in your codebase.