# CVE-2023-0386: Linux Kernel Improper Ownership Management

> A local user can escalate privileges by exploiting an OverlayFS uid mapping bug that allows unauthorized execution of setuid files with capabilities.

- **Severity:** High 7.8 (`CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Yes, since 17 Jun 2025 (CISA KEV)
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 22 Mar 2023
- **Updated:** 21 Oct 2025
- **Also known as:** ALSA-2023:1691, ALSA-2023:1703, AZL-25742, DEBIAN-CVE-2023-0386, GHSA-p72q-v88c-rprq, RHSA-2023:1681, RHSA-2023:1691, RHSA-2023:1703, RHSA-2023:1970, RHSA-2023:1980, RHSA-2023:1984, UBUNTU-CVE-2023-0386

## What is CVE-2023-0386?

CVE-2023-0386 is a high-severity vulnerability in Canonical Ubuntu Linux, published on 22 Mar 2023. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

A flaw was found in the Linux kernel, where unauthorized access to the execution of the setuid file with capabilities was found in the Linux kernel’s OverlayFS subsystem in how a user copies a capable file from a nosuid mount into another mount. This uid mapping bug allows a local user to escalate their privileges on the system.

Weakness: CWE-282 (Improper Ownership Management)

## Which versions are affected by CVE-2023-0386?

It affects 8 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `bpftool` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.el9_1 |
| `kernel` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.el9_1 |
| `kernel-abi-stablelists` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.el9_1 |
| `kernel-core` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.el9_1 |
| `kernel-cross-headers` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.el9_1 |
| `kernel-debug` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.el9_1 |
| `kernel-debug-core` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.el9_1 |
| `kernel-debug-devel` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.el9_1 |
| `kernel-debug-devel-matched` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.el9_1 |
| `kernel-debug-modules` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.el9_1 |
| `kernel-debug-modules-extra` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.el9_1 |
| `kernel-devel` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.el9_1 |
| `kernel-devel-matched` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.el9_1 |
| `kernel-doc` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.el9_1 |
| `kernel-modules` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.el9_1 |
| `kernel-modules-extra` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.el9_1 |
| `kernel-rt` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.rt21.186.el9_1 |
| `kernel-rt-core` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.rt21.186.el9_1 |
| `kernel-rt-debug` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.rt21.186.el9_1 |
| `kernel-rt-debug-core` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.rt21.186.el9_1 |
| `kernel-rt-debug-devel` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.rt21.186.el9_1 |
| `kernel-rt-debug-kvm` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.rt21.186.el9_1 |
| `kernel-rt-debug-modules` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.rt21.186.el9_1 |
| `kernel-rt-debug-modules-extra` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.rt21.186.el9_1 |
| `kernel-rt-devel` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.rt21.186.el9_1 |
| `kernel-rt-kvm` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.rt21.186.el9_1 |
| `kernel-rt-modules` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.rt21.186.el9_1 |
| `kernel-rt-modules-extra` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.rt21.186.el9_1 |
| `kernel-tools` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.el9_1 |
| `kernel-tools-libs` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.el9_1 |
| `kernel-tools-libs-devel` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.el9_1 |
| `kernel-zfcpdump` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.el9_1 |
| `kernel-zfcpdump-core` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.el9_1 |
| `kernel-zfcpdump-devel` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.el9_1 |
| `kernel-zfcpdump-devel-matched` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.el9_1 |
| `kernel-zfcpdump-modules` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.el9_1 |
| `kernel-zfcpdump-modules-extra` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.el9_1 |
| `perf` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.el9_1 |
| `python3-perf` | AlmaLinux:9 | All versions | 5.14.0-162.23.1.el9_1 |
| `bpftool-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:5.14.0-162.23.1.el9_1 |

Products: Canonical Ubuntu Linux, Debian Debian Linux, Linux kernel, Netapp H300s Firmware, Netapp H410c Firmware, Netapp H410s Firmware, Netapp H500s Firmware, Netapp H700s Firmware.

## How do I fix CVE-2023-0386?

Apply the vendor's patch. US federal agencies must fix it by 8 Jul 2025.

## Is CVE-2023-0386 being exploited?

Yes. Attackers have exploited CVE-2023-0386 in the wild since at least 17 Jun 2025.

Public exploit code:

- CVE-2023-0386在ubuntu22.04上的提权 (github_poc): https://github.com/xkaneiki/CVE-2023-0386
- CVE-2023-0386 analysis and Exp (github_poc): https://github.com/chenaotian/CVE-2023-0386
- Vulnerabilities Exploitation On Ubuntu 22.04 (github_poc): https://github.com/sxlmnwb/CVE-2023-0386
- https://github.com/puckiestyle/CVE-2023-0386 (github_poc): https://github.com/puckiestyle/CVE-2023-0386
- 非常简单的CVE-2023-0386's exp and analysis.Use c and sh. (github_poc): https://github.com/Fanxiaoyao66/CVE-2023-0386
- https://github.com/veritas501/CVE-2023-0386 (github_poc): https://github.com/veritas501/CVE-2023-0386

## Other vulnerabilities in Canonical Ubuntu Linux

- [CVE-2020-11651](https://insights.sbomify.com/CVE-2020-11651/): SaltStack Salt Authentication Bypass (critical 9.8, exploited in the wild)
- [CVE-2020-7247](https://insights.sbomify.com/CVE-2020-7247/): OpenSMTPD Remote Code Execution (critical 9.8, exploited in the wild)
- [CVE-2019-16928](https://insights.sbomify.com/CVE-2019-16928/): Exim Out-of-bounds Write (critical 9.8, exploited in the wild)
- [CVE-2018-6789](https://insights.sbomify.com/CVE-2018-6789/): Exim Buffer Overflow (critical 9.8, exploited in the wild)
- [CVE-2015-2590](https://insights.sbomify.com/CVE-2015-2590/): Oracle Java SE and Java SE Embedded Remote Code Execution (critical 9.8, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-0386 and fix it if it is affected.

What it is: CVE-2023-0386 is a high-severity vulnerability in Canonical Ubuntu Linux, published on 22 Mar 2023. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: Yes. Attackers have exploited CVE-2023-0386 in the wild since at least 17 Jun 2025.

Affected product: Canonical Ubuntu Linux. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-0386/ (Markdown: https://insights.sbomify.com/CVE-2023-0386/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-0386
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-0386
- OSV: https://osv.dev/vulnerability/CVE-2023-0386

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-0386/
Summaries are generated and may contain mistakes; the official description above is the record.
