Docker Hub's access token vulnerability: how signing let me verify my images
Описание и применение
В результате уязвимости в Docker Hub персональные токены могли использоваться для подмены пользователей. Автор проверил все свои Docker‑изображения с помощью cosign, убедился в их подлинности, отозвал токены и усовершенствовал CI‑workflow, чтобы предотвратить будущие атаки.
Задача
A critical bug in Docker Hub’s IAM allowed personal access tokens to impersonate other users, risking unauthorized image pushes and pulls.
Результат
All 42 compose‑lint images verified to the correct CI run; no unauthorized changes detected. Tokens rotated and workflow hardened.
Рабочий процесс
- 1. Rotate compromised tokens and split permissions per job
- 2. Verify each image tag with cosign using a strict certificate‑identity regexp
- 3. Pull each tag’s last_pushed time from Docker Hub API and compare with release runs
- 4. Ensure no extra or missing tags exist
- 5. Update release workflow to check tag integrity before signing
- 6. Tighten CI verify step to use exact workflow identity
- 7. Add verification command to documentation
Доказательства
All 42 images verified, and every one traced back to the CI run that built it.
I could still verify everything, but it meant using a regexp that allowed both workflows instead of one exact identity.
The signature check only tells you what a tag points to today, though. Someone could point a tag at a bad image, wait for people to pull it, then point it back, and everything would still verify afterward.
- Дата записи: 2026-10-13T00:41:08.430Z