In-depth lesson · technique
Command injection
What every disclosed Command injection report in the index teaches, put together: how it works, how it changed year by year, where it turns up, and things to try. Every point shows the reports it is seen in.
- disclosed reports read
- 1,836
- reports cited in this lesson
- 370
- median public bounty
- $3,000
Learning Server-side injection, step 6
Overview
What it is and why programs pay for it.
Command injection is a remote code execution technique where untrusted input reaches a shell or command interpreter and is run as part of a command. It matters because a single vulnerable parameter can turn a normal feature into full control of the host, often with the privileges of the web server or service. The evidence shows it appearing in logging libraries, proxy settings, router interfaces, CI pipelines, database connection fields and many other places where a value is passed to an external program.
Programs care because command injection usually leads to arbitrary command execution, data theft, lateral movement and persistence. In the reports behind this lesson it ranges from argument injection that overwrites files to unauthenticated remote code execution on appliances and management consoles. It is most often found where user-controlled values are concatenated into command strings, inserted into generated configuration files, or passed as command-line options without a separator.
Common locations include web management interfaces for network devices, CI and build systems, git and version control wrappers, file upload and image processing features, mail and SMTP handling, and desktop clients that open external links or protocol handlers. The lesson covers 393 reports, with 41 having summaries and 42 paid, so the evidence is broad but not every report gives full detail.
Seen in these reports11
-
$12,000 Critical -
$4,000 High -
$2,500 High
Show 5 moreShow fewer
-
$540 Low -
$480 Low -
$100 Low -
Medium -
High
How it works
The mechanics, as the reports show them.
The core mistake is that a value the user can influence is treated as part of a command rather than as data. This happens when input is inserted into a shell command string without escaping, concatenated into a command line without a separator so it is read as options, or written into a generated configuration file where newlines add new directives. The evidence shows each of these patterns across logging, proxy, ingress and CI features.
A second pattern is indirect: a configuration value is embedded in a script that users are told to run, or interpolated into a query string that is later evaluated as code. The same effect appears when environment variable names are not escaped, when a package name is concatenated into a shell command, or when a library compiles filter input into a function. In each case the boundary between data and code is lost.
The path from input to execution often runs through an external tool: git, a proxy command, an image converter, a mail library, a package manager or a CLI agent. If the tool receives the value as an argument, a leading double dash can turn it into an option; if it receives it inside a shell string, metacharacters can start a new command. The evidence shows both argument injection and shell injection variants.
What makes it possible is usually a missing or incomplete defence: no validation, no escaping, no separator before user values, or a blacklist that misses a flag or directive. The reports show fixes that were bypassed with trailing whitespace, null bytes, grouped short flags, Unicode characters and unquoted variables. This means a hunter should test not only the obvious payload but also the edges of any filter.
Impact is confirmed by showing that the injected command actually runs. Where output is not returned, out-of-band interaction is used to confirm blind execution. The evidence includes cases where a logged field reached a vulnerable logging library, where a hostname reached a proxy command, and where a router handled WAN-side requests without authentication. These show that the technique is not limited to obvious shell parameters.
Seen in these reports18
-
$540 Low -
Medium -
$12,000 Critical
Show 5 moreShow fewer
-
$12,000 Critical -
$4,000 High -
$2,500 High -
$2,000 Critical -
$505 Low
Year by year
13 yearsWhat each year's disclosed reports show, newest first. A year with few reports says less.
| 2001 | 9 |
|---|---|
| 2009 | 3 |
| 2010 | 6 |
| 2011 | 2 |
| 2012 | 4 |
| 2013 | 2 |
| 2014 | 13 |
| 2015 | 16 |
| 2016 | 23 |
| 2017 | 128 |
| 2018 | 83 |
| 2019 | 88 |
| 2020 | 140 |
| 2021 | 115 |
| 2022 | 118 |
| 2023 | 175 |
| 2024 | 145 |
| 2025 | 220 |
| 2026 | 318 |
-
2026
New this year2
- Cloud provider SDKs and developer tooling executing commands from configuration first appear in the disclosed reports this year.
- NASA web services and scientific tools with command injection first appear in the disclosed reports this year.
Kept working5
- Passing a filename containing shell syntax to a scientific data processing tool and checking for command injection was reported in the disclosed reports.
- Submitting a GeoJSON shape to a trajectory subsetting service and checking whether fields reach a shell command appeared in the disclosed reports.
-
2025
New this year1
- Many reports concerning the curl project's own scripts and command line handling first appear in the disclosed reports this year.
Kept working3
- Testing a command line tool's argument handling for injection through crafted inputs appeared in the disclosed reports.
- Testing path traversal and command injection together on an enterprise security manager was effective in the disclosed reports.
-
2024
New this year2
- Command injection in GitHub Enterprise Server management console components reaching root first appears in the disclosed reports this year.
- Command injection in partner portal endpoints at a single vendor first appears in the disclosed reports this year.
Kept working5
- Testing management console editors and their underlying services for command injection leading to root was a major theme in the disclosed reports.
- Testing template fields in management tooling for server-side template injection that reaches a shell was reported in the disclosed reports.
Earlier years10
Where it is found
48The features and places the reports found it in, most-reported first.
-
The hostname substituted into a proxy command or proxy jump setting.
-
WAN-side request handling on a router.
-
The run_id value in a DAG trigger configuration.
Seen in 1 report
-
The Extra configuration of a database connection.
-
The libjars setting of a Sqoop connection.
Seen in 1 report
Technologies in these reports16
Root causes
17The mistakes in the code or configuration behind the reports.
-
User input was passed to git without a separator, so a leading double dash was treated as a command-line option.
Seen in 3 reports
-
User input was inserted into a shell command string without escaping.
Seen in 3 reports
-
Values were inserted into generated configuration files without validation, allowing new directives.
Seen in 3 reports
-
User input was concatenated into a command line without a separator, so it was read as options.
-
Configuration values were embedded in scripts users are told to run without escaping.
Seen in 2 reports
Things to try
The most-reported tests in the largest contexts. Tick what you have tried; ticks stay in this browser and carry over to the full checklist. Test only what a program's scope allows.
ticked in this lesson
Protocol handlers and desktop clients
of 3 ticked-
Seen in 1 report
-
Seen in 1 report
CI and build pipelines
of 3 ticked-
Seen in 6 reports
-
Seen in 1 report
Router web interfaces
of 3 ticked-
Seen in 6 reports
-
Seen in 3 reports
-
Seen in 3 reports
Bypasses and variations
9How reports got past filters, encoders and other defences.
-
The fix for a protocol handler flaw used a blacklist of flags, so try a flag that was left off the list to redirect traffic.
-
The signature check compared strings and passed an unescaped filename to PowerShell, so a crafted filename bypasses it.
Seen in 1 report
-
Injected xauth commands bypassed forced commands and login-shell restrictions.
Seen in 1 report
-
Blacklisting one nginx directive did not stop other directives from being injected through the same annotation.
Seen in 1 report
-
An earlier escaping fix was incomplete and could be bypassed with trailing whitespace or periods.
Payouts
59 paidPublic bounties in US dollars, from the data. 59 of 1,836 reports show an amount.
- a quarter paid up to
- $1,000
- median
- $3,000
- three quarters paid up to
- $6,000
- highest
- $60k
One in ten paid reports was paid $20k or more.
| Severity | Reports | Paid | Median | Highest |
|---|---|---|---|---|
| Critical | 394 | 9 | $6,000 | $34k |
| High | 490 | 9 | $2,500 | $20k |
| Medium | 157 | 3 | $1,000 | $2,400 |
| Low | 14 | 9 | $500 | $1,000 |
| Informational | 5 | 1 | $4,000 | $4,000 |
| Unrated | 776 | 28 | $4,500 | $60k |
Highest-paid reports5
-
$60,000 -
$33,510 Critical -
$33,500
-
$25,000 -
$20,000
Typical fixes
8How programs fixed it, as the reports describe.
-
Validate and escape values before inserting them into generated configuration.
Seen in 3 reports
-
Escape or avoid shell interpretation of user input before building commands.
Seen in 2 reports
-
Escape configuration values before embedding them in scripts users run.
Seen in 2 reports
-
Insert a separator before user values so they cannot be read as options.
Seen in 1 report
-
Restrict which configuration-altering environment variables users can set.
Tips for beginners
13Advice for a first hunt, drawn from the reports.
-
Start with features that call external programs: image processing, file conversion, git operations, mail sending, package installation and CI build steps. The evidence lists these as common sinks, so they are good first places to look.
Seen in 5 reports
-
When you find a filter, test its edges: trailing whitespace, null bytes, grouped short flags, Unicode characters and unquoted variables. The evidence shows several fixes that were bypassed this way, so a blocked payload does not mean the bug is fixed.
Seen in 4 reports
-
Look for values that are concatenated into commands without a separator. A leading double dash can turn a value into an option, so test inputs that begin with a dash and see whether the tool treats them as flags rather than data.
Seen in 3 reports
-
Check generated configuration files and scripts. If a field accepts newlines, it may add new directives or commands. The evidence shows this in ingress annotations, SMTP settings and scripts users are told to run.
Seen in 3 reports
-
For CI and build systems, look at branch names, CI variables and pipeline checkout steps. These are user-influenced values that often reach git or shell commands.
Seen in 3 reports
Guides and techniques
The best explainers, cheat sheets and technique posts on Command injection, from around the web.
-
SSTI: A complete guide to exploiting advanced server-side template injectionsDeep guide to server-side template injection across Jinja2, Twig and ERB, including sandbox escapes and escalation to remote code execution.
Explainer intigriti.com
-
Red Team vs Pentest: Active Directory Attack WorkflowMaps Active Directory attack steps to Adaptix C2 commands and Elastic detection queries, comparing red team and pentest tradecraft.
Methodology secjuice.com
-
The ultimate Bug Bounty guide to OS command injection vulnerabilitiesBreaks down direct, blind, out-of-band and second-order OS command injection with detection and exploitation methods.
Explainer yeswehack.com
-
LFI to RCE: Mastering the Step-by-Step Path from File Inclusion to Full Shell AccessWalks through escalating a local file inclusion flaw into remote code execution using log poisoning and wrappers.
Technique medium.com
-
Fuzz Everything, Everywhere, All at OnceAFL++ maintainers show QEMU-based fuzzing of binary-only targets, including finding command and SQL injection rather than only memory corruption.
Technique media.ccc.de
Keep learning
Where this lesson fits, and what to read next.
Learning paths
The whole class
Related techniques
How this is made: our model read every listed Command injection report in the index (our own summary where we have one, otherwise the title and the platform's label), listed the patterns, and merged them. Each point was kept only if the reports it cites exist, are listed and belong here; payouts are computed from the data, not written by the model. Read the originals before relying on a point. Generated 26 Nov 2026 from 393 reports. All Command injection reports.