IssueDescription:
It was discovered that the fixed-sized redirstack could be forced to overflow in the Bash parser, resulting in memory corruption, and possibly leading to arbitrary code execution when evaluating untrusted input that would not otherwise be run as code.
GNU Bash through 4.3 bash43-026 does not properly parse function definitions in the values of environment variables, which allows remote attackers to execute arbitrary code or cause a denial of service (uninitialized memory access, and untrusted-pointer read and write operations) via a crafted environment, as demonstrated by vectors involving the ForceCommand feature in OpenSSH sshd, the modcgi and modcgid modules in the Apache HTTP Server, scripts executed by unspecified DHCP clients, and other situations in which setting the environment occurs across a privilege boundary from Bash execution. NOTE: this vulnerability exists because of an incomplete fix for CVE-2014-6271 and CVE-2014-7169.
IssueDescription:
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.
A flaw was found in the bash functionality that evaluates specially formatted environment variables passed to it from another environment. An attacker could use this feature to override or bypass restrictions to the environment to execute shell commands before restrictions have been applied. Certain services and applications allow remote unauthenticated attackers to provide environment variables, allowing them to exploit this issue.
Acknowledgements:
Red Hat would like to thank Stephane Chazelas for reporting this issue.
GNU Bash through 4.3 bash43-025 processes trailing strings after certain malformed function definitions in the values of environment variables, which allows remote attackers to write to files or possibly have unknown other impact via a crafted environment, as demonstrated by vectors involving the ForceCommand feature in OpenSSH sshd, the modcgi and modcgid modules in the Apache HTTP Server, scripts executed by unspecified DHCP clients, and other situations in which setting the environment occurs across a privilege boundary from Bash execution. NOTE: this vulnerability exists because of an incomplete fix for CVE-2014-6271.
A security flaw was found in bash, which could be exploited remotely via applications which parse untrusted user scripts via bash. This flaw is different from CVE-2014-6277, CVE-2014-7169 and CVE-2014-7186.
Bash before 4.4 allows local users to execute arbitrary commands with root privileges via crafted SHELLOPTS and PS4 environment variables.
An issue was discovered in disableprivmode in shell.c in GNU Bash through 5.0 patch 11. By default, if Bash is run with its effective UID not equal to its real UID, it will drop privileges by setting its effective UID to its real UID. However, it does so incorrectly. On Linux and other systems that support "saved UID" functionality, the saved UID is not dropped. An attacker with command execution in the shell can use "enable -f" for runtime loading of a new builtin, which can be a shared object that calls setuid() and therefore regains privileges. However, binaries running with an effective UID of 0 are unaffected.
Bash could allow a remote authenticated attacker to execute arbitrary commands on the system, caused by the failure to prevent the shell user from modifying BASHCMDS in the rbash. By modifying BASHCMDS, an attacker could exploit this vulnerability to execute arbitrary commands on the system with the permissions of the shell.
A heap-based buffer overflow exists in GNU Bash before 4.3 when wide characters, not supported by the current locale set in the LCCTYPE environment variable, are printed through the echo built-in function. A local attacker, who can provide data to print through the "echo -e" built-in function, may use this flaw to crash a script or execute code with the privileges of the bash process. This occurs because ansicstr() in lib/sh/strtrans.c mishandles u32cconv().
The path autocompletion feature in Bash 4.4 allows local users to gain privileges via a crafted filename starting with a " (double quote) character and a command substitution metacharacter.
A flaw was found in the bash package, where a heap-buffer overflow can occur in valid parametertransform. This issue may lead to memory problems.
A vulnerability was found in a way bash expands the $HOSTNAME. Injecting the hostname with malicious code would cause it to run each time bash expanded \h in the prompt string.
References:
http://seclists.org/oss-sec/2016/q3/528
Ubuntu bug:
https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1507025
A vulnerability was found in popd. It can be tricked to free a user supplied address in the following way:
$ popd +-111111
This could be used to bypass restricted shells (rsh) on some environments to cause use-after-free.
References:
http://seclists.org/oss-sec/2016/q4/445
(1) bash before 1.14.7, and (2) tcsh 6.05 allow local users to gain privileges via directory names that contain shell metacharacters ( back-tick), which can cause the commands enclosed in the directory name to be executed when the shell expands filenames using the \w option in the PS1 variable.
The prompt parsing in bash allows a local user to execute commands as another user by creating a directory with the name of the command to execute.
Stack-based buffer overflow in lib/sh/eaccess.c in GNU Bash before 4.2 patch 33 might allow local users to bypass intended restricted shell access via a long filename in /dev/fd, which is not properly handled when expanding the /dev/fd prefix.
IssueDescription:
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.
IssueDescription:
It was discovered that the fixed-sized redirstack could be forced to overflow in the Bash parser, resulting in memory corruption, and possibly leading to arbitrary code execution when evaluating untrusted input that would not otherwise be run as code.
rbash in Bash before 4.4-beta2 did not prevent the shell user from modifying BASHCMDS, thus allowing the user to execute any command with the permissions of the shell.
Reference: https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1803441
Upstream commit: http://git.savannah.gnu.org/cgit/bash.git/commit/CHANGES?h=bash-4.4-testing&id=955543877583837c85470f7fb8a97b7aa8d45e6c
A vulnerability was found in a way bash expands the $HOSTNAME. Injecting the hostname with malicious code would cause it to run each time bash expanded \h in the prompt string.
References:
http://seclists.org/oss-sec/2016/q3/528
Ubuntu bug:
https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1507025
The /etc/profile.d/60alias.sh script in the Mandriva bash package for Bash 2.05b, 3.0, 3.2, 3.2.48, and 4.0 enables the --show-control-chars option in LSOPTIONS, which allows local users to send escape sequences to terminal emulators, or hide the existence of a file, via a crafted filename.
An issue was discovered in disableprivmode in shell.c in GNU Bash through 5.0 patch 11. By default, if Bash is run with its effective UID not equal to its real UID, it will drop privileges by setting its effective UID to its real UID. However, it does so incorrectly. On Linux and other systems that support "saved UID" functionality, the saved UID is not dropped. An attacker with command execution in the shell can use "enable -f" for runtime loading of a new builtin, which can be a shared object that calls setuid() and therefore regains privileges. However, binaries running with an effective UID of 0 are unaffected.
Reference and upstream commit: https://git.savannah.gnu.org/cgit/bash.git/commit/?h=devel&id=951bdaad7a18cc0dc1036bba86b18b90874d39ff
On Sep 30, 2025, at 2:18 AM, Solar Designer <solar () openwall com> wrote: ...
On Tue, Sep 30, 2025 at 01:02:01AM -0500, Jacob Bachmeyer wrote: Small nit here: Shellshock was clearly a vulnerability in Bash and I am unsure if the way Bash exports shell functions was documented at all. ... If presented with an environment variable value having the correct form for a shell function, but containing more text than the body of the function, Bash would immediately execute the trailing text as commands while importing the shell function from the environment. That was Shellshock. Yes, there were multiple Shellshock-related code issues in bash, and several CVEs were rightly assigned against bash. No arguing about that. Also, the proper Shellshock was exposed as a vulnerability by far not only through HTTP servers, since it parsed variables of any names. All true. Shellshock's story is complicated in part because early "fixes" didn't fix it. Its revelation was over 10 years ago, so some readers here may not be familiar with Shellshock. I wrote a detailed article about Shellshock here, including ways detect or prevent similar vulnerabilities:
https://dwheeler.com/essays/shellshock.html
--- David A. Wheeler
Summary: Restricted Bash (rbash) blocks output redirection to prevent file modification. However, history-writing built-ins (history -w, history -a) can overwrite startup files such as .profile if the restricted user is left in $HOME. This allows PATH resets and escape from confinement.
Steps to reproduce: 1. Start rbash in $HOME with writable .profile. 2. Run: history -w .profile 3. On next login, .profile is sourced, PATH is reset, confinement is broken.
Discussion: The Bash manual notes administrators must configure restricted environments carefully (unwritable $HOME, different working directory, restricted PATH). However, this particular escape vector is not documented in common guides (e.g., https://0xffsec.com/handbook/shells/restricted-shells/).
Recommendation: While consistent with current design, administrators should be aware that history-writing built-ins can modify files in the current directory. Restricted environments should ensure $HOME is unwritable or place users in a safe subdirectory.
References: GNU Bash manual: https://www.gnu.org/software/bash/manual/htmlnode/The-Restricted-Shell.html
-- RelunSec
Subject: [oss-security] Follow-up: rbash escape via history built-ins
In my earlier message I described how history -w can overwrite startup files in $HOME, breaking confinement in restricted bash.
To add one clarification: even if administrators place users in an unwritable subdirectory (e.g., $HOME/restricted), symlinks from that directory back into writable $HOME files (such as .profile) can re-expose the same vulnerability. This means that simply making the working directory unwritable is insufficient if symlinks escape into writable locations.
Recommendation: Restricted environments should ensure $HOME itself is unwritable, or that the non-writable directory lacks symlinks into writable paths. This complements the earlier advice about history-writing built-ins.
-- RelunSec
On Tue, Jan 27, 2026 at 3:33 PM cyber security <cs7778503 () gmail com> wrote: Summary: Restricted Bash (rbash) blocks output redirection to prevent file modification. However, history-writing built-ins (history -w, history -a) can overwrite startup files such as .profile if the restricted user is left in $HOME. This allows PATH resets and escape from confinement.
Steps to reproduce: 1. Start rbash in $HOME with writable .profile. 2. Run: history -w .profile 3. On next login, .profile is sourced, PATH is reset, confinement is broken.
Discussion: The Bash manual notes administrators must configure restricted environments carefully (unwritable $HOME, different working directory, restricted PATH). However, this particular escape vector is not documented in common guides (e.g., https://0xffsec.com/handbook/shells/restricted-shells/).
Recommendation: While consistent with current design, administrators should be aware that history-writing built-ins can modify files in the current directory. Restricted environments should ensure $HOME is unwritable or place users in a safe subdirectory.
References: GNU Bash manual: https://www.gnu.org/software/bash/manual/htmlnode/The-Restricted-Shell.html
-- RelunSec
https://github.com/bminor/bash/security/advisories/GHSA-1989-sh3ll-bash
https://bash2shell.io/
CVE-2026-17445
All GNU Bash versions back to 1.04 allow anyone with terminal or stdin access to spawn an interactive shell.
Impact: Successful exploitation enables an attacker to execute arbitrary commands, traverse directories, and launch subprocesses with the privileges of the current user.
Mitigation: No patches are planned
Affected systems can be remediated by setting all user shells to /sbin/nologin.
// This is satire. Now let's get back to real \2shells
A security flaw was found in bash, which could be exploited remotely via applications which parse untrusted user scripts via bash. This flaw is different from CVE-2014-6277, CVE-2014-7169 and CVE-2014-7186.