{"answers":{"affected":"3 open source packages ship an affected version, including github.com/opencontainers/runc.","exploited":"There is no known exploitation of GHSA-g54h-m393-cpwq in the wild and no public exploit code.","fix":"Upgrade github.com/opencontainers/runc to 1.0.0-rc91 or later.","what":"GHSA-g54h-m393-cpwq is a vulnerability in github.com/opencontainers/runc, published on 20 Dec 2021. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-g54h-m393-cpwq and fix it if it is affected.\n\nWhat it is: GHSA-g54h-m393-cpwq is a vulnerability in github.com/opencontainers/runc, published on 20 Dec 2021. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-g54h-m393-cpwq in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- github.com/opencontainers/runc (Go): affected all versions; fixed in 1.0.0-rc91\n- github.com/opencontainers/runc (Go): affected all versions; fixed in 1.0.0-rc91\n- github.com/opencontainers/runc (Go): affected all versions; fixed in 1.0.0-rc91\n\nTask:\n1. 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.\n2. 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.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-g54h-m393-cpwq/ (Markdown: https://insights.sbomify.com/GHSA-g54h-m393-cpwq/index.md)","id":"GHSA-g54h-m393-cpwq","markdown":"https://insights.sbomify.com/GHSA-g54h-m393-cpwq/index.md","name":"GHSA-g54h-m393-cpwq","record":{"aliases":["GO-2022-0396"],"analysis":{"component_type":"container_or_infrastructure","fix_type":"upgrade","impacts":["privilege_escalation","data_read"],"network_reachable":"adjacent_or_local","non_default_config":true,"product_category":"OCI runtime runc","requires_auth":"none","summary":"runc treated device lists as blacklists by default, allowing malicious containers to access arbitrary devices if deny-all rules were missing.","user_interaction":"not_required","vuln_class":"security_feature_bypass"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"### Impact\nContrary to the [OCI runtime specification](https://github.com/opencontainers/runtime-spec/blob/v1.0.2/config-linux.md#device-whitelist), `runc`'s implementation of the `linux.resources.devices` list was a black-list by default. This means that users who created their own `config.json` objects and didn't prefix a deny-all rule (`{\"allow\": false, \"permissions\": \"rwm\"}` or equivalent) were not provided protection by the `devices` cgroup. This would allow malicious containers (with sufficient privileges) to create arbitrary device inodes (assuming they have `CAP_MKNOD`) and operate on any device inodes they may have access to (assuming they have regular Unix DAC permissions).\n\nHowever, most (if not all) programs that make use of `runc` include this deny-all rule. This was most likely added before the specification mandated a white-list of devices, and the fact that all programs wrote their own deny-all rule obscured the existence of this bug for several years. In fact, even the specification's examples include a default deny-all rule! We therefore believe that while this is a security bug (and has been fixed as such), it was almost certainly not exploitable in the wild due to the inclusion of default deny-all rules by all known users of `runc` -- hence why this advisory has low severity.\n\n### Patches\nThis issue has been fixed in [a patch that was part of a larger rework of the devices cgroup code in runc](https://github.com/opencontainers/runc/pull/2391) -- which lead to the discovery of this security bug. Users should upgrade to 1.0.0-rc91 as soon as it is released, or wait for your distribution to backport the relevant fixes.\n\n### Workarounds\nIf you are using `runc` directly, ensure that there is a deny-all entry at the beginning of `linux.resources.devices` -- such an entry would look like `{\"allow\": false, \"permissions\": \"rwm\"}` (all other fields are ignored, though `type` must be set to `\"a\"` or `null` if it is present).\n\nUsers which consume `runc` through another program should check whether their containers are operating under a white-list -- this can be done by reading `/sys/fs/cgroup/devices/devices.list` inside the container. If the file contains only the entry `a *:* rwm` (meaning the cgroup is in black-list mode, which likely means \"allow all device access\") then your containers are vulnerable to this issue.\n\nAs always, we recommend **in the strongest possible terms** that all of our users enable user namespaces on all of their workloads (or pressure their vendors to do so). User namespaces are one of the most significant defense-in-depth protections you can enable for containers, and have prevented many container-related vulnerabilities (both kernel 0days as well as bugs in container runtimes, such as this one).\n\n### References\n* https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v1/devices.html\n* [opencontainers/runtime-spec/config-linux.md#device-whitelist](https://github.com/opencontainers/runtime-spec/blob/v1.0.2/config-linux.md#device-whitelist)\n* https://github.com/opencontainers/runc/pull/2391\n\n### For more information\nIf you have any questions or comments about this advisory:\n* [Open an issue in this repo](https://github.com/opencontainers/runc/issues/new).\n* Email us at \u003csecurity@opencontainers.org\u003e.","ecosystems":["Go"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"devices resource list treated as a blacklist by default","id":"GHSA-g54h-m393-cpwq","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"Go","product":null,"products":[],"type":"security_feature_bypass","year":"2021"},"n_packages":3,"n_references":null,"packages":[{"ecosystem":"Go","fixed":["1.0.0-rc91"],"introduced":["0"],"last_affected":[],"package":"github.com/opencontainers/runc","purl":null,"source":"GHSA-g54h-m393-cpwq"},{"ecosystem":"Go","fixed":["1.0.0-rc91"],"introduced":["0"],"last_affected":[],"package":"github.com/opencontainers/runc","purl":"pkg:golang/github.com/opencontainers/runc","source":"GHSA-g54h-m393-cpwq"},{"ecosystem":"Go","fixed":["1.0.0-rc91"],"introduced":["0"],"last_affected":[],"package":"github.com/opencontainers/runc","purl":"pkg:golang/github.com/opencontainers/runc","source":"GO-2022-0396"}],"products":null,"published":"2021-12-20","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"Go Vulnerability Database","prefix":"GO"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"runc treated device lists as blacklists by default, allowing malicious containers to access arbitrary devices if deny-all rules were missing.","url":"https://insights.sbomify.com/GHSA-g54h-m393-cpwq/"}