# CVE-2016-9401: GNU Bash use-after-free in popd builtin

Source: https://junglewise.ai/threats/cve-2016-9401-gnu-bash-use-after-free-in-popd-builtin  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2017-01-23. Updated: 2026-05-13  
License: CC BY 4.0 with a link back

CVE-2016-9401 · Severity: medium · CVSS 5.5 · Published 2017-01-23

A vulnerability in the Bash command-line interpreter could allow a local user to crash the shell or potentially bypass security restrictions. By providing a specially crafted input to the 'popd' command, an attacker can cause the system to mishandle memory. This primarily impacts the availability of the shell session and could be used to escape restricted shell environments.

Technologies: [Debian Linux](https://junglewise.ai/threats/technologies/debian), [Gnu Bash](https://junglewise.ai/threats/technologies/bash). Vendors: [Debian](https://junglewise.ai/threats/vendors/debian), [Gnu](https://junglewise.ai/threats/vendors/gnu).

## Quick answers

**Is CVE-2016-9401 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2016-9401 being exploited in the wild.

**How severe is CVE-2016-9401?** Medium severity, with a CVSS score of 5.5, published 23 January 2017.

**Which products and versions are affected?** Debian Linux 8.0; Gnu Bash up to 4.4-patch5.

**Is there a fix for CVE-2016-9401?** A patch was published on 2017-03-21: Red Hat released security updates (RHSA-2017:0725) Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2016-9401 attacked?** It is attacked with local access, in an operating system.

**Am I affected by CVE-2016-9401?** Check whether you run Debian Linux or Gnu Bash at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

A use-after-free vulnerability exists in the 'popd' builtin command of GNU Bash. The issue is located in the 'popd_builtin' function within 'pushd.def', where the shell fails to properly validate the index provided in a 'popd' command (e.g., 'popd +-111111'). This allows a local attacker to trigger a free() on an arbitrary or invalid memory address. Exploitation can lead to a denial of service (segmentation fault) or a bypass of restricted shell (rbash) configurations. The vulnerability is addressed in Bash 4.4 and various vendor backports.

## Affected products

- GNU Bash up to 4.4-patch5
- Red Hat Enterprise Linux 6, 7
- Debian Debian Linux 8.0

## Timeline

- 2016-11-17: disclosed: Public disclosure on oss-security mailing list
- 2016-11-17: advisory: CVE-2016-9401 assigned by MITRE
- 2017-01-23: advisory: NVD publication date
- 2017-03-21: patched: Red Hat released security updates (RHSA-2017:0725)

## References

- [http://rhn.redhat.com/errata/RHSA-2017-0725.html](http://rhn.redhat.com/errata/RHSA-2017-0725.html)
- [http://www.openwall.com/lists/oss-security/2016/11/17/5](http://www.openwall.com/lists/oss-security/2016/11/17/5)
- [http://www.openwall.com/lists/oss-security/2016/11/17/9](http://www.openwall.com/lists/oss-security/2016/11/17/9)
- [http://www.securityfocus.com/bid/94398](http://www.securityfocus.com/bid/94398)
- [https://access.redhat.com/errata/RHSA-2017:1931](https://access.redhat.com/errata/RHSA-2017:1931)
- [https://lists.debian.org/debian-lts-announce/2019/03/msg00028.html](https://lists.debian.org/debian-lts-announce/2019/03/msg00028.html)
- [https://security.gentoo.org/glsa/201701-02](https://security.gentoo.org/glsa/201701-02)

## Related threats

- [libpng use-after-free in chunk setter functions](https://junglewise.ai/threats/cve-2026-34757-libpng-use-after-free-in-chunk-setter-functions)
- [firewalld incorrect authorization in D-Bus setters](https://junglewise.ai/threats/cve-2026-4948-firewalld-incorrect-authorization-in-d-bus-setters)
- [libtiff signed integer overflow in putcontig8bitYCbCr44tile](https://junglewise.ai/threats/cve-2026-4775-libtiff-signed-integer-overflow-in-putcontig8bitycbcr44tile)
- [An incomplete fix for allows an out-of-bounds read in gst_wavparse_adtl_chunk() function. The patch added a size validation c](https://junglewise.ai/threats/cve-2026-1940-an-incomplete-fix-for-allows-an-out-of-bounds-read-in-gst-wavparse)
- [OpenSSH GSSAPI uninitialized variable use in Linux distributions](https://junglewise.ai/threats/cve-2026-3497-openssh-gssapi-uninitialized-variable-use-in-linux-distributions)
