{"id":"CVE-2025-27612","aliases":["CVE-2025-27612","GHSA-5w4j-f78p-4wh9","GO-2025-3543"],"related":[],"kind":"vulnerability","state":"published","title":"Libcontainer is affected by capabilities elevation","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### 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","format":"markdown","source":"ghsa"},{"lang":"en","text":"(This report has been withdrawn with reason: \"Does not affect Go code.\"). https://nvd.nist.gov/vuln/detail/CVE-2025-27612 lists https://github.com/opencontainers/runc/security/advisories/GHSA-f3fp-gc8g-vw66 which caused automation to flag as Go; the affected repo is https://github.com/youki-dev/youki (Rust).","format":"markdown","source":"go"},{"lang":"es","text":"libcontainer es una librería para el control de contenedores. Antes de libcontainer 0.5.3, al crear un contenedor de inquilinos, el generador de inquilinos aceptaba una lista de capacidades que se añadían a la especificación del contenedor. La lógica aquí añade las capacidades dadas a todas las capacidades del contenedor principal si están presentes en la especificación; de lo contrario, simplemente se establecen las capacidades proporcionadas como capacidades del contenedor de inquilinos. Sin embargo, establecer límites heredados para el contenedor de inquilinos puede provocar la elevación de capacidades, similar a CVE-2022-29162. Esto no afecta al binario de Youki. Esto solo aplica si se usa libcontainer directamente y el generador de inquilinos.","source":"nvd"}],"published":"2025-03-21T14:24:28.756Z","modified":"2026-06-17T09:03:54.767Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","score":5.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","score":5.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","score":5.9,"rating":"MEDIUM"}],"cwes":["CWE-276"],"affected":[{"ranges":[{"version":"< 0.5.3","status":"affected"}],"vendor":"youki-dev","product":"youki","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.5.3"}],"ecosystem":"crates.io","package":"libcontainer","purl":"pkg:cargo/libcontainer","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected"}],"ecosystem":"Go","package":"github.com/opencontainers/runc","purl":"pkg:golang/github.com/opencontainers/runc","source":"go"}],"references":[{"url":"https://github.com/youki-dev/youki/security/advisories/GHSA-5w4j-f78p-4wh9","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/opencontainers/runc/security/advisories/GHSA-f3fp-gc8g-vw66","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/youki-dev/youki/commit/747e342d2026fbf3a395db3e2a491ebef00082f1","tags":["fix","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/youki-dev/youki/blob/9e63fa4da1672a78ca45100f3059a732784a5174/crates/libcontainer/src/container/tenant_builder.rs#L408","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-27612","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/containers/crun/blob/3ec6298abd79e144fbf3fa6db90793ff4c0516f9/src/exec.c#L319","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/opencontainers/runc/blob/986451c24e17c8d4be3c454f60b1f7be4af3e8b4/exec.go#L234-L242","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/youki-dev/youki","tags":["package"],"sources":["ghsa"]},{"url":"https://man7.org/linux/man-pages/man7/capabilities.7.html","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-03-21T15:19:54.521Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-27612","url":"https://www.cve.org/CVERecord?id=CVE-2025-27612","licence":"CVE Terms of Use","modified":"2025-03-21T15:20:00.538Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-5w4j-f78p-4wh9","url":"https://github.com/advisories/GHSA-5w4j-f78p-4wh9","licence":"CC-BY-4.0","modified":"2026-02-04T03:55:59.577Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2025-3543","url":"https://pkg.go.dev/vuln/GO-2025-3543","licence":"CC-BY-4.0","modified":"2025-03-26T20:15:20.000Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-27612","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-27612","licence":"Public domain","modified":"2026-06-17T09:03:54.767Z"}],"updatedAt":"2026-11-25T22:58:55.407Z","epss":{"score":0.00178,"percentile":0.07682,"date":"2026-12-01T12:00:22.000Z"}}