{"id":"CVE-2018-18955","published":"2018-11-16T20:00:00Z","modified":"2024-08-05T11:23:08Z","title":"In the Linux kernel 4.15.x through 4.19.x before 4.19.2, map_write() in kernel/user_namespace.c allows privilege…","vendor":null,"product":null,"tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":null,"epss":{"score":0.07673,"percentile":0.94725,"provenance":"source"},"cwes":[],"references":[{"url":"https://github.com/torvalds/linux/commit/d2f007dbe7e4c9583eea6eb04d60001e85c6f1bd","tags":["x_refsource_MISC"]},{"url":"https://cdn.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.18.19","tags":["x_refsource_MISC"]},{"url":"https://usn.ubuntu.com/3836-2/","tags":["vendor-advisory","x_refsource_UBUNTU"]},{"url":"https://usn.ubuntu.com/3835-1/","tags":["vendor-advisory","x_refsource_UBUNTU"]},{"url":"https://bugs.chromium.org/p/project-zero/issues/detail?id=1712","tags":["x_refsource_MISC"]},{"url":"http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d2f007dbe7e4c9583eea6eb04d60001e85c6f1bd","tags":["x_refsource_MISC"]},{"url":"https://usn.ubuntu.com/3833-1/","tags":["vendor-advisory","x_refsource_UBUNTU"]},{"url":"https://usn.ubuntu.com/3832-1/","tags":["vendor-advisory","x_refsource_UBUNTU"]},{"url":"https://www.exploit-db.com/exploits/45915/","tags":["exploit","x_refsource_EXPLOIT-DB"]},{"url":"https://cdn.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.19.2","tags":["x_refsource_MISC"]},{"url":"https://www.exploit-db.com/exploits/45886/","tags":["exploit","x_refsource_EXPLOIT-DB"]},{"url":"https://usn.ubuntu.com/3836-1/","tags":["vendor-advisory","x_refsource_UBUNTU"]},{"url":"http://www.securityfocus.com/bid/105941","tags":["vdb-entry","x_refsource_BID"]},{"url":"https://support.f5.com/csp/article/K39103040","tags":["x_refsource_CONFIRM"]},{"url":"https://security.netapp.com/advisory/ntap-20190416-0003/","tags":["x_refsource_CONFIRM"]}],"priority":{"score":23.9,"factors":[{"name":"EPSS percentile","points":18.95},{"name":"Public exploit code","points":5.0}]},"exploitSources":{"exploitdb":{"count":7,"earliest":"2018-11-16"},"pocGithub":{"count":2,"skipped":1,"earliest":"2022-01-19","earliestUrl":"https://github.com/scheatkode/CVE-2018-18955","repos":[{"name":"scheatkode/CVE-2018-18955","url":"https://github.com/scheatkode/CVE-2018-18955","stars":25,"created":"2022-01-19"},{"name":"Moonw4re/Linux-Privilege-Escalation","url":"https://github.com/Moonw4re/Linux-Privilege-Escalation","stars":1,"created":"2026-11-18"}]},"metasploit":[{"name":"Linux Nested User Namespace idmap Limit Local Privilege Escalation","module":"exploit/linux/local/nested_namespace_idmap_limit_priv_esc","type":"exploit","disclosureDate":"2018-11-15","url":"https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/linux/local/nested_namespace_idmap_limit_priv_esc.rb"}],"first":{"date":"2018-11-15","source":"Metasploit","url":"https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/linux/local/nested_namespace_idmap_limit_priv_esc.rb"},"provenance":"source"},"summary":{"text":"The flaw is in map_write() in kernel/user_namespace.c of the Linux kernel, affecting versions 4.15.x through 4.19.x before 4.19.2, where nested user namespaces with more than five UID or GID ranges are mishandled. An attacker holding CAP_SYS_ADMIN inside an affected user namespace can escalate privileges and bypass access controls on resources outside that namespace, such as reading /etc/shadow, because the ID transformation is applied in the namespaced-to-kernel direction but not the kernel-to-namespaced direction.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T06:58:54Z"},"euvd":{"id":"EUVD-2018-10659","exploited":false,"provenance":"source"},"exploits":[{"id":45886,"url":"https://www.exploit-db.com/exploits/45886","title":"Linux - Broken uid/gid Mapping for Nested User Namespaces","date":"2018-11-16","verified":true,"provenance":"source"},{"id":45915,"url":"https://www.exploit-db.com/exploits/45915","title":"Linux - Nested User Namespace idmap Limit Local Privilege Escalation (Metasploit)","date":"2018-11-29","verified":true,"provenance":"source"},{"id":45915,"url":"https://www.exploit-db.com/exploits/45915","title":"Linux - Nested User Namespace idmap Limit Local Privilege Escalation (Metasploit)","date":"2018-11-29","verified":true,"provenance":"source"},{"id":47164,"url":"https://www.exploit-db.com/exploits/47164","title":"Linux Kernel 4.15.x < 4.19.2 - 'map_write() CAP_SYS_ADMIN' Local Privilege Escalation (cron Method)","date":"2018-11-21","verified":false,"provenance":"source"},{"id":47165,"url":"https://www.exploit-db.com/exploits/47165","title":"Linux Kernel 4.15.x < 4.19.2 - 'map_write() CAP_SYS_ADMIN' Local Privilege Escalation (dbus Method)","date":"2019-01-04","verified":false,"provenance":"source"},{"id":47166,"url":"https://www.exploit-db.com/exploits/47166","title":"Linux Kernel 4.15.x < 4.19.2 - 'map_write() CAP_SYS_ADMIN' Local Privilege Escalation (ldpreload Method)","date":"2018-11-21","verified":false,"provenance":"source"},{"id":47167,"url":"https://www.exploit-db.com/exploits/47167","title":"Linux Kernel 4.15.x < 4.19.2 - 'map_write() CAP_SYS_ADMIN' Local Privilege Escalation (polkit Method)","date":"2019-01-04","verified":false,"provenance":"source"}],"exploitRefs":["https://www.exploit-db.com/exploits/45915/","https://www.exploit-db.com/exploits/45886/"],"lineage":{"familyId":"fam-cve-2013-1959-family-cve-2013-1959","parents":[{"from":"CVE-2013-1959","to":"CVE-2018-18955","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["kernel/user_namespace.c"],"commits":["https://github.com/torvalds/linux/commit/e3211c120a85b792978bcb4be7b2886df18d27f0","https://github.com/torvalds/linux/commit/6708075f104c3c9b04b23336bb0366ca30c3931b","https://github.com/torvalds/linux/commit/d2f007dbe7e4c9583eea6eb04d60001e85c6f1bd"],"basis":"shared function","functions":["file"]}]}]}}