/

CVE-2026-37713

Severity:

HIGH RISK

(7.3)

Code Injection in Dolibarr ERP/CRM commonobject.class.php

CVE-2026-37713

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Remote Code Execution

Severity:

HIGH RISK

(7.3)

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

A code injection vulnerability in Dolibarr ERP/CRM versions 22.0.0 through 22.0.4 and 24.0.0-alpha allows remote attackers to execute arbitrary code via logic in htdocs/core/class/commonobject.class.php.

When untrusted input is incorporated into dynamically evaluated code paths, an attacker can gain control over the execution flow of the PHP application and run arbitrary commands in the context of the web server.

Affected context

This vulnerability exists in the core object handling logic of Dolibarr, specifically within htdocs/core/class/commonobject.class.php, which is widely used across ERP/CRM features.

It typically becomes relevant when user-controlled or client-supplied data is passed into dynamic code construction or evaluation mechanisms without robust validation, encoding, or restriction.

Deployments that expose Dolibarr to untrusted networks (e.g., internet-facing instances) and use affected versions are more likely to be at risk, especially where authentication or input validation is weakly enforced.

Exploit preconditions

  • Attack surface: HTTP(S) interface of the Dolibarr web application.
  • Required access: Ability to send crafted requests to endpoints that end up invoking vulnerable code paths in commonobject.class.php; depending on configuration, this may require authenticated access or exploitable pre-auth flows.
  • Trigger point: Server-side handling of request data that is incorporated into dynamically constructed PHP expressions or function calls without proper sanitization or constraint.
  • Why exploitation is possible: The code path trusted externally supplied values and allowed them to influence dynamic execution behavior, matching the pattern of CWE-94 (Evaluation of potentially malicious input as code).

Why this happens

The underlying flaw aligns with CWE-94: Improper Control of Generation of Code ('Code Injection').

At a high level, the vulnerable component builds or influences executable PHP logic using data that can be affected by a remote user, without enforcing strict constraints on allowed values.

Instead of treating user input as pure data, the implementation allows it to participate in code-like constructs (e.g., dynamic method resolution, function names, expressions, or includes), enabling attackers to craft inputs that alter the application's execution path.

The absence of strong whitelisting, canonicalization, and separation between code and data leads to a situation where dynamically generated code can be attacker-controlled.

Potential impact

  • Remote execution of arbitrary PHP code within the web server process.
  • Reading, modifying, or deleting application data managed by Dolibarr.
  • Pivoting to gain broader access to the underlying operating system, depending on server configuration and permissions.
  • Compromise of ERP/CRM records, including financial, customer, and operational information.
  • Use of the compromised instance as a foothold for lateral movement inside the organization's network.

General mitigation guidance

Effective mitigation focuses on breaking the link between untrusted input and dynamically executed code, and reducing the privileges of the runtime environment:

  • Replace any dynamic code construction or evaluation with static control flow and explicit function/method dispatch, based on whitelisted options rather than arbitrary values.
  • Treat all external input as untrusted; apply strict validation, canonicalization, and type enforcement before using values in control structures, object properties, or class/method resolution.
  • Design APIs to accept data, not fragments of code or identifiers that can map directly to executable constructs, and prefer explicit mappings over reflection-like behavior.
  • Enforce least privilege on the web server and PHP runtime, limiting filesystem access, available system commands, and database permissions so that a successful code injection has reduced impact.
  • Implement strong authentication and authorization boundaries around sensitive functionality, and minimize exposure of administrative interfaces to untrusted networks.

How teams detect issues like this

Detection should combine code-focused and runtime-oriented approaches:

  • Use static analysis and security linters configured to flag dynamic evaluation patterns (e.g., eval, create_function, variable functions, dynamic includes) and verify that they never consume data that can be influenced by remote users.
  • Incorporate targeted security code review of htdocs/core/class/commonobject.class.php and related call chains, looking for places where request parameters or database fields flow into control structures, method names, or dynamic dispatch logic.
  • Establish secure coding policies that prohibit or tightly regulate dynamic execution constructs in PHP, with automated CI/CD checks to block regressions.
  • Employ application-layer monitoring and web application firewalls with rules tuned to detect anomalous payloads indicative of code injection attempts, such as code-like strings in parameters commonly processed by the vulnerable component.

Sources

SourceLink
bryamzxz.github.iobryamzxz.github.io/2026/05/25/dol_eval-five-years/
github.comgithub.com/Dolibarr/dolibarr/security/advisories/GHSA-cq92-jp5j-rwvj

Frequently asked

questions

Yes. The issue arises in server-side request handling, so a remote attacker who can reach the Dolibarr web interface and trigger the affected code path can potentially exploit it, subject to any authentication or access controls in front of the vulnerable functionality.

That depends on the specific routes and workflows that invoke the vulnerable logic. In some deployments, only authenticated users may reach the relevant functionality, while in others misconfigurations or public-facing endpoints might make it reachable pre-auth. Treat it as potentially high risk until access requirements are carefully assessed.

The most robust pattern is to eliminate dynamic code construction entirely and rely on fixed control flow with explicit whitelists. Where dynamic behavior is necessary, inputs should be constrained to a small, validated set of allowed values that cannot alter code structure or semantics.

Adopt secure coding guidelines that enforce strict separation between code and data, ban or tightly control dynamic execution features, and require input validation at all trust boundaries. Back this with automated static analysis in CI, regular security-focused code reviews of core components, and principle-of-least-privilege configurations for the runtime environment.

Find out what's already
exploitable in your codebase.