Skip to main content
Mallory
HighExploited in the wildCISA KEVPublic exploitVulnerability

CVE-2023-0386: Linux Kernel OverlayFS Copy-Up Local Privilege Escalation

Published Mar 22, 2023 · Updated 1 month ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 daysNo mention activity in the last 30 days.
CVSS7.8High · v3.1
EPSS3.3%89th percentile
CISA KEVYesAdded Jun 17, 2025
In the wildActivePer CISA KEV
Vendors
Debian ProjectNetAppLinuxCanonical
IdentifiersCVE-2023-0386CWE-282 · Improper Ownership Management

CVE-2023-0386 is a local privilege-escalation vulnerability in the Linux kernel OverlayFS subsystem. The ovl_copy_up_one() function fails to verify that a lower-layer file's UID and GID are mapped in the current user namespace before copying the file into the upper layer. An unprivileged user can exploit this behavior using a FUSE filesystem that presents a root-owned setuid/setgid executable. Copy-up can preserve privileged ownership and mode bits when transferring the file from a nosuid filesystem to another mount, allowing subsequent execution with root privileges.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

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 low-privileged local user can escalate to root, compromising the confidentiality, integrity, and availability of the affected system. Successful exploitation bypasses the privilege restrictions expected from user-namespace identity mappings and the source filesystem's nosuid mount option. The vulnerability has been exploited in the wild.

Mitigation

If you can’t patch tonight, do this now.

Until patching is possible, restrict unprivileged local access. Where operationally feasible, disable or restrict unprivileged user namespaces, unprivileged OverlayFS mounts, or unprivileged FUSE mounting to interrupt the documented exploitation prerequisites. Monitor unexpected creation and execution of root-owned setuid/setgid files. These measures are temporary defenses, not substitutes for the kernel fix.

Remediation

Patch, then assume compromise.

Install the distribution-provided kernel security update addressing CVE-2023-0386. The upstream fix, commit 4f11ada10d0a, adds kuid_has_mapping() and kgid_has_mapping() checks before OverlayFS copy-up proceeds. Fixed packages include Fedora kernel 6.1.9, RHEL 8.6 kernel 4.18.0-372.51.1.el8_6, and RHEL 8 kernel 4.18.0-425.19.2.el8_7 for their respective update streams. Reboot into the fixed kernel, or apply a vendor-supported live patch explicitly covering this vulnerability and verify that it is active. Distribution backports mean the upstream version number alone is insufficient to determine vulnerability status.

Public exploits

Exploits

12 exploits validated by Mallory's analysis. Hidden: 4 rejected by Mallory's analysis as not a working exploit; 1 not yet analyzed, such as Exploit-DB entries.

View more in app →
cve_2023_0386_overlayfs_priv_esc.rbThis repository contains a single Metasploit module implementing a local privilege escalation exploit for CVE-2023-0386, a vulnerability in the Linux kernel's OverlayFS subsystem. The exploit targets a flaw in how OverlayFS handles setuid files copied from a nosuid mount, allowing a local user to escalate privileges to root. The module is written in Ruby and leverages Metasploit's local exploit and post-exploitation libraries. It checks for the appropriate kernel version and user namespace configuration, uploads and compiles (or drops a precompiled) exploit binary on the target, and executes a user-supplied payload (defaulting to a Meterpreter reverse shell) as root. The exploit requires a writable directory on the target (default: /tmp) and cleans up after execution. The module is weaponized, allowing for customizable payloads and reliable privilege escalation on vulnerable systems.Disclosed Mar 22, 2023 · Framework: metasploit · ruby · localWeaponizedCVE-2023-0386This repository contains a local privilege escalation exploit for Linux systems, specifically targeting the overlayfs vulnerability CVE-2023-0386. The exploit is implemented in C and consists of several components: - `exp.c`: The main exploit orchestrator. It sets up the required overlayfs directory structure, manipulates user and mount namespaces, and triggers the vulnerability by mounting an overlay filesystem with controlled parameters. It also interacts with /proc/self/setgroups, /proc/self/uid_map, and /proc/self/gid_map to set up the namespace mappings. - `fuse.c`: Implements a FUSE-based filesystem that serves a file with SUID root permissions. This is used as part of the exploit chain to inject a payload (the getshell binary) into the overlayfs mount. - `getshell.c`: A simple payload that sets UID and GID to 0 and spawns a root shell (/bin/bash). - `test/fuse_test.c` and `test/mnt.c`: Test and demonstration code for FUSE and overlayfs mounting, not directly part of the exploit chain but useful for development and validation. - `Makefile` and `README.md`: Build instructions and usage guide. The README describes running the FUSE server in one terminal and the exploit in another, resulting in privilege escalation. The exploit requires local access and the ability to execute binaries and mount FUSE filesystems. If successful, it provides a root shell to the attacker. The code is operational and includes a working payload, but is not part of a larger exploitation framework.xkaneiki · Disclosed May 5, 2023 · c · makefile · localOperationalCVE-2023-0386This repository contains a local privilege escalation exploit for CVE-2023-0386, targeting the Linux kernel's overlay filesystem (overlayfs) in versions 5.11 to 5.19. The exploit is implemented in C (exp.c) and leverages FUSE to create a virtual filesystem exposing a SUID root shell binary (embedded as hello_str). The exploit orchestrates the following steps: (1) mounts a FUSE filesystem with the SUID shell, (2) creates the necessary overlayfs directories (upperdir, workdir, overlaydir), (3) uses unshare to enter new user, mount, and PID namespaces, (4) mounts an overlay filesystem with the FUSE mount as the lowerdir and a writable upperdir, (5) triggers a copy-up of the SUID shell from the FUSE lowerdir to the overlay upperdir by touching the file, and (6) executes the copied SUID shell from the upperdir to obtain a root shell. The exploit demonstrates a practical attack chain for bypassing nosuid restrictions and achieving local root on vulnerable systems. The README.md provides a detailed vulnerability analysis, exploitation steps, and background on overlayfs and namespaces. No network endpoints are involved; all actions are local file and namespace manipulations.chenaotian · Disclosed May 6, 2023 · c · localOperationalCVE-2023-0386This repository contains a local privilege escalation exploit for Linux systems, specifically targeting the overlayfs vulnerability (CVE-2023-0386). The exploit is implemented in C and consists of several components: - `exp.c`: The main exploit orchestrator. It sets up the required overlayfs directories, manipulates user and group namespaces, mounts an overlay filesystem, and triggers the vulnerability. - `fuse.c`: Implements a FUSE filesystem that is used as part of the exploit chain. It provides a file with SUID root permissions and serves the payload. - `getshell.c`: The payload binary, which sets UID and GID to 0 and spawns a root shell (`/bin/bash`). - `test/fuse_test.c` and `test/mnt.c`: Test and utility programs for experimenting with FUSE and overlayfs mounting, not directly part of the exploit chain. - `Makefile` and `README.md`: Build instructions and usage guide. The exploit works by running the FUSE server in one terminal (serving the payload) and then executing the exploit in another terminal. The exploit manipulates overlayfs and user namespaces to create a SUID root binary, which is then executed to obtain a root shell. The attack vector is local, requiring the attacker to execute code on the target system. Several fingerprintable file paths are used for the overlayfs setup and namespace manipulation. The exploit is operational and provides a working root shell payload.sxlmnwb · Disclosed May 16, 2023 · c · makefile · localOperationalCVE-2023-0386This repository is a functional local privilege escalation exploit for CVE-2023-0386, targeting the Linux kernel's OverlayFS implementation. The exploit consists of two main files: 'fuse.c', a C program that implements a custom FUSE filesystem exposing a SUID root binary, and 'exp.sh', a bash script that automates the exploitation process. The attack works by mounting the FUSE filesystem as the lowerdir in an OverlayFS mount, then triggering a copy-up of the SUID binary to the upperdir, which is not mounted with 'nosuid'. This results in a SUID root binary being created in a location where it can be executed for privilege escalation. The README.md provides a detailed technical explanation of the vulnerability, the exploitation steps, and the underlying Linux kernel features involved (OverlayFS, FUSE, user namespaces). The exploit requires local access to the target system and the ability to execute code and mount filesystems. No network endpoints are involved; all actions are performed locally using file system operations.Fanxiaoyao66 · Disclosed Jun 28, 2023 · c · bash · localOperationalCVE-2023-0386This repository is a local privilege escalation exploit targeting CVE-2023-0386, a vulnerability in the Linux kernel's OverlayFS subsystem. The exploit consists of several C source files: - 'exp.c' orchestrates the exploit, setting up OverlayFS mounts and user namespaces, and triggers the vulnerability. - 'fuse.c' implements a FUSE filesystem used as part of the exploit chain to manipulate file capabilities and permissions. - 'getshell.c' is a simple payload that, when executed with elevated privileges, spawns a root shell. - The 'test' directory contains additional test code for FUSE and mount operations, not directly required for exploitation. The exploit works by abusing OverlayFS and user namespace features to copy a file with capabilities from a nosuid mount, ultimately allowing a local attacker to escalate privileges to root. The Makefile provides build instructions, and the README describes usage, referencing CVE-2023-0386. The main attack vector is local, requiring shell access to the target system. The exploit does not require network access and does not target remote systems. The payload is operational, providing a working root shell if the target is vulnerable.puckiestyle · Disclosed Dec 23, 2023 · c · makefile · localOperationalcve-2023-0386This repository contains a single Python exploit script ('poc.py') that leverages FUSE and OverlayFS to escalate privileges on a Linux system. The script creates a custom FUSE filesystem that serves a setuid-root payload binary ('a.out'). It then uses Linux namespaces and OverlayFS to trick the system into creating a setuid-root binary outside the namespace, which can be executed to obtain a root shell. The exploit is operational and demonstrates a full privilege escalation chain, including payload creation, filesystem manipulation, and cleanup. The main attack vector is local privilege escalation, requiring the attacker to have code execution on the target system with the ability to use FUSE and user namespaces. The repository is self-contained, generating the C payload on the fly and compiling it as part of the exploit process.orilevy8 · Disclosed Mar 17, 2025 · python · c · localOperationalCVE-2023-0386_POCRepository purpose: local privilege escalation PoC for CVE-2023-0386 (Linux kernel OverlayFS capability/uid-mapping bug) using a FUSE-backed lowerdir to smuggle a SUID-root executable into an OverlayFS upperdir, then execute it to obtain a root shell. Structure and roles: - exp.c: Main exploit driver. Creates ./ovlcap/{work,lower,upper,merge}, unshares into new user+mount namespaces, writes /proc/self/{setgroups,uid_map,gid_map} to map the invoking user to uid/gid 0 inside the namespace, mounts an OverlayFS at ./ovlcap/merge with lowerdir=./ovlcap/lower (FUSE mount), upperdir=./ovlcap/upper, workdir=./ovlcap/work. It then creates ./ovlcap/merge/file to trigger copy-up into upperdir. After the child finishes, the parent executes ./ovlcap/upper/file (expected to be a SUID-root binary) via system(). - fuse.c: FUSE filesystem server. Takes two args: [mount path] and [shell path]. It reads the bytes of the provided shell payload (README uses ./gc built from getshell.c) into memory and exposes a single file /file with mode 04777 (SUID root) and uid/gid 0 via getattr. Reads return the payload bytes. This FUSE mount is used as the OverlayFS lowerdir. - getshell.c: Payload binary. Attempts setuid(0)/setgid(0) and launches /bin/bash. When executed with effective uid 0 (via the copied-up SUID bit), it yields a root shell. - test/fuse_test.c and test/mnt.c: Development/testing utilities for FUSE callbacks and overlay mounting; not required for the main PoC flow. - Makefile: Builds three binaries: fuse (static, links libfuse), exp (links libcap though capability APIs are mostly unused), and gc (getshell payload). Exploit flow (as intended by README): 1) Run FUSE server: ./fuse ./ovlcap/lower ./gc (mounts a FUSE FS at ./ovlcap/lower exposing /file as a SUID-root executable containing gc bytes). 2) Run ./exp which mounts OverlayFS using that FUSE mount as lowerdir, triggers copy-up by creating/operating on a file in the merged mount, and finally executes the resulting file from upperdir to pop a root shell. No network activity is present; all actions are local filesystem, namespace, and mount operations.dragosbanica · Disclosed Jan 20, 2026 · c · makefile · localOperationalCVE-2023-0386-go-pocRepository purpose: a Go proof-of-concept exploit for CVE-2023-0386 (Linux OverlayFS/FUSE local privilege escalation). It sets up a FUSE filesystem that exposes a single file named 'shell' whose attributes are manipulated (SUID bit and root ownership) during OverlayFS copy-up, resulting in a SUID-root executable on the host filesystem. Structure: - README.md: usage notes (run ./main /tmp/fuse; compile payload as ./shell; expect SUID binary under /tmp/ovl_merged/). - main.go: core exploit logic. Creates overlay directories, mounts a FUSE filesystem at a user-supplied mountpoint, then re-execs itself inside a new user+mount namespace (CLONE_NEWUSER|CLONE_NEWNS) with uid/gid mapped to 0 in the namespace. In the namespace it mounts OverlayFS with lowerdir pointing to the FUSE mount and merged at /tmp/ovl_merged. It then touches /tmp/ovl_merged/shell to trigger copy-up. - overlay.go: helper functions/constants for directory creation and mounting OverlayFS via the system 'mount' command. Hardcoded paths under /tmp: /tmp/fuse/, /tmp/ovl_upper/, /tmp/ovl_internal_workdir/, /tmp/ovl_merged/. - file.go: reads the payload binary from ./shell, provides touchFile() to trigger copy-up, and executeBinary() (commented out in main) to run /tmp/ovl_merged/shell. - payload/shell.go: payload program that attempts setgid(0)/setuid(0) and then execs /bin/bash, yielding a root shell when executed as a SUID-root binary. Exploit capabilities: - Local LPE: produces a SUID-root executable by abusing OverlayFS copy-up behavior with a FUSE-provided file node. - Post-exploitation: spawns an interactive root bash shell via the payload. No network I/O is present; all observables are local filesystem paths and invoked system commands (mount, touch, exec of /bin/bash).huovnn · Disclosed Feb 7, 2026 · go · markdown · local (Linux privilege escalation via OverlayFS + FUSE, user/mount namespaces)OperationalTwoMillion-Machine-WriteupRepository is a compact local privilege-escalation PoC for CVE-2023-0386 (OverlayFS/FUSE bug on Linux). It contains 6 files total: 3 C source files implementing the exploit chain, a Makefile to build them, a minimal PoC README, and a top-level walkthrough README unrelated to exploit logic. Main components: `fuse.c` starts a FUSE filesystem at an attacker-chosen mountpoint and serves the contents of the compiled helper binary while reporting the file `/file` as owned by uid/gid 0 with mode `04777`; `getshell.c` is that helper payload and simply sets uid/gid to 0 then launches `/bin/bash`; `exp.c` prepares `./ovlcap/{lower,upper,work,merge}`, unshares into new mount/user namespaces, writes `/proc/self/{setgroups,uid_map,gid_map}`, mounts an OverlayFS using the FUSE mount as lowerdir, and creates/accesses `./ovlcap/merge/file` to trigger copy-up into the upper layer. After the child process exits, `exp.c` executes `./ovlcap/upper/file`, which should now be a SUID-root copy of the helper, yielding a root shell. No network communication or remote C2 is present; this is strictly a local kernel LPE exploit. The code is operational rather than weaponized: it includes a hardcoded payload and fixed filesystem paths, with no target discovery or reliability checks beyond basic setup.anxs3c · Disclosed Jun 11, 2026 · c · makefile · local · fileOperationalCVE-2023-0386-OverlayFSThis repository is a compact local privilege-escalation exploit for CVE-2023-0386 affecting Linux OverlayFS when used with a user-controlled FUSE lower filesystem. The repo contains 4 files: a Makefile, README, and two C programs. The exploit is real and operational, not a detector. Structure and purpose: - fuse.c: Implements a malicious FUSE filesystem. It exposes a root directory and a single file /bin. Through getattr, it lies about metadata, marking /bin as a root-owned regular file with mode 04777 (SUID, world-accessible). Through read, it serves an embedded ELF payload. The payload bytes correspond to a small executable that performs privilege-related syscalls and then executes a shell. The FUSE handlers implemented are getattr, readdir, ioctl, open, and read; the README notes ioctl is required for reliability. - exp.c: Performs the exploitation steps. It creates the workspace under /tmp/fusepwn, unshares into a new mount and user namespace, writes /proc/self/setgroups, /proc/self/gid_map, and /proc/self/uid_map so the process appears as root inside the namespace, mounts OverlayFS with lowerdir=/tmp/fusepwn/lower, upperdir=/tmp/fusepwn/upper, workdir=/tmp/fusepwn/work onto /tmp/fusepwn/merge, and then opens /tmp/fusepwn/merge/bin to trigger OverlayFS copy-up. Because the vulnerable kernel trusts the lower filesystem metadata, the copied-up file lands on disk in the upperdir as a real root-owned SUID executable. The program then executes /tmp/fusepwn/upper/bin to obtain a root shell. - Makefile: Builds fuse statically with libfuse and exp with libcap; cleanup unmounts /tmp/fusepwn/lower and removes /tmp/fusepwn. - README.md: Documents usage, explains the vulnerability mechanics, and links to the upstream patch and references. Main exploit capability: local root privilege escalation. There are no network callbacks, C2 endpoints, or remote targets. All observables are local filesystem paths and procfs namespace-mapping files. The exploit depends on a vulnerable Linux kernel configuration permitting the namespace/FUSE/OverlayFS interaction described above.pwncone · Disclosed Jun 28, 2026 · c · makefile · local · fileOperationalCVE-2023-0386This repository contains a proof-of-concept (POC) local privilege escalation exploit for CVE-2023-0386, targeting the Linux kernel's OverlayFS and FUSE subsystems. The main file, 'CVE-2023-0386-exp.c', is a C program that sets up a custom FUSE filesystem exposing a SUID root ELF binary at '/hello'. It then orchestrates the creation of several directories and mounts an OverlayFS instance, leveraging the vulnerability to copy the SUID binary into the overlay, resulting in a root-privileged executable. The exploit requires local access, FUSE and OverlayFS support, and a writable directory not mounted with 'nosuid'. The README provides compilation and usage instructions. No network endpoints are present; all actions are local filesystem operations. The repository is structured simply, with one exploit source file and a README.P4x1s · Disclosed May 8, 2023 · c · localPoC
Exposure surface

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.

VendorProductType
CanonicalUbuntu Linuxoperating_system
Debian ProjectDebian Linuxoperating_system
LinuxLinux Kerneloperating_system
NetAppH300s Firmwareoperating_system
NetAppH410c Firmwareoperating_system
NetAppH410s Firmwareoperating_system
NetAppH500s Firmwareoperating_system
NetAppH700s Firmwareoperating_system
FAQ

Frequently asked questions

Is CVE-2023-0386 exploited in the wild?
Yes. As of Oct 19, 2026, Mallory has reports of exploitation in the wild, and CISA added it to KEV on Jun 17, 2025.
Is there a public exploit for CVE-2023-0386?
Yes. Mallory tracks 12 public exploits or proofs of concept for CVE-2023-0386, the earliest disclosed Mar 22, 2023.
Is there a patch for CVE-2023-0386?
Install the distribution-provided kernel security update addressing CVE-2023-0386. The upstream fix, commit 4f11ada10d0a, adds kuid_has_mapping() and kgid_has_mapping() checks before OverlayFS copy-up proceeds.
What products are affected by CVE-2023-0386?
Linux Kernel, Debian Project Debian Linux, NetApp H300s Firmware, NetApp H410c Firmware, NetApp H410s Firmware, and 3 more.
How severe is CVE-2023-0386?
CVE-2023-0386 has a CVSS v3.1 score of 7.8 (High) and an EPSS score of 3.3% (89th percentile) as of Oct 19, 2026.
Mallory platform

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidenceEvery report linking this CVE to a named adversary.
Associated malware1Malware families linked to this CVE, with evidence and IOCs.
Detection signatures1YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activity42Community discussion across Reddit, Mastodon, and other social sources.