Trivy v0.69.2 fails to scan python:3.12.13-slim with invalid tar header #10339
Replies: 7 comments 2 replies
-
|
Hi @akashkumar975 , I tried to reproduce your problem (locally and in Ubuntu images (amd64 and arm64)). Perhaps you have an example pipeline with the error? Can you also share docker info and try "--image-src registry` flag? Regards, Dmitriy |
Beta Was this translation helpful? Give feedback.
-
|
@DmitriyLewen I have the same issue with Linux based image for our application. Debug log and other details are provided in the other bug. Following are the steps from our azure devops pipeline. ` ` |
Beta Was this translation helpful? Give feedback.
-
|
I also tried to reproduce this locally but couldn't, same as @DmitriyLewen. A few questions:
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
@DmitriyLewen @knqyf263 Can we get the v0.56.2 version release added to check this issue? |
Beta Was this translation helpful? Give feedback.
-
|
Thank you! trying to build the version from the source for now. |
Beta Was this translation helpful? Give feedback.
-
|
@DmitriyLewen I tried to build v0.56.2 from source there also I see the same issue. On our Azure Agent pools we have noticed 2 changes with respect to Docker.
Suspecting the docker save step is saving the tar file in different format compared to earlier versions. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Trivy v0.69.2 fails to scan Docker images based on
python:3.12.13-slim(released March 4, 2026) witharchive/tar: invalid tar header. The same Dockerfile scans fine when usingpython:3.12.12-slim(released Feb 27, 2026).The image builds and runs perfectly with Docker — only Trivy's scanner fails.
What did you expect to happen?
Trivy should scan
python:3.12.13-slimsuccessfully, same as it does withpython:3.12.12-slim.What happened instead?
Reproduction Steps
Root Cause Analysis
We traced the error through Trivy source code:
pkg/fanal/walker/tar.gocallstar.NewReader(layer)thentr.Next()tr.Next()calls Go standard libraryarchive/tar->readHeader()->blk.getFormat()getFormat()fails checksum validation -> returnsFormatUnknownreadHeader()returnsErrHeader("archive/tar: invalid tar header")Layer Comparison
Both images use Debian Trixie. The base Debian layer (Layer 0) is identical. Only the Python-specific layers differ:
sha256:206356c424...(29.7 MB)sha256:206356c424...(29.7 MB) - Samesha256:a546a81ba9...(1,292,721 bytes)sha256:30dad65d3b...(1,292,722 bytes) - Changedsha256:90b93dccd5...(12,112,324 bytes)sha256:5d7ccc6599...(12,112,897 bytes) - Changedsha256:2d517a4d89...(248 bytes)sha256:b9aab63c29...(251 bytes) - ChangedWhat Changed in python:3.12.13
python:3.12-slimon March 4PYTHON_VERSIONchangedarchive/tarcannot parseTarget
Container Image
Scanner
Vulnerability
Output Format
Table
Mode
Standalone
Environment
python:3.12.13-slim(sha256:d6b046b27fe57002af7655dd6aa4ce3bc8a42a4621d7a5b4056a417e0d9952f5)python:3.12.12-slim(sha256:42f1689d6d6b906c7e829f9d9ec38491550344ac9adc01e464ff9a08df1ffb48)-v /var/run/docker.sock:/var/run/docker.sock)Impact
This blocks security scanning CI pipelines for any project using
python:3.12.13-slim(orpython:3.12-slimwhich now points to 3.12.13). The only workaround is to pin topython:3.12.12-slim. As more upstream images get rebuilt by Docker Hub, this issue will likely affect additional base images beyond Python.Beta Was this translation helpful? Give feedback.
All reactions