devcontainers / devcontainers/cli

Dependency confusion attack from looking for manifest in docker.io first

Ouverte
#811 2 commentaires 0 réactions 1 personne assignée Réclamée par @chrmarti Voir sur GitHub
info-needed
Langage dominant
TypeScript
Étoiles
3k
Forks
457
Merge moyen
13 h 17 min
PR mergées (30 j)
6

Description

[This block of code](https://github.com/devcontainers/cli/blob/c1c8b08263c6dca7cd79c97a2d0bc581fcef4f6c/src/spec-node/utils.ts#L309-L313) assumes that any image name with only one slash in it cannot possibly be a fully qualified image name, and therefore prepends `docker.io/` to the name.

Thus, if I specify a Dockerfile with
```
FROM artefact.example.com/my_image:1.2.3
```
then this CLI first looks for a manifest at `docker.io/artefact.example.com/my_image:1.2.3`.

This concerns me. It feels like an invitation to a dependency confusion attack. Someone could create an "artefact.example.com" organization on docker.io, publish a malicious image named "my_image:1.2.3", and this CLI would pull that instead of what I specified.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.