GHSA-5w4j-f78p-4wh9

Suggest an improvement
Source
https://github.com/advisories/GHSA-5w4j-f78p-4wh9
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/03/GHSA-5w4j-f78p-4wh9/GHSA-5w4j-f78p-4wh9.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-5w4j-f78p-4wh9
Aliases
Related
Published
2025-03-21T15:18:28Z
Modified
2025-03-26T20:38:58.534825Z
Severity
  • 5.9 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L CVSS Calculator
Summary
Libcontainer is affected by capabilities elevation similar to GHSA-f3fp-gc8g-vw66
Details

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
Database specific
{
    "nvd_published_at": "2025-03-21T15:15:42Z",
    "cwe_ids": [
        "CWE-276"
    ],
    "severity": "MODERATE",
    "github_reviewed": true,
    "github_reviewed_at": "2025-03-21T15:18:28Z"
}
References

Affected packages

crates.io / libcontainer

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0.5.3