GHSA-vp35-85q5-9f25: Container build can leak any path on the host into the container
Noroxi assessment
Priority: Monitor (action score 0/100)
- The sources we track (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) show no public exploit code or exploitation in the wild.
- Fixed version: github.com/docker/docker (Go) 20.10.20, 20.10.20+incompatible.
Low priority for now. Upgrade to github.com/docker/docker (Go) 20.10.20, 20.10.20+incompatible or later.
Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it
Primary sources: OSV
### Description Moby is the open source Linux container runtime and set of components used to build a variety of downstream container runtimes, including Docker CE, Mirantis Container Runtime (formerly Docker EE), and Docker Desktop. Moby allows for building container images using a set of build instructions (usually named and referred to as a "Dockerfile"), and a build context, which is not unlike the CWD in which the Dockerfile instructions are executed. Containers may be built using a variety of tools and build backends available in the Moby ecosystem; in all cases, builds may not include files outside of the build context (such as using absolute or relative-parent paths). This is enforced through both checks in the build backends, and the containerization of the build process itself. Versions of Git where CVE-2022-39253 is present and exploited by a malicious repository, when used in combination with Moby, are subject to an unexpected inclusion of arbitrary filesystem paths in the build context, without any visible warning to the user. This issue was originally reported by Wenxiang Qian of Tencent Blade Team, and the root-cause analysis was performed by Cory Snider of Mirantis, with assistance from Bjorn Neergaard of the same. The issue was then reported to the Git project, and Taylor Blau led the process resolving the root issue in Git. ### Impact This vulnerability originates in Git, but can be used to violate assumptions that may have security implications for users of Moby and related components. Users may rely on the fact that a build context ensures that outside files cannot be referenced or incorporated using multiple enforcement mechanisms, or expect a warning if this does not hold true. A maliciously crafted Git repository exploiting CVE-2022-39253 can violate this assumption, and potentially include sensitive files that are subsequently uploaded to a container image repository, or disclosed by code inside the resulting container image. As this issue cannot be triggered remotely, except by users who already have full control over the daemon through the API, and it requires exploiting a vulnerability in Git by convincing a user to build a maliciously crafted repository, the impact in Moby is considered low. ### Patches Moby 20.10.20, and Mirantis Container Runtime (formerly Docker Enterprise Edition) 20.10.14 will contain mitigations for CVE-2022-39253 when a Git clone is performed by Moby components (on either the daemon or API client side). However, as these mitigations only apply to certain scenarios (build of `git+<protocol>://...` URL contexts) and cannot protect against a malicious repository already on disk, users should update to a version of Git containing patches for CVE-2022-39253 on all their systems running both API clients and daemons. Specifically, patches in Moby (including patches incorporated from BuildKit) protect against the following: * `docker build` with the legacy builder (e.g. `DOCKER_BUILDKIT` unset or set to 0) of a Git URL context. Note that depending on available API versions and the CLI version, the Git clone operation can take place on either the client or the daemon side. Both must be updated (or have Git updated) to fully protect this build method. * `docker build` with the BuildKit builder (e.g. `DOCKER_BUILDKIT=1`) of a Git URL context. * `docker buildx build` with `BUILDKIT_CONTEXT_KEEP_GIT_DIR=1` of a Git URL context. Patches in BuildKit incorporated into Docker Compose protect against CVE-2022-39253 during Compose-driven builds of Git URL contexts. Patches in Moby and related projects such as BuildKit, the Docker CLI, and Docker Compose **cannot** fully protect against CVE-2022-39253, as it may be triggered by a malicious repository already on disk that a unpatched Git client has interacted with (specifically, commands that check out submodules such as `git clone --recursive`, `git submodule update`, etc. may have already triggered the Git vulnerability). ### Workarounds While this behavior is unexpected and undesirable, and has resulted in this security advisory, users should keep in mind that building a container entails arbitrary code execution. Users should not build a repository/build context they do not trust, as containerization cannot protect against all possible attacks. When building with BuildKit (e.g. `docker buildx build` or `docker build` with `DOCKER_BUILDKIT=1`), this issue cannot be exploited unless `--build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=1` was also passed, as by default BuildKit will discard the `.git` directory of a Git URL context immediately after cloning and checking out the repository. ### For more information If you have any questions or comments about this advisory: * [Open an issue](https://github.com/moby/moby/issues/new) * Email us at [security@docker.com](mailto:security@docker.com)
- Published
- Nov 11, 2022
- Updated
- Aug 21, 2024
- EPSS
- —
- CWE
- CWE-200
Report tools
Action score
0
Low priority for now.
- CVSS
- 0 / 40 · —
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 0 / 30 · —
Get told when this record changes
- Not in KEV: no record of exploitation in the wild
- No public exploit code on record
- A fix has been released
If any of these changes, we'll tell you in the daily email digest.
Is your version affected? Check itNoroxi analysis
What does it mean in your environment?
The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.
We use this product, ask for helpAffected systems
Is your version affected?
Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.
| Vendor | Product | CPE |
|---|---|---|
| Go | github.com/docker/docker | pkg:golang/github.com/docker/docker |
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| Go | github.com/docker/docker | before 20.10.20 | 20.10.20 |
| Go | github.com/docker/docker | before 20.10.20+incompatible | 20.10.20+incompatible |
Same product
Go: all recordsOther highest-scoring records for the same primary product.
- GO-2022-1107Container build can leak any path on the host into the container in github.com/docker/docker0Monitor
- GO-2024-2914Moby (Docker Engine) is vulnerable to Ambiguous OCI manifest parsing in github.com/docker/docker0Monitor
- GHSA-xmmx-7jpf-fx42Moby (Docker Engine) is vulnerable to Ambiguous OCI manifest parsing0Monitor
Published before and after this one in the same product
- Later →GHSA-jq35-85cj-fj4pOct 30, 2023 · /sys/devices/virtual/powercap accessible by default to containers0Monitor
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| Go:github.com/docker/docker | 20.10.20 | Package registry (OSV) |
| Go:github.com/docker/docker | 20.10.20+incompatible | Package registry (OSV) |
Exploit status
No known public exploit
No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
No dated events beyond publication.
Not on record for this CVE: EPSS history · patch commit or PR link · researcher credit · variant or chain candidate · public bounty program.
Technical details
No CVSS vector for this record, so attack conditions can't be derived.
Weakness class (CWE)
CWE-200 · Exposure of Sensitive Information to an Unauthorized ActorRoot cause
The extension requests broader permissions than its function needs and sends the data it collects out for purposes beyond its stated function.
The bug in code
The whole CWE-200 classA representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.
Vulnerable
{
"permissions": ["tabs", "<all_urls>"],
"background": { "service_worker": "analytics.js" }
}Fixed
{
"permissions": ["activeTab"],
"host_permissions": ["https://yildiz.example/*"]
}Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
Attack patterns (CAPEC)
- ExcavationCAPEC-116likelihood: High · Medium
- Subverting Environment Variable ValuesCAPEC-13likelihood: High · Very High
- FootprintingCAPEC-169likelihood: High · Very Low
- Exploiting Trust in ClientCAPEC-22likelihood: High · High
- FingerprintingCAPEC-224likelihood: High · Very Low
- ICMP Echo Request PingCAPEC-285likelihood: Medium · Low
- TCP SYN ScanCAPEC-287Low
- Enumerate Mail Exchange (MX) RecordsCAPEC-290Low
ATT&CK techniques
- System Service DiscoveryT1007
- System Network Configuration DiscoveryT1016
- Remote System DiscoveryT1018
- System Owner/User DiscoveryT1033
- Masquerading: Match Legitimate Name or LocationT1036.005
- Network Service ScanningT1046
- System Network Connections DiscoveryT1049
- Process DiscoveryT1057
- Permission Groups DiscoveryT1069
- System Information DiscoveryT1082
- File and Directory DiscoveryT1083
- Account DiscoveryT1087
- Multi-Factor Authentication InterceptionT1111
- Peripheral Device DiscoveryT1120
- System Time DiscoveryT1124
- Access Token Manipulation:Token Impersonation/TheftT1134.001
Change log (2)
- Fix✗ → ✓
- CVSS2.5 → —
For records you follow, these changes also arrive as notifications. →
References
Show all references (4 more)Show less
Vendor advisories and official records. Exploit/PoC links are deliberately left out.