Skip to content
RCE Write-up Advanced

Re: CVE-2014-6271 – remote code execution through bash

The bash shell's handling of environment variables that look like function definitions was flawed, allowing an attacker to execute commands. A patch was proposed and confirmed to work, but the text does not detail the original vulnerability beyond the incomplete fix.

seclists.org

Published on seclists.org

Chet -- The lyf so short, the craft so long to lerne.'' - Chaucer Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU chet () case edu http://cnswww.cns.cwru.edu/~chet/

The author, on seclists.org

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.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the function-definition parser in bash did not properly validate or reset state when parsing environment variables, allowing crafted input to execute commands.

Impact

An attacker could execute arbitrary commands through bash, though the text only confirms a patch works and does not describe real-world exploitation.

What the attacker needed

Crafted environment variable; bash processes it

The fix

The text provides patches for multiple bash versions and states they work, but does not say they were officially released.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Bash is a common command-line shell. It reads special variables from the environment, and if one looks like a function definition, it parses it. The parsing was unsafe, so crafted input could run commands. This text is a follow-up about fixing that flaw.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.