CVE-2026-42069: shell2shell — Unauthenticated Remote Command Execution via Interactive Input Reflection (RCE-INCEPTION)
| Field | Value |
|---|---|
| Advisory ID | SHL-SEC-2026-0001 |
| CVE Identifier | CVE-2026-42069 (Pending assignment by the Department of Redundancy Department) |
| CVSS v3.1 Score | 10.0 (Critical) — CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H (assuming the user left port 22 or a web terminal open to 0.0.0.0 with no password) |
| Affected Software | bash (all versions since 1989), zsh, fish, sh, dash, ksh, PowerShell, and any terminal emulator capable of rendering ASCII |
| Patched Versions | None. The maintainers noted that "executing commands you type into a command prompt is considered intended functionality." |
| CWE | CWE-13337: Failure to Realise You Are Already Inside the Box |
Executive Summary
Following a flurry of breathless security advisories naming every runtime, web server, and beverage on Earth <thing>2shell, researchers at the Institute for Questionable Cybernetics have uncovered what is widely regarded as the most devastating vulnerability in computing history: shell2shell.
When an attacker connects to a shell and provides shell commands over stdin, the shell interprets and executes those commands as operating system instructions, effectively turning a shell session into a shell session. Worse still, if the resulting command spawns another shell, an attacker can achieve nested shell execution—a phenomenon affectionately termed Shellception by incident responders who forgot to check $SHLVL.
Initial Triage Note from On-Call SREs: "We saw sh -c 'sh -c id' in the audit logs and immediately paged everyone. Turns out someone was just running a one-liner in CI. We still rotated all 412 Kubernetes secrets just to be safe."Technical Analysis
Root Cause
Modern POSIX and non-POSIX shells suffer from a systemic architectural flaw: they read characters from a file descriptor (typically 0, also known as stdin), parse tokens such as spaces, pipes, and semicolons, and pass the resulting argv array to execve() or built-in handlers.
There is currently no configuration flag (set -o no_do_what_i_say remains rejected upstream) that prevents a shell from acting upon explicit instructions supplied to its input stream.
Attack Vectors
- The Classic "Just Type It" Vector (
AV:N/AC:L) An unauthenticated remote actor connects to an exposed interactive shell or command execution endpoint and transmits arbitrary strings such asrm -rf /tmp/testorcat /etc/passwd. Because the shell lacks mind-reading capabilities to distinguish "malicious intent" from "an administrator doing their job," it complies immediately. - Subshell Escalation (
SHLVL++) By wrapping commands in$(...),..., or( ... ), an attacker causes the primary shell to fork a child shell to evaluate expressions. Every time$SHLVLincrements, security teams reportedly feel a slight rise in blood pressure. - Environment Variable Poisoning via
exportAn attacker can setexport PATH="/tmp/evil:$PATH"inside their own shell session, causing subsequent commands typed into that exact same shell session to resolve binaries from/tmp/evilfirst. Truly chilling stuff. - Alias & Function Hijacking By defining
alias ls='sudo reboot'or overridingcd(), an attacker can subvert muscle memory—often their own—within the active session.
Proof of Concept (PoC)
Below is a minimal, reproducible Proof of Concept demonstrating shell2shell against a standard Bourne-compatible shell.
Prerequisites
- A keyboard (physical or virtual)
- A terminal window or network socket attached to a shell
- Mild existential dread
Exploitation Steps
# Step 1: Establish a "remote" session (or just open a terminal tab)
ssh localhost
# Step 2: Deliver the primary shell2shell payload over stdin
echo 'echo "PWNED: shell executed inside a shell (SHLVL=$SHLVL)"' | sh
# Step 3: Demonstrate nested shell2shell recursion
sh -c 'sh -c "sh -c \"whoami && uname -sr\""'
Observed Output
PWNED: shell executed inside a shell (SHLVL=2)
root
Linux 6.12.0-generic
Look at that output: an arbitrary command (whoami && uname -sr) was supplied to a shell, and the shell ran it. Nobody saw this coming.
Impact Assessment
- Confidentiality: Complete, assuming the shell process has read permissions on the files you ask it to read.
- Integrity: Complete, if you tell it to modify files you own or have
sudoaccess for. - Availability: Catastrophic, particularly if someone types
:(){ :|:& };:because they wanted to see what a fork bomb looks like on a production jump host.
Remediation & Workarounds
Until a patch is released that makes shells politely decline instructions, defenders should consider the following mitigations:
- Do not expose interactive shells to the public internet without authentication, MFA, or VPNs. (Shockingly effective against
shell2shell.) - Audit
$SHLVLandps auxoutput. If you seebashrunning insidebash, take a deep breath—it's probably just a subshell, not a nation-state APT. - Apply the Principle of Least Privilege. Running a shell as
rootwhen you only neednobodysignificantly increases the blast radius of typingrmwith a stray space. - Rename all your tools to end in
2shell. If you callcurlweb2shellandjqjson2shell, executives will immediately approve Q4 budget for "Next-Gen Shell Telemetry."
Vendor Response
"We have reviewedCVE-2026-42069and confirmed that typing commands into a command shell indeed causes the shell to execute those commands. We recommend not typing commands you do not want executed. Closing asWONTFIX/WORKING_AS_INTENDED." — Anonymous Shell Maintainer, circa every decade
If you haven’t clocked it by now, CVE-2026-42069 is a complete wind-up. In a world where you can barely finish your morning brew without another sky-is-falling <insert-service-here>2shell vulnerability landing in your feed, complete with its own website and logo. I figured it was only fair we finally gave "typing commands into a terminal and having them run" the 10.0 CVSS score it truly deserves.