CVE-2018-18955: Privilege Escalation via User Namespace Mapping in Linux Kernel (CVE-2018-18955)
- Vendors
- LinuxCanonical
CVE-2018-18955 is a privilege escalation vulnerability in the Linux kernel (versions 4.15.x through 4.19.x before 4.19.2) affecting the user namespace implementation. The flaw resides in the map_write() function in kernel/user_namespace.c, where improper handling of nested user namespaces with more than five UID or GID mapping extents leads to incorrect reverse ID transformation. This allows a user with CAP_SYS_ADMIN in a nested user namespace to bypass discretionary access controls (DAC) and gain unauthorized access to files outside the namespace, such as /etc/shadow. The vulnerability is triggered when more than five mapping extents are specified, causing access control checks (e.g., inode_owner_or_capable(), privileged_wrt_inode_uidgid()) to be bypassed due to invalid reverse mapping logic. The issue was introduced in commit 6397fac4915a and discovered by Jann Horn.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
A local attacker with CAP_SYS_ADMIN in a nested user namespace can exploit this vulnerability to bypass access controls and gain unauthorized access to sensitive files or resources outside the namespace, potentially leading to privilege escalation or container escape. The impact is high on confidentiality, integrity, and availability, as it allows reading of protected files (e.g., /etc/shadow) and potentially further system compromise.
Mitigation
If you can’t patch tonight, do this now.
If immediate patching is not possible, restrict the use of user namespaces or limit the ability for untrusted users to create nested user namespaces with multiple mapping extents. Consider disabling unprivileged user namespace creation (e.g., via sysctl kernel.unprivileged_userns_clone=0) as a temporary mitigation, though this may impact containerized workloads.
Remediation
Patch, then assume compromise.
Upgrade the Linux kernel to version 4.19.2 or later, or apply the relevant distribution-provided patches. For Ubuntu, ensure kernel packages are updated to at least 4.15.0-42.45 (Bionic), 4.18.0-12.13 (Cosmic), or 4.19.0-12.13 (Disco). The fix (commit d2f007dbe7e4c9583eea6eb04d60001e85c6f1bd) ensures both forward and reverse mappings are properly updated and sorted in user namespaces.
Exploits
2 exploits validated by Mallory's analysis. Hidden: 2 rejected by Mallory's analysis as not a working exploit; 5 not yet analyzed, such as Exploit-DB entries.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
References
Frequently asked questions
- Is CVE-2018-18955 exploited in the wild?
- As of Oct 16, 2026, Mallory has no reports of CVE-2018-18955 being exploited in the wild. It is not listed in CISA KEV.
- Is there a public exploit for CVE-2018-18955?
- Yes. Mallory tracks 2 public exploits or proofs of concept for CVE-2018-18955, the earliest disclosed Nov 15, 2018.
- Is there a patch for CVE-2018-18955?
- Upgrade the Linux kernel to version 4.19.2 or later, or apply the relevant distribution-provided patches. For Ubuntu, ensure kernel packages are updated to at least 4.15.0-42.45 (Bionic), 4.18.0-12.13 (Cosmic), or 4.19.0-12.13 (Disco).
- What products are affected by CVE-2018-18955?
- Linux Kernel and Canonical Ubuntu Linux.
- How severe is CVE-2018-18955?
- CVE-2018-18955 has a CVSS v3 score of 7.0 (High) and an EPSS score of 7.7% (95th percentile) as of Oct 16, 2026.
Recent activity
1 sources tracked across advisories and community write-ups. News coverage will land here when it surfaces.
No news coverage yet. Advisories and community discussion only.