CVE-2025-27612: Libcontainer Libcontainer Is Affected By Capabilities Vulnerability

MODERATE
Advisory Identifier: GHSA-5w4j-f78p-4wh9
CVSS 5.9
CWE-276
Published
Advisory Summary

CVE-2025-27612 is a MODERATE (CVSS 5.9) libcontainer is affected by capabilities vulnerability (CWE-276: Incorrect Default Permissions) affecting Libcontainer libraries in the crates.io ecosystem. The issue involves libcontainer is affected by capabilities elevation similar to ghsa-f3fp-gc8g-vw66. Remediation is available by upgrading affected packages to version 0.5.3.

CVE-2025-27612 at a Glance

CVE Identifier CVE-2025-27612
GHSA Identifier GHSA-5w4j-f78p-4wh9
Severity MODERATE
CVSS v3.1 Base Score 5.9
CWE Classification CWE-276: Incorrect Default Permissions
Affected Product Libcontainer
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 5.9

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2025-27612

To remediate this vulnerability, upgrade all affected Libcontainer dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

libcontainer fixed: 0.5.3
Upgrade libcontainer to 0.5.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for libcontainer

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-27612, inspect your project dependencies for Libcontainer:

inspect dependencies for libcontainer

Analyze the terminal output to locate any version of Libcontainer in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.5.3), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-276: Incorrect Default Permissions, where during installation, installed file permissions are set to allow anyone to modify those files. In Libcontainer, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact In libcontainer, while creating a tenant container, the tenant builder accepts a list of capabilities to be added in the spec of tenant container. Code can be seen [here](https://github.com/youki-dev/youki/blob/9e63fa4da1672a78ca45100f3059a732784a5174/crates/libcontainer/src/container/tenant_builder.rs#L408) . 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, GHSA-f3fp-gc8g-vw66 was opened on runc mentioning that setting inherited caps in any case for tenant container can lead to elevation of capabilities. For this, they added a fix [here](https://github.com/opencontainers/runc/blob/986451c24e17c8d4be3c454f60b1f7be4af3e8b4/exec.go#L234-L242) where they never set new inherited caps on tenant, and set ambient caps only if original container had inherited caps. Similarly crun never sets inherited caps as can be seen [here](https://github.com/containers/crun/blob/3ec6298abd79e144fbf3fa6db90793ff4c0516f9/src/exec.c#L319). > [!NOTE] This does not affect youki binary itself, as the exec implementation is partially broken and does not pass on the user-provided caps to tenant containers, this is only applicable if you are using libcontainer directly and using the tenant builder. ### Workarounds - Do not pass any user-provided capabilities to the tenant builder, in which case no capabilities will be set on tenant. - Alternatively you can verify the capabilities of original container and filter the user passed capabilities before setting them on tenant. ### References - https://github.com/opencontainers/runc/security/advisories/GHSA-f3fp-gc8g-vw66 - https://man7.org/linux/man-pages/man7/capabilities.7.html

CVE-2025-27612 Affected Libcontainer Versions

1 component(s)
Fixed Versions:
0.5.3
Product / Package Ecosystem Affected Versions Fixed Version
libcontainer
crates.io
< 0.5.3
0.5.3

References

Frequently Asked Questions

What is CVE-2025-27612?
CVE-2025-27612 is a security vulnerability in Libcontainer involving Libcontainer is affected by capabilities elevation similar to GHSA-f3fp-gc8g-vw66 under CWE-276: Incorrect Default Permissions.
Which Libcontainer versions are affected?
Affected versions include releases prior to 0.5.3 across affected packages: libcontainer.
What version fixes CVE-2025-27612?
Upgrading to 0.5.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is libcontainer affected?
Yes, libcontainer is affected in releases prior to 0.5.3. Upgrade your dependency to 0.5.3 or later.
What is the CVSS score of CVE-2025-27612?
CVE-2025-27612 has a CVSS v3.1 base score of 5.9 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L.
What CWE is associated with CVE-2025-27612?
CVE-2025-27612 is classified under CWE-276: Incorrect Default Permissions (During installation, installed file permissions are set to allow anyone to modify those files.).
How can I check crates.io dependencies for CVE-2025-27612?
Run the dependency tree command: 'inspect dependencies for libcontainer'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-5w4j-f78p-4wh9",
  "modified" : "2025-03-21T15:42:03Z",
  "published" : "2025-03-21T15:18:28Z",
  "aliases" : [ "CVE-2025-27612" ],
  "summary" : "Libcontainer is affected by capabilities elevation similar to GHSA-f3fp-gc8g-vw66",
  "details" : "### Impact\nIn libcontainer, while creating a tenant container, the tenant builder accepts a list of capabilities to be added in the spec of tenant container. Code can be seen [here](https://github.com/youki-dev/youki/blob/9e63fa4da1672a78ca45100f3059a732784a5174/crates/libcontainer/src/container/tenant_builder.rs#L408) . 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.\n\nHowever, GHSA-f3fp-gc8g-vw66 was opened on runc mentioning that setting inherited caps in any case for tenant container can lead to elevation of capabilities. For this, they added a fix [here](https://github.com/opencontainers/runc/blob/986451c24e17c8d4be3c454f60b1f7be4af3e8b4/exec.go#L234-L242) where they never set new inherited caps on tenant, and set ambient caps only if original container had inherited caps.\n\nSimilarly crun never sets inherited caps as can be seen [here](https://github.com/containers/crun/blob/3ec6298abd79e144fbf3fa6db90793ff4c0516f9/src/exec.c#L319).\n\n> [!NOTE]\nThis does not affect youki binary itself, as the exec implementation is partially broken and does not pass on the user-provided caps to tenant containers, this is only applicable if you are using libcontainer directly and using the tenant builder.\n\n### Workarounds\n- Do not pass any user-provided capabilities to the tenant builder, in which case no capabilities will be set on tenant.\n- Alternatively you can verify the capabilities of original container and filter the user passed capabilities before setting them on tenant.\n\n### References\n- https://github.com/opencontainers/runc/security/advisories/GHSA-f3fp-gc8g-vw66\n- https://man7.org/linux/man-pages/man7/capabilities.7.html",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "libcontainer"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.5.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/opencontainers/runc/security/advisories/GHSA-f3fp-gc8g-vw66"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/youki-dev/youki/security/advisories/GHSA-5w4j-f78p-4wh9"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-27612"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/youki-dev/youki/commit/747e342d2026fbf3a395db3e2a491ebef00082f1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/containers/crun/blob/3ec6298abd79e144fbf3fa6db90793ff4c0516f9/src/exec.c#L319"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/opencontainers/runc/blob/986451c24e17c8d4be3c454f60b1f7be4af3e8b4/exec.go#L234-L242"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/youki-dev/youki"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/youki-dev/youki/blob/9e63fa4da1672a78ca45100f3059a732784a5174/crates/libcontainer/src/container/tenant_builder.rs#L408"
  }, {
    "type" : "WEB",
    "url" : "https://man7.org/linux/man-pages/man7/capabilities.7.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-276" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-03-21T15:18:28Z",
    "nvd_published_at" : "2025-03-21T15:15:42Z"
  }
}