Research
A crafted container image manifest could direct the container runtime to fetch a layer from an attacker-controlled server, which could then request and receive the client's registry credentials. An attacker could obtain credentials used by ctr/containerd to access the registry, potentially including cloud instance service account tokens.
Published on darkbit.io
CVE-2020-15157: If an attacker publishes a public image with a crafted manifest that directs one of the image layers to be fetched from a web server they control and they trick a user or system into pulling the image, they can obtain the credentials used by ctr/containerd to access that registry. In some cases, this…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the container runtime followed URLs in the image manifest for foreign layers and, upon receiving an HTTP 401 response with registry-specific headers, sent its registry authentication credentials to the server hosting the URL.
What the attacker needed
Attacker publishes a crafted image; victim pulls the image; runtime is containerd v1.2.x
The fix
The issue was fixed in containerd 1.3.x and later, which do not respond to HTTP 401 requests for foreign layers.
How it was found
- Create a normal container image and push it to a registry.
- Fetch the image manifest using the registry API.
- Modify the manifest to add a 'urls' field pointing to an attacker-controlled server.
- Push the modified manifest back to the registry.
- Set up a web server that responds with HTTP 401 and registry-specific headers when the layer URL is requested.
- Pull the image using ctr/containerd; the client will request the layer from the attacker server and send credentials.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When you download a container image, your computer follows instructions in a file called a manifest. This report shows that if the manifest tells your computer to get a piece of the image from a different server, your computer might send its login details to that server if it asks for them. An attacker could set up such a server to steal those credentials.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.