Export
The link always opens the latest version of this page.
Ask an AI about it
Open in ChatGPTA new chat that reads this entry from the site Open in ClaudeThe same, in ClaudeShare the link instead of a file, and they will always see the latest version.
Files are a snapshot of today. The live page has anything newer.
CWE-78: OS Command Injection
The product constructs an OS command from external input without neutralizing special elements.
OS command injection occurs when a product constructs an operating system command using external input without properly neutralizing special elements that could alter command execution.
Characteristics
This is classified as a base-level weakness1, representing a fundamental vulnerability pattern rather than a variant of another weakness.
Consequences
The vulnerability enables multiple severe attack outcomes:
Remote Code Execution: Attackers can achieve remote code execution2 through various vectors, including diagnostic CGI scripts3. When the vulnerable application runs with elevated privileges, attackers gain remote code execution as root4.
Arbitrary Command Execution: The improper neutralization of special elements in OS commands5 allows arbitrary command execution on the target system. If the application operates with root privileges, attackers can execute arbitrary commands as root. This extends to arbitrary code execution more broadly.
Privilege Escalation: Depending on the application context, successful exploitation can result in root command execution, root command execution on network devices like routers, or arbitrary command execution as root.
Attack Mechanism
The vulnerability arises when developers concatenate or interpolate untrusted input directly into OS command strings without sanitization. Special shell metacharacters (such as ;, |, &, $(), or backticks) in the input can break out of the intended command context and execute arbitrary commands.
Common vulnerable patterns include:
- Using
system(),exec(), or similar functions with unsanitized user input - Shell command construction through string concatenation
- Insufficient input validation or filtering
Proper mitigation requires either avoiding OS command execution entirely, using parameterized APIs that separate commands from arguments, or implementing strict input validation and escaping appropriate to the target shell environment.
In the news 5
- CVE-2026-25089: FortiSandbox unauthenticated command injection added to CISA KEV · Hacker News (YC)
- Payara 7.2026.1.RC1 Remote Code Execution via Server-Side Includes #exec Directive in Payara Server · Full Disclosure
- podcast SANS Stormcast Wednesday, August 5th, 2026: Diagnostic Tool Hunt; Device Code Phishing; XCSSET; NuGet API Keys · SANS ISC: Daily Podcast
- **Subject:** CVE-2026-2035703: Tozed ZLT X300 5G CPE — Unauthenticated Remote Root Code Execution via TR-069 Command Injection (CVSS 9.8) · Full Disclosure
- [0day-rubbish] South River Technologies Titan MFT Server 26.0.0 first-run administrator setup chained to job post-command injection, NT AUTHORITY\SYSTEM (8.1) · Full Disclosure
Sign in for the full story cards: summaries, tags and starring.