# CVE-2025-27612: Libcontainer is affected by capabilities elevation

> Attackers using libcontainer's tenant builder can elevate container capabilities, potentially gaining unauthorized privileges within the container environment.

- **Severity:** Medium 5.9 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 21 Mar 2025
- **Updated:** 21 Mar 2025
- **Also known as:** CLEANSTART-2026-ON51112, GHSA-5w4j-f78p-4wh9, MINI-3422-2gmx-66gj, MINI-5w5r-8r77-36v7, MINI-6r6r-fcjj-m682, MINI-9h95-vmmq-g7pg, MINI-c635-fg9j-rh8w, MINI-f2hx-5c2j-h9m2, MINI-fjmj-96j8-cjm3, MINI-frw6-2gcm-9h36, MINI-g7vx-49j5-2pjf, MINI-hvqp-54fr-w5x4, MINI-mfp8-p9wh-vp5v, MINI-q97c-8cpw-22x2, MINI-v2qf-j45h-9g9r, MINI-v4r8-8gj9-9m9m, MINI-vc9v-j9mx-63hg, MINI-wj45-fjfx-3392, MINI-wqmm-6849-pxqf

## What is CVE-2025-27612?

CVE-2025-27612 is a medium-severity vulnerability in youki-dev youki, published on 21 Mar 2025. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

libcontainer is a library for container control. Prior to libcontainer 0.5.3, while creating a tenant container, the tenant builder accepts a list of capabilities to be added in the spec of tenant container. The logic here adds the given capabilities to all capabilities of main container if present in spec, otherwise simply set provided capabilities as capabilities of the tenant container. However, setting inherited caps in any case for tenant container can lead to elevation of capabilities, similar to CVE-2022-29162. This does not affect youki binary itself. This is only applicable if you are using libcontainer directly and using the tenant builder.

Weakness: CWE-276 (Incorrect Default Permissions)

## Which versions are affected by CVE-2025-27612?

2 open source packages ship an affected version, including libcontainer.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `libcontainer` | crates.io | All versions | 0.5.3 |
| `libcontainer` | crates.io | All versions | 0.5.3 |

## How do I fix CVE-2025-27612?

Upgrade libcontainer to 0.5.3 or later.

## Is CVE-2025-27612 being exploited?

There is no known exploitation of CVE-2025-27612 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-27612 and fix it if it is affected.

What it is: CVE-2025-27612 is a medium-severity vulnerability in youki-dev youki, published on 21 Mar 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-27612 in the wild and no public exploit code.

Affected packages and fixed versions:
- libcontainer (crates.io): affected all versions; fixed in 0.5.3
- libcontainer (crates.io): affected all versions; fixed in 0.5.3

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-2025-27612/ (Markdown: https://insights.sbomify.com/CVE-2025-27612/index.md)
```

## Sources

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

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