CVE-2025-27612: Libcontainer is affected by capabilities elevation
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 . 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 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.
[!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
Other sources
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.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
rust/libcontainerto a version that resolves this vulnerability.Fixed in 0.5.3 - Configuration
When using libcontainer directly with the tenant builder, do not pass user-provided capabilities to the tenant builder so no capabilities are set on the tenant container.
libcontainer (tenant builder) Tenant container capabilities inheritance/capabilities spec = Do not pass any user-provided capabilities to the tenant builder - Configuration
Alternatively, verify the capabilities of the original container and filter the user-passed capabilities before setting them on the tenant.
libcontainer (tenant builder) Capabilities added to tenant container from user input = Filter tenant capabilities to only those present as inherited in the original container
Event History
Frequently Asked Questions
What is the severity of CVE-2025-27612?
CVE-2025-27612 is considered a high-severity vulnerability due to its impact on the security of tenant containers.
How do I fix CVE-2025-27612?
To fix CVE-2025-27612, upgrade libcontainer to version 0.5.3 or later.
What is the main risk associated with CVE-2025-27612?
The main risk associated with CVE-2025-27612 is that it may allow unauthorized capability escalation in tenant containers.
Which versions of libcontainer are affected by CVE-2025-27612?
libcontainer versions prior to 0.5.3 are affected by CVE-2025-27612.
Is CVE-2025-27612 being actively exploited?
As of now, there is no public indication that CVE-2025-27612 is actively being exploited, but it is advised to apply the patch promptly.