OS Command Injection in `ip link show` via Unsanitized `param` Argument
The application built a shell command by concatenating a user-supplied argument into a string executed through a shell, so shell metacharacters in that argument were interpreted as command syntax. An attacker who controls the argument could append and run arbitrary operating system commands in the context of the vulnerable process.
Published on medium.com
Cybersecurity
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
The ip link show handler in the affected application shells out to an interface-configuration utility, referred to in the code as IFCONFIG. To do this it shells out to an interface-configuration utility, referred to in the code as IFCONFIG, and passes the caller's argument through to it. The argument is named param and is taken from argv, the command-line arguments supplied to the program at invocation.
That design is the whole story here. The handler does not run IFCONFIG directly with a structured argument list. It builds a command string and hands that string to a shell, so anything the caller puts into param is parsed by the shell as syntax rather than treated as an opaque value.

Setup
No accounts, roles or special tooling are described. The precondition is simply the ability to invoke the program with a chosen command-line argument, since param comes straight from argv. The report does not establish whether that invocation is local only or reachable by remote or untrusted parties, and it does not establish the privilege level of the process that runs the handler. Both points matter later, when the severity is discussed.
Finding it
The vulnerable line is:
status, res = subprocess.getstatusoutput(IFCONFIG + " -v " + param + " 2>/dev/null")
What makes this look wrong is the combination of two things. First, the command is assembled by plain string concatenation: the path to IFCONFIG, a literal " -v ", the raw param value, and a literal " 2>/dev/null". There is no argument separation at all; everything is flattened into one string. Second, subprocess.getstatusoutput() executes its argument through /bin/sh (or the platform-equivalent shell). It does not execute a program with an explicit argument list. It hands a single string to a shell for interpretation, exactly as if that string had been typed at a prompt.
Because the shell parses the entire string, any shell metacharacter inside param, such as ;, |, &&, backticks or $(), is interpreted according to shell grammar instead of being passed through as literal data. A semicolon, for instance, terminates one command and begins another within the same shell invocation. The application's intent was to pass param as a single inert argument to IFCONFIG; the concatenation collapses the boundary between argument and command.
Exploitation
Step 1: supply a metacharacter in param
The confirmed proof of concept sets param to the string eth0; id:
ip link show "eth0; id"
Step 2: observe how the string is transformed
The application intends to build and execute the following shell string:
<IFCONFIG_PATH> -v eth0; id 2>/dev/null
This is not one command. It is the shell string <IFCONFIG_PATH> -v eth0, followed by ; id 2>/dev/null. The shell parses the semicolon as a command separator, so it sees two sequential, independent commands:
<IFCONFIG_PATH> -v eth0, the command the application intended to run.id, a second, fully independent command injected by the attacker, with its stderr redirected to/dev/nullbecause of the trailing redirection that was originally intended for the first command.
Step 3: confirm execution
The shell executes both commands in sequence. The second one, id, was never intended by the application's author to run. Its execution, under the identity and privileges of the process invoking the vulnerable code, is the confirmed impact. id was chosen because it is safe, non-destructive and universally available, and its output (user and group identity) is enough to demonstrate arbitrary command execution without inspecting, modifying or exfiltrating any data. No destructive payloads, persistence, credential access or post-exploitation steps are described or needed to confirm the class of bug.
Root cause
The failure is the construction of a shell command by concatenating trusted and untrusted data, then executing it through a shell that interprets the combined string as syntax rather than as inert data. Several mistakes layer together:
- Command construction via concatenation. Building the command as a single string (
IFCONFIG + " -v " + param + " 2>/dev/null") merges the fixed, trusted parts with the variable, untrusted part into one undifferentiated blob. - Attacker-controlled input.
paramcomes fromargv, external input, with no validation, allow-listing or sanitisation step indicated in the provided code before it is used. - Shell interpretation.
subprocess.getstatusoutput()routes the resulting string through a shell, which actively parses it for metacharacters, operators and syntax instead of treating it as a single opaque token. - Missing argument isolation. Because the command is never expressed as a structured list of discrete arguments, there is no boundary the shell is obliged to respect between the flag, the value and the redirection. Everything is just characters in a string, and the shell's grammar decides how they are grouped and executed.
The safe alternative, passing arguments as a structured array with shell=False, avoids all of this by never invoking a shell. Each element of the array goes directly to the operating system's process-creation mechanism as a discrete, literal argument, so there is no parsing step in which metacharacters can be reinterpreted as command syntax.
Impact
Observed and confirmed: arbitrary command execution in the security context of the vulnerable process, demonstrated by running an injected id command.
Potential and deployment-dependent: the wider consequences scale with the privileges and environment of the vulnerable process, none of which the evidence establishes.
| Impact | What it would require | Status |
|---|---|---|
| Confidentiality | The process has read access to sensitive files, network resources or credentials | Not determined |
| Integrity | The process has write access to configuration, application data or system files | Not determined |
| Availability | The process privileges allow disruption of the host or service | Not determined |
The distinction matters. What has been directly demonstrated is execution of a single benign informational command. Reading files, modifying state or disrupting availability depends entirely on the privilege level and runtime environment of the vulnerable process, neither of which the confirmed evidence establishes. Those broader outcomes are the general category of risk associated with arbitrary command execution, not demonstrated results.
Fix
The preferred remediation removes the shell from the execution path entirely:
subprocess.run([IFCONFIG, "-v", param], shell=False)
param becomes a single discrete element of an argument array. Whatever characters it contains, semicolons, pipes, backticks or otherwise, it is delivered to the target program as one literal argument value. With no intermediate shell there is nothing to parse it, so shell metacharacters lose their special meaning and become ordinary characters inside a single argument string.
An alternative mitigation is to escape the value before it goes through a shell:
shlex.quote(param)
shlex.quote() escapes a string so that it is treated as a single literal token if it must pass through a shell. It reduces risk when applied correctly, but it is a mitigation on top of a fundamentally shell-based design rather than a removal of the underlying risk. Escaping logic is prone to subtle mistakes, edge cases and inconsistent application across a codebase. The argument-array plus shell=False approach is preferred because it removes the shell, and with it the entire class of shell-metacharacter risk, instead of trying to neutralise that risk defensively at each call site.
One caveat: whether param is expected to contain characters that need special handling even outside a shell, for example if IFCONFIG itself performs further parsing of its argument, is not determined by the evidence and should be verified against the target utility's own argument handling.
Variants to test
- A positive result is the output of the injected command appearing in the handler's response or side effects, showing the shell parsed the operator rather than passing it through.
- A positive result is the same semicolon or pipe trick producing a second command's output.
- A positive result is a file appearing with attacker-chosen content.
- A positive result is the utility behaving as if a flag you supplied in
paramwere a real option. - A positive result is a higher-privileged identity than the caller, which turns confirmed execution into a privilege boundary crossing.
Disclosure and CVE status
Disclosure dates are not publicly specified. The issue was submitted to and published by MITRE under the candidate identifier below; as of writing, no final formatted CVE-2026-XXXXX identifier has been issued.
CVE Candidate: CAN-2026-2035735Final CVE ID: Not yet confirmed
The reported score is CVSS 10.0 (Critical), as assigned as part of the MITRE submission. A 10.0 typically corresponds to no privileges required, no user interaction, a network attack vector and complete impact to confidentiality, integrity and availability. The evidence confirmed here, a handler triggered via a command-line argument, does not by itself say whether the code path is reachable locally only or exposed to remote or untrusted parties, nor the privilege level of the invoking process. Those are exactly the factors that drive a score toward the ceiling. The write-up presents 10.0 as MITRE's official score and notes that the deployment-specific factors behind it are not independently detailed beyond what is stated.
Conclusion
The bug comes from executing attacker-controlled input through a system shell after concatenating it into a command string, instead of passing it as an isolated, structured argument. The confirmed proof of concept, eth0; id, shows that shell metacharacters in param are interpreted as command syntax, giving arbitrary command execution in the security context of the vulnerable process. The recommended fix is to eliminate the shell entirely with subprocess.run([IFCONFIG, "-v", param], shell=False), which passes param as a discrete argument and removes the conditions under which shell-metacharacter injection is possible.
What happened, in plain words
A program had a feature that shells out to a separate utility, which the code calls IFCONFIG. To do that reporting, the program did not do the work itself. It asked a separate, older utility to do it, a utility the code calls IFCONFIG. The program took a piece of text supplied by whoever ran it, a value called param, and glued it onto a command line that it then handed to the operating system's shell to run.
That gluing is the whole problem. The shell is the part of the operating system that reads a line of text and decides what to run. It does not know which parts of the line came from the program's author and which parts came from a user. It just reads characters. So when a user put a special character into param, the shell treated that character as an instruction rather than as ordinary text, and ran a second command that the program's author never intended.
The researcher confirmed this by supplying eth0; id as the value. The id command ran on the host. That is the confirmed result: an injected command runs with the same permissions the program itself has.

The background you need first
Before the details make sense, a few everyday ideas.
A command line. When you open a terminal on a computer, you type a line of text and press Enter. The computer reads that line and does something. The line is called a command. For example, typing id and pressing Enter asks the computer to tell you which user account you are currently using.
The shell. The shell is the program that reads your command line and works out what to run. It is a bit like a receptionist reading a handwritten note: it does not just pass the paper along, it reads the words and acts on the punctuation. A full stop means one sentence has ended. A semicolon means a new instruction is starting. The shell has its own punctuation rules, and it follows them whether the line was typed by a person or assembled by another program.
A command-line argument. Many commands accept extra words that change what they do. If you type ip link show eth0, the last word eth0 is an argument: it tells the command which network interface you care about. In the program discussed here, the argument is called param, and it comes from argv. argv is simply the list of words the program was started with, the same words a person typed on the command line.
A network interface. A network interface is the part of a computer that connects it to a network, for example a wired connection or a wireless one. eth0 is a common name for the first wired interface on a Linux machine. The feature in question, ip link show, is meant to report on interfaces like this one.
Python and subprocess. The program is written in Python, a programming language. Python has a built-in toolkit called subprocess for starting other programs. One of its functions, subprocess.getstatusoutput(), takes a piece of text, hands it to the shell, and gives back what the shell said. The important detail is that it hands the text to the shell, not to the program directly. The shell reads it first.
String concatenation. This means joining pieces of text end to end, like sticking words together with no gap. If you join "hello " and "world" you get "hello world". In code, the plus sign does this. The danger is that joining text from a trusted source with text from an untrusted source produces one long piece of text in which the two are no longer distinguishable.
OS Command Injection. This is the name of the bug class. It means that untrusted input ends up being interpreted as part of an operating system command. The formal catalogue number for it is CWE-78. The everyday comparison: imagine a form at a hotel that says "Name:" and you write Alice, and also give me the master key. If the receptionist reads the whole line as instructions rather than as a name, the form has a command injection problem. The fix is to make sure the receptionist treats everything after "Name:" as a name, not as instructions.
A proof of concept (PoC). A small, safe demonstration that proves a bug is real. It is deliberately harmless so that nobody can accuse the researcher of causing damage.
Setting the scene
The report describes no accounts, no roles and no special tools. The only precondition is being able to run the program with an argument of your choosing, because param comes straight from argv, the words on the command line.
Two things are left open, and they matter later when severity is discussed. First, the report does not establish whether the program can only be run locally by someone sitting at the machine, or whether remote or untrusted parties can reach it. Second, it does not establish which user account the program runs as, and therefore how much power an injected command would have. Keep both in mind.
Finding the problem
The line of code at fault is this:
status, res = subprocess.getstatusoutput(IFCONFIG + " -v " + param + " 2>/dev/null")
Line by line, in plain words:
status, res =means the result of the call on the right is stored in two variables.statuswill hold a number saying whether the command succeeded, andreswill hold the text the command produced.subprocess.getstatusoutput(...)is the Python function that hands a piece of text to the shell and collects the answer.IFCONFIGis the path to the interface utility, the separate program that does the actual reporting.+ " -v " +glues on a space, a dash, avand another space.-vis a flag, an option that changes how the utility behaves.+ param +glues on the user-supplied value, exactly as supplied, with nothing done to it.+ " 2>/dev/null"glues on a redirection. In shell terms,2>means "send error messages to", and/dev/nullis a special file that throws away whatever is written to it. So this part means "discard any error messages".
Two things together make this look wrong.
First, the command is assembled by plain string concatenation. The path to IFCONFIG, the literal " -v ", the raw param value and the literal " 2>/dev/null" are all flattened into one string. There is no separation between them at all. The program cannot later tell the shell "this part is the flag, this part is the value".
Second, subprocess.getstatusoutput() runs its argument through /bin/sh, the standard shell on Linux and similar systems. It does not start a program with an explicit list of arguments. It hands one string to a shell, exactly as if a person had typed that string at a prompt.
Because the shell reads the whole string, any shell metacharacter inside param is interpreted by the shell's grammar instead of being passed through as literal text. A metacharacter is a character with a special meaning to the shell. Examples named in the report are ;, |, &&, backticks and $(). A semicolon, for instance, ends one command and starts another within the same shell run. The author's intention was to pass param as one inert value to IFCONFIG. The concatenation destroys the boundary between an argument and a command.
Exploiting it
Step 1: put a metacharacter into param
The confirmed proof of concept sets param to the string eth0; id:
ip link show "eth0; id"
What this line means, piece by piece:
ip link showis the feature being used, the one that reports on network interfaces.- The double quotes group everything inside them into a single argument as far as the outer command line is concerned. So the program receives one argument whose value is
eth0; id. eth0is the interface name the user pretends to care about.;is the semicolon, the shell's "end of command, start of next command" marker.idis a standard command that prints which user and groups you are running as.
Why this step: the researcher needs to show that a character with special meaning to the shell survives all the way into the command string. The semicolon is the simplest such character, and id is the simplest harmless command to run after it.
Step 2: see how the string is transformed
The application intends to build and run this shell string:
<IFCONFIG_PATH> -v eth0; id 2>/dev/null
What each part is:
<IFCONFIG_PATH>stands for the location of the interface utility on disk. The report uses this placeholder rather than a real path.-v eth0is the flag and the interface name the program meant to pass.;is the separator that the user smuggled in throughparam.idis the extra command the user wants to run.2>/dev/nullis the redirection the program always appends, now sitting at the end of the injected command instead of the original one.
This is not one command. It is the shell string <IFCONFIG_PATH> -v eth0, followed by ; id 2>/dev/null. The shell reads the semicolon as a command separator, so it sees two independent commands in sequence:
<IFCONFIG_PATH> -v eth0, the command the application meant to run.id, a second, fully independent command injected by the attacker, with its error output discarded because of the trailing redirection that was originally meant for the first command.
Why this step: it shows the exact moment the boundary breaks. The program thought it was passing one value. The shell saw two commands.
Step 3: confirm that it ran
The shell runs both commands in order. The second one, id, was never meant by the author to run at all. Its execution, under the identity and permissions of the process running the vulnerable code, is the confirmed impact.
id was chosen because it is safe, does not change anything, and is available on essentially every system. Its output, the user and group identity, is enough to prove that arbitrary command execution is possible without reading, changing or stealing any data. No destructive payloads, no persistence, no credential access and no follow-up attack steps are described or needed to confirm this class of bug.
Why this step: a proof of concept has to be convincing and harmless at the same time. Printing your own identity proves the command ran, without touching anything valuable.
Why it happens
The failure is building a shell command by joining trusted and untrusted text, then running it through a shell that reads the joined string as instructions rather than as plain data. Several mistakes stack up:
- Building the command by concatenation. Writing the command as one string (
IFCONFIG + " -v " + param + " 2>/dev/null") merges the fixed, trusted parts with the variable, untrusted part into one blob with no internal boundaries. - Attacker-controlled input.
paramcomes fromargv, which is outside input, and the code shown contains no validation, allow-list or sanitisation step before it is used. An allow-list is a list of permitted values; anything not on the list is rejected. - Shell interpretation.
subprocess.getstatusoutput()sends the resulting string through a shell, and the shell actively looks for metacharacters, operators and syntax instead of treating the string as one opaque token. - No argument isolation. Because the command is never written as a structured list of separate arguments, there is no boundary the shell is obliged to respect between the flag, the value and the redirection. Everything is just characters in a string, and the shell's grammar decides how they are grouped and run.
The safe alternative is to pass the arguments as a structured array with shell=False. That avoids all of this by never starting a shell. Each element of the array goes directly to the operating system's process-creation mechanism as a separate, literal argument. There is no reading step in which metacharacters could be reinterpreted as instructions, because there is no shell there to do the reading.
What the impact is, and what it is not
Observed and confirmed: arbitrary command execution in the security context of the vulnerable process, shown by running an injected id command. "Security context" means the user account and permissions the program runs under. Whatever that account can do, the injected command can do too.
Potential and dependent on the deployment: the wider consequences depend on the permissions and environment of the vulnerable process, and the evidence does not establish either.
| Impact | What it would require | Status |
|---|---|---|
| Confidentiality | The process can read sensitive files, network resources or credentials | Not determined |
| Integrity | The process can write to configuration, application data or system files | Not determined |
| Availability | The process permissions allow disruption of the host or service | Not determined |
Confidentiality means keeping data secret. Integrity means keeping data correct and unmodified. Availability means keeping a service working. The distinction matters. What has been directly shown is one harmless informational command running. Reading files, changing state or disrupting a service depends entirely on the permissions and runtime environment of the vulnerable process, and the confirmed evidence establishes neither. Those wider outcomes are the general category of risk that comes with arbitrary command execution, not demonstrated results.
The fix
The preferred fix removes the shell from the path entirely:
subprocess.run([IFCONFIG, "-v", param], shell=False)
Line by line:
subprocess.run(...)starts a program and waits for it to finish.[IFCONFIG, "-v", param]is a list, a structured set of separate items. The first item is the program to run, the second is the flag, the third is the user's value.shell=Falsetells Python not to involve a shell at all. The list goes straight to the operating system.
param becomes one separate element of an argument list. Whatever characters it contains, semicolons, pipes, backticks or anything else, it is delivered to the target program as one literal argument value. With no shell in between there is nothing to read it as instructions, so shell metacharacters lose their special meaning and become ordinary characters inside a single argument.
An alternative mitigation is to escape the value before it goes through a shell:
shlex.quote(param)
Line by line:
shlexis a Python module for working with shell-style text..quote(param)wraps and escapes the value so that, if it must pass through a shell, the shell treats it as one literal token.
shlex.quote() reduces risk when applied correctly, but it is a patch on top of a design that still uses a shell, not a removal of the underlying risk. Escaping logic is easy to get subtly wrong, has edge cases, and can be applied inconsistently across a codebase. The argument-list plus shell=False approach is preferred because it removes the shell, and with it the whole class of shell-metacharacter risk, instead of trying to neutralise that risk defensively at every call site.
One caveat: whether param is expected to contain characters that need special handling even outside a shell, for example if IFCONFIG itself does further reading of its argument, is not determined by the evidence and should be checked against how that utility handles its own arguments.
Other things worth testing
These are variations a tester would try next, each with the reason and the sign of success.
- A positive result is the output of the injected command appearing in the handler's response or side effects, showing the shell read the operator rather than passing it through. Why: different operators behave differently, and confirming more than one shows the problem is general, not a quirk of the semicolon.
- A positive result is the same semicolon or pipe trick producing a second command's output. Why: the same mistake is often repeated elsewhere in a program.
- A positive result is a file appearing with content the attacker chose. Why: redirection is another shell feature that can be abused once the shell is reading your text.
- A positive result is the utility behaving as if a flag supplied in
paramwere a real option. Why: removing the shell fixes shell injection, but a program can still misinterpret a value that looks like a flag. - A positive result is a higher-privileged identity than the caller, which turns confirmed execution into a privilege boundary crossing. Why: the same bug is far more serious if the program runs with more power than the person triggering it.
Disclosure and CVE status
Disclosure dates are not publicly specified. The issue was submitted to and published by MITRE under the candidate identifier below. MITRE is the organisation that maintains the public catalogue of known vulnerabilities. As of writing, no final formatted CVE-2026-XXXXX identifier has been issued. A CVE is a public reference number for a specific vulnerability, so that everyone can talk about the same issue unambiguously.
CVE Candidate: CAN-2026-2035735Final CVE ID: Not yet confirmed
What this block says:
CVE Candidate: CAN-2026-2035735is the provisional identifier MITRE assigned while the record is being processed.Final CVE ID: Not yet confirmedmeans the permanentCVE-2026-XXXXXnumber has not been issued yet.
The reported score is CVSS 10.0 (Critical), as assigned as part of the MITRE submission. CVSS is a standard scoring system for how severe a vulnerability is, from 0 to 10. A 10.0 usually corresponds to no privileges required, no user interaction, a network attack vector and complete impact to confidentiality, integrity and availability. The evidence confirmed here, a handler triggered through a command-line argument, does not by itself say whether the code path can only be reached locally or is exposed to remote or untrusted parties, nor which user account the process runs as. Those are exactly the factors that push a score towards the maximum. The write-up presents 10.0 as MITRE's official score and notes that the deployment-specific factors behind it are not independently detailed beyond what is stated.
Conclusion
The bug comes from running attacker-controlled input through a system shell after joining it into a command string, instead of passing it as a separate, structured argument. The confirmed proof of concept, eth0; id, shows that shell metacharacters in param are read as command syntax, giving arbitrary command execution in the security context of the vulnerable process. The recommended fix is to remove the shell entirely with subprocess.run([IFCONFIG, "-v", param], shell=False), which passes param as a separate argument and removes the conditions under which shell-metacharacter injection is possible.
Glossary
- Argument: an extra word given to a command to change what it does, such as an interface name or a flag.
- Argument injection: making a program treat a supplied value as an option or flag because it starts with a dash.
- argv: the list of words a program was started with on the command line.
- Availability: keeping a service or system working and reachable.
- Command line: the line of text you type into a terminal and run by pressing Enter.
- Command injection: a bug where untrusted input is read as part of an operating system command.
- Concatenation: joining pieces of text end to end into one string.
- Confidentiality: keeping data secret from people who should not see it.
- CVE: a public reference number for a specific known vulnerability.
- CVSS: a standard 0 to 10 score for how severe a vulnerability is.
- CWE-78: the catalogue entry for OS Command Injection, improper neutralisation of special elements used in an OS command.
/dev/null: a special file that discards anything written to it.eth0: a common name for the first wired network interface on a Linux machine.- Flag: an option given to a command, usually starting with a dash, that changes its behaviour.
id: a standard command that prints the current user and group identity.- Integrity: keeping data correct and unmodified.
- Metacharacter: a character with special meaning to the shell, such as
;,|,&&, backticks or$(). - MITRE: the organisation that maintains the public catalogue of known vulnerabilities.
- Network interface: the part of a computer that connects it to a network.
- OS Command Injection: the bug class where user input is interpreted as part of an operating system command.
param: the name of the user-supplied value in this program, taken fromargv.- Proof of concept (PoC): a small, safe demonstration that proves a bug is real.
- Python: the programming language the affected program is written in.
- Redirection: a shell feature that sends a command's output or errors somewhere else, such as
2>/dev/null. - Sanitisation: cleaning or checking input so that dangerous characters cannot do harm.
- Security context: the user account and permissions a program runs under.
- Shell: the program that reads a command line and works out what to run.
shell=False: a Python setting that runs a program directly, without involving a shell.shlex.quote(): a Python function that escapes a value so a shell treats it as one literal token.subprocess: a Python toolkit for starting other programs.subprocess.getstatusoutput(): a Python function that hands a string to a shell and returns the status and output.subprocess.run(): a Python function that starts a program, optionally from a list of arguments, and waits for it.- String: a piece of text in a program.
- Token: a single, indivisible unit of text as the shell sees it.
- Validation: checking that input meets expected rules before using it.
- Allow-list: a list of permitted values; anything not on the list is rejected.