/

CVE-2026-10273

Severity:

HIGH RISK

(7.3)

OS Command Injection in php-censor Webhook GitBuild Handler

CVE-2026-10273

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-77, CWE-78

Impact:

Remote Code Execution via Command Injection

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

php-censor versions up to 2.1.6 contain an OS command injection vulnerability in the Webhook Endpoint logic for GitBuild, where the commitId argument is incorporated into shell commands.

A remote attacker who can trigger the webhook with crafted input may execute arbitrary system commands with the privileges of the php-censor process.

Affected context

The vulnerability occurs in php-censor's Webhook Endpoint, specifically within the Git-based build handling in src/Model/Build/GitBuild.php.

It is relevant when:

  • php-censor is configured to accept webhook requests (e.g., from Git hosting services)
  • The commitId parameter from the webhook is used to construct shell commands without robust sanitization or escaping
  • The underlying environment allows execution of system commands for repository operations (e.g., git checkout, fetch, or clone)

In such setups, hostile input in the commitId field can be propagated into a shell context.

Exploit preconditions

  • Attack surface: HTTP(S) Webhook Endpoint exposed to external or internal networks.
  • Required access: Ability to send requests to the php-censor webhook URL (often unauthenticated or weakly authenticated in CI/CD setups).
  • Trigger point: Submission of a specially crafted commitId value in a webhook payload that causes the backend to execute a shell command involving that value.
  • Why exploitation is possible: The application constructs and executes OS commands using untrusted commitId input without consistently applying strict validation, escaping, or safe APIs that avoid invoking a shell.

Why this happens

This is a classic OS command injection issue where user-controlled data is incorporated directly into shell commands.

In GitBuild's webhook processing, the commitId argument influences the construction of command strings passed to the operating system (e.g., through functions that spawn a shell).

Because the input is not adequately constrained to expected formats (such as strict commit hashes) and is not safely parameterized or escaped, attackers can inject additional shell metacharacters and arbitrary commands.

This maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, and also relates to CWE-77, where command syntax elements are not neutralized before being passed to the interpreter.

Potential impact

  • Execution of arbitrary system commands with the privileges of the php-censor service user
  • Compromise of the CI/CD environment, including access to build artifacts and environment secrets
  • Tampering with source code checkouts and build outputs, leading to supply-chain attacks
  • Pivoting to other internal systems reachable from the compromised host
  • Exfiltration or destruction of sensitive configuration, logs, and cached credentials

General mitigation guidance

Effective mitigation centers on avoiding direct shell invocation with untrusted data and strictly constraining inputs:

  • Prefer high-level, parameterized APIs (e.g., language-native Git libraries or functions that do not invoke a shell) instead of building shell command strings.
  • Enforce strict validation on commitId and related parameters (e.g., whitelisting hexadecimal SHA-1/SHAx patterns and rejecting anything else).
  • If shell execution is unavoidable, use APIs that bypass the shell and pass arguments as separate parameters, and apply robust escaping of any user-influenced values.
  • Run the CI/CD service with least-privilege OS accounts and minimal filesystem and network permissions to limit blast radius.
  • Isolate build runners or workers in separate, constrained environments (containers, VMs) to reduce cross-project impact if a build context is compromised.
  • Treat webhook endpoints as semi-trusted at best, and apply authentication or signing (e.g., shared secret, HMAC) to reduce exposure to arbitrary senders.

How teams detect issues like this

Detection typically relies on a combination of code-level analysis and runtime monitoring:

  • Static analysis: Configure rules or linters to flag dynamic shell command construction using variables derived from HTTP request parameters or webhook payloads.
  • Code review signals: Look for exec, shell_exec, system, backtick operators, or similar OS command APIs in webhook handling paths, especially where Git operations are implemented.
  • Security testing: Use targeted fuzzing or dynamic application security testing (DAST) on webhook endpoints, with payloads designed to reveal command injection behavior (e.g., benign command separators that alter responses).
  • Operational monitoring: Monitor application and system logs for unexpected command patterns, anomalous Git operations, or processes spawned by the php-censor runtime that do not align with normal build workflows.
  • Policy enforcement: Integrate security checks into CI to block new uses of shell-based command execution in network-exposed request handlers.

Sources

SourceLink
github.comgithub.com/php-censor/php-censor/
github.comgithub.com/php-censor/php-censor/commit/cd68d102601320bd319d590b75f7652e66f0685f
github.comgithub.com/php-censor/php-censor/issues/442
github.comgithub.com/php-censor/php-censor/pull/441
vuldb.comvuldb.com/cve/CVE-2026-10273
vuldb.comvuldb.com/submit/825315
vuldb.comvuldb.com/vuln/367552
vuldb.comvuldb.com/vuln/367552/cti

Frequently asked

questions

Yes. Because it resides in the Webhook Endpoint, any party able to reach that endpoint and supply a crafted commitId value may attempt exploitation, subject to any authentication or network restrictions in front of the service.

The attacker needs network access to the php-censor webhook URL and the ability to send HTTP requests that influence the commitId parameter.

If the webhook is exposed on the internet without strong authentication, this can be exploited by unauthenticated remote attackers.

Replace shell-based command execution with safe, parameterized APIs that do not interpret strings as shell commands, and strictly validate any user-supplied identifiers against a narrow, expected format.

When shell interaction cannot be avoided, ensure all arguments are passed as discrete parameters and aggressively validate and sanitize any values that come from external sources.

Establish coding standards that prohibit direct shell command construction in request handlers, enforce input validation for all externally influenced data, and integrate automated security review tools into CI to catch injection patterns early.

Combine these with regular security-focused code reviews and design reviews for webhook and CI/CD integration points.

Find out what's already
exploitable in your codebase.