Skip to content
Memory corruption Write-up Advanced

CVE-2014-7187 (yet another) Bash arbitrary execution of code

An off-by-one error in Bash's handling of deeply nested flow control constructs could, depending on memory layout, allow execution of arbitrary code that would not otherwise run. Red Hat assessed that this bug has no security impact on its shipped bash packages.

access.redhat.com

Published on access.redhat.com

An off-by-one error was discovered in the way Bash was handling deeply nested flow control constructs. Depending on the layout of the .bss segment, this could allow arbitrary execution of code that would not otherwise be executed by Bash.

The author, on access.redhat.com

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 an off-by-one error in the code that tracks deeply nested flow control constructs, causing a write past the intended boundary.

Impact

Red Hat does not consider this bug to have any security impact on its bash packages, though it could potentially allow arbitrary code execution depending on memory layout.

What the attacker needed

Deeply nested flow control constructs; specific memory layout

The fix

A fix was applied as a hardening update in RHSA-2014:1306, RHSA-2014:1311, and RHSA-2014:1312.

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.

An off-by-one error means a program miscounts by one, for example writing one item past the end of a list. In Bash, a command shell, deeply nested loops or conditionals could trigger this miscount and corrupt memory. Depending on how memory is arranged, this might let an attacker run code that was not meant to run, though Red Hat judged the risk to its own packages to be negligible.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.