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.
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | linux | 4.18.20-1 | — |
| Debian 13 | linux | 4.18.20-1 | — |
| Debian 12 | linux | 4.18.20-1 | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 18.04 LTS | linux | 4.15.0-42.45 | USN-3836-1 |
| Ubuntu 18.04 LTS | linux-aws | 4.15.0-1029.30 | USN-3833-1 |
| Ubuntu 18.04 LTS | linux-azure | 4.15.0-1035.36 | — |
| Ubuntu 18.04 LTS | linux-gcp | 4.15.0-1025.26 | USN-3836-1 |
| Ubuntu 18.04 LTS | linux-kvm | 4.15.0-1027.27 | USN-3836-1 |
| Ubuntu 18.04 LTS | linux-oem | 4.15.0-1028.33 | — |
| Ubuntu 18.04 LTS | linux-raspi2 | 4.15.0-1029.31 | USN-3836-1 |
| Ubuntu 16.04 LTS | linux-azure | 4.15.0-1035.36~16.04.1 | — |
| Ubuntu 16.04 LTS | linux-gcp | 4.15.0-1025.26~16.04.1 | USN-3836-2 |
| Ubuntu 16.04 LTS | linux-hwe | 4.15.0-42.45~16.04.1 | USN-3836-2 |
| Ubuntu 14.04 LTS | linux-azure | 4.15.0-1035.36~14.04.2 | — |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
Metasploit 1 module
-
Linux Nested User Namespace idmap Limit Local Privilege Escalation
exploit/linux/local/nested_namespace_idmap_limit_priv_esc
Exploit-DB 6
- Linux Kernel 4.15.x < 4.19.2 - 'map_write() CAP_SYS_ADMIN' Local Privilege Escalation (dbus Method) EDB-47165 · local · Jan 4, 2019
- Linux Kernel 4.15.x < 4.19.2 - 'map_write() CAP_SYS_ADMIN' Local Privilege Escalation (polkit Method) EDB-47167 · local · Jan 4, 2019
- Linux - Nested User Namespace idmap Limit Local Privilege Escalation (Metasploit) EDB-45915 · local · Nov 29, 2018 · verified
- Linux Kernel 4.15.x < 4.19.2 - 'map_write() CAP_SYS_ADMIN' Local Privilege Escalation (cron Method) EDB-47164 · local · Nov 21, 2018
- Linux Kernel 4.15.x < 4.19.2 - 'map_write() CAP_SYS_ADMIN' Local Privilege Escalation (ldpreload Method) EDB-47166 · local · Nov 21, 2018
- Linux - Broken uid/gid Mapping for Nested User Namespaces EDB-45886 · local · Nov 16, 2018 · verified
GitHub 2 repositories
-
scheatkode/CVE-2018-18955 ★ 25 · Jan 19, 2022
💀 Linux local root exploit for CVE-2018-18955
-
WhatsWrongAndWhy/CVE-2018-18955 ★ 0 · Jul 21, 2026
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Advisories 3
- USN-3836-1 linux, linux-gcp, linux-kvm, linux-raspi2 vulnerabilities Ubuntu Security Notices (USN) · Apr 22, 2026
- USN-3833-1 linux-aws vulnerabilities Ubuntu Security Notices (USN) · Feb 10, 2026
- USN-3836-2 linux-hwe, linux-gcp vulnerabilities Ubuntu Security Notices (USN) · Feb 10, 2026
References
- https://github.com/torvalds/linux/commit/d2f007dbe7e4c9583eea6eb04d60001e85c6f1bd
- https://cdn.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.18.19
- USN-3836-2 vendor-advisory
- USN-3835-1 vendor-advisory
- 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
- USN-3833-1 vendor-advisory
- USN-3832-1 vendor-advisory
- 45915 exploit
- https://cdn.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.19.2
- 45886 exploit
- USN-3836-1 vendor-advisory
- 105941 vdb-entry
- https://support.f5.com/csp/article/K39103040
- https://security.netapp.com/advisory/ntap-20190416-0003/