/

CVE-2026-54182

Severity:

HIGH RISK

(8.1)

OS Command Injection (CWE-78) in Backpack CRUD Stats

CVE-2026-54182

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-20, CWE-78, CWE-116

Impact:

Remote Code Execution

Severity:

HIGH RISK

(8.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

A command-injection vulnerability in Backpack CRUD allows an unauthenticated attacker to influence a shell command through the HTTP Host header. When the vulnerable request path, execution environment, and random trigger condition align, injected operating-system commands may run with the web-server user's privileges.

Affected context

The issue occurs in Backpack CRUD deployments where the affected statistics request path is reached during service-provider startup, the Host header can pass through to PHP without adequate validation, and PHP has access to both exec() and curl. Reverse proxies that validate Host values and hardened PHP configurations may reduce exposure, but the underlying command-construction flaw remains present in affected releases.

Exploit preconditions

  • Attack surface: HTTP requests reaching the Backpack CRUD service-provider initialization path
  • Required access: No authentication is generally required if the request reaches the vulnerable code
  • Trigger point: Construction and execution of the statistics-related shell command
  • Input condition: A malformed or attacker-controlled Host header must influence the command URL
  • Runtime condition: PHP must permit exec(), the required curl functionality must be available, and the probabilistic trigger must be reached
  • Why exploitation is possible: Host-derived data is incorporated into a shell command without sufficient shell neutralization; repeated requests may eventually satisfy the random gate

Why this happens

The vulnerability results from mixing attacker-influenced HTTP input with shell command construction and passing the resulting command to exec(). The Host header is treated as suitable command data without a strong trust boundary or complete shell metacharacter handling, allowing command syntax to alter the intended operation. This maps primarily to CWE-78: Improper Neutralization of Special Elements used in an OS Command, with related concerns involving CWE-20: Improper Input Validation and CWE-116: Improper Encoding or Escaping of Output.

Potential impact

  • An attacker may execute operating-system commands as the web-server user
  • Application credentials and environment secrets could be exposed
  • Local files and reachable internal services may be accessed
  • Application data could be modified or corrupted
  • Services may be disrupted
  • The compromised process could be used to probe or affect adjacent systems, subject to runtime privileges

General mitigation guidance

Mitigation centers on removing shell interpretation from application logic and reducing trust in request-derived host data.

Common defensive patterns include:

  • Replacing shell command execution with a direct library or API call that does not invoke a shell
  • Using fixed, server-side configuration rather than deriving command arguments from the Host header
  • Applying strict allowlist validation to canonical hostnames at the reverse proxy and application boundaries
  • Avoiding ad hoc escaping as the primary defense when a non-shell interface is available
  • Disabling unnecessary command-execution capabilities such as exec() in PHP deployments
  • Running the application with least-privilege service accounts and restricted filesystem and network access
  • Adding regression tests for hostile host values and command-construction paths

How teams detect issues like this

Detection can combine source review, runtime monitoring, and deployment policy controls:

  • Use static analysis to identify request-derived values flowing into exec(), shell wrappers, or command strings
  • Review code for concatenation or interpolation of Host-header data into subprocess arguments
  • Flag shell execution where a direct language or library API could provide the same function
  • Monitor web-server and application logs for repeated malformed Host headers or unusual request bursts
  • Alert on child processes spawned by the PHP worker and on unexpected outbound connections from web processes
  • Enforce policies that restrict shell execution functions and require approved process-spawning interfaces
  • Automated security review tools may help identify command-injection data flows, but findings should be validated against deployment configuration

Sources

SourceLink
github.comgithub.com/Laravel-Backpack/CRUD/commit/0f2faafc22a15d77c14370f163d8f739f933c28c
github.comgithub.com/Laravel-Backpack/CRUD/commit/1476a3769d94a410a2d2e9576deb522e84002f2a
github.comgithub.com/Laravel-Backpack/CRUD/commit/282ba2a0b88749fb1888b3836678ba462d7023f0
github.comgithub.com/Laravel-Backpack/CRUD/commit/471935e296b1be1a7216fdf10c8823e1f512f601
github.comgithub.com/Laravel-Backpack/CRUD/pull/6012
github.comgithub.com/Laravel-Backpack/CRUD/releases/tag/4.1.72
github.comgithub.com/Laravel-Backpack/CRUD/releases/tag/5.6.2
github.comgithub.com/Laravel-Backpack/CRUD/releases/tag/6.8.13
github.comgithub.com/Laravel-Backpack/CRUD/releases/tag/7.0.36
github.comgithub.com/Laravel-Backpack/CRUD/security/advisories/GHSA-mrc5-3mm3-45c5

Frequently asked

questions

Yes. It can be reachable through unauthenticated HTTP requests when attacker-controlled Host values reach the vulnerable code and the required PHP capabilities are enabled. A probabilistic trigger means repeated requests may be necessary.

Not necessarily. The described attack surface is an HTTP endpoint reached during application initialization, so exposure depends primarily on proxy routing, Host-header handling, and runtime configuration rather than user credentials.

Remove shell invocation from the affected operation and use a direct API or library call. Host-derived values should not control shell commands; if host selection is required, use a strict allowlist and trusted server-side configuration.

Treat all request headers as untrusted, prohibit shell command construction from HTTP input, apply least privilege, restrict dangerous PHP functions, and use static analysis and regression tests to detect input-to-command data flows.

Find out what's already
exploitable in your codebase.