github.com/opencontainers/runc: opencontainers runc contains procfs race condition with a shared volume mount
What fixes it
- 1.0.0-rc9.0.20200122160610-2fc03cc11c77github.com/opencontainers/runc, goGitHub
go get github.com/opencontainers/runc@v1.0.0-rc9.0.20200122160610-2fc03cc11c77 - 1.0.0-rc9.0.20200122160610-2fc03cc11c77github.com/opencontainers/runc, GoOSV
go get github.com/opencontainers/runc@v1.0.0-rc9.0.20200122160610-2fc03cc11c77
A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.
Description
Impact
By crafting a malicious root filesystem (with /proc being a symlink to a directory which was inside a volume shared with another running container), an attacker in control of both containers can trick runc into not correctly configuring the container's security labels and not correctly masking paths inside /proc which contain potentially-sensitive information about the host (or even allow for direct attacks against the host).
In order to exploit this bug, an untrusted user must be able to spawn custom containers with custom mount configurations (such that a volume is shared between two containers). It should be noted that we consider this to be a fairly high level of access for an untrusted user -- and we do not recommend allowing completely untrusted users to have such degrees of access without further restrictions.
Specific Go Package Affected
github.com/opencontainers/runc/libcontainer
Patches
This vulnerability has been fixed in 1.0.0-rc10. It should be noted that the current fix is effectively a hot-fix, and there are known ways for it to be worked around (such as making the entire root filesystem a shared volume controlled by another container). We recommend that users review their access policies to ensure that untrusted users do not have such high levels of controls over container mount configuration.
Workarounds
If you are not providing the ability for untrusted users to configure mountpoints for runc (or through a higher-level tool such as docker run -v) then you are not vulnerable to this issue. This exploit requires fairly complicated levels of access (which are available for some public clouds but are not necessarily available for all deployments).
Additionally, it appears as though it is not possible to exploit this vulnerability through Docker (due to the order of mounts Docker generates). However you should not depend on this, as it may be possible to work around this roadblock.
Credits
This vulnerability was discovered by Cure53, as part of a third-party security audit.
For more information
If you have any questions or comments about this advisory:
- Open an issue.
- Email us at [dev@opencontainers.org](mailto:dev@opencontainers.org), or [security@opencontainers.org](mailto:security@opencontainers.org) if you think you've found a security bug.
Text from GitHub Advisory Database
Affected versions 3
- github.com/opencontainers/runc, go< 1.0.0-rc9.0.20200122160610-2fc03cc11c77GitHub
- n/aaffected: n/aCVE List
- github.com/opencontainers/runc, Gofrom first release, fixed in 1.0.0-rc9.0.20200122160610-2fc03cc11c77OSV
References 26
- github.com/opencontainers/runc/commit/2fc03cc11c775b7a8b2e48d7ee447cb9bef32ad0Fixvia GitHub
- github.com/opencontainers/runc/security/advisories/GHSA-fh74-hm69-rqjwAdvisoryvia GitHub
- access.redhat.com/errata/RHSA-2020:0688Advisoryvia CVE List
- access.redhat.com/errata/RHSA-2020:0695Advisoryvia CVE List
- security-tracker.debian.org/tracker/CVE-2019-19921Advisoryvia CVE List
- security.gentoo.org/glsa/202003-21Advisoryvia CVE List
- github.com/advisories/GHSA-fh74-hm69-rqjwAdvisoryvia GitHub
- usn.ubuntu.com/4297-1/Advisoryvia CVE List
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/DHGVGGMKGZSJ7YO67TGGPFEHBYMS63VF/Advisoryvia CVE List
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FYVE3GB4OG3BNT5DLQHYO4M5SXX33AQ5/Advisoryvia CVE List
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/I6BF24VCZRFTYBTT3T7HDZUOTKOTNPLZ/Advisoryvia CVE List
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ANUGDBJ7NBUMSUFZUSKU3ZMQYZ2Z3STN/Advisoryvia CVE List
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FNB2UEDIIJCRQW4WJLZOPQJZXCVSXMLD/Advisoryvia CVE List
- nvd.nist.gov/vuln/detail/CVE-2019-19921Referencevia GitHub
- github.com/opencontainers/runc/issues/2197Referencevia CVE List
- github.com/opencontainers/runc/pull/2190Referencevia CVE List
- github.com/opencontainers/runc/pull/2207Referencevia GitHub
- github.com/opencontainers/runc/releasesReferencevia CVE List
- pkg.go.dev/vuln/GO-2021-0087Referencevia GitHub
- lists.debian.org/debian-lts-announce/2023/03/msg00023.htmlReferencevia CVE List
- usn.ubuntu.com/4297-1Referencevia GitHub
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/I6BF24VCZRFTYBTT3T7HDZUOTKOTNPLZReferencevia GitHub
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/FYVE3GB4OG3BNT5DLQHYO4M5SXX33AQ5Referencevia GitHub
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/FNB2UEDIIJCRQW4WJLZOPQJZXCVSXMLDReferencevia GitHub
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/DHGVGGMKGZSJ7YO67TGGPFEHBYMS63VFReferencevia GitHub
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ANUGDBJ7NBUMSUFZUSKU3ZMQYZ2Z3STNReferencevia GitHub