Skip to content

fix: log the plugin archive hash mismatches - #80

Merged
traefiker merged 1 commit into
traefik:masterfrom
mmatur:fix/download-hash-sync
Sep 14, 2026
Merged

traefiker merged 1 commit into
traefik:masterfrom
mmatur:fix/download-hash-sync

Conversation

@mmatur

@mmatur mmatur commented Aug 27, 2026

Copy link
Copy Markdown
Member

What

When the archive served by /download stops matching the hash recorded on the first download, /validate rejects it and Traefik disables all the plugins:

unable to check archive integrity of the plugin <module>: plugin integrity check failed

Nothing on the service side says so. /validate answers 404 without a word, and the only log about it, on /download, says Someone is trying to hack the archive, which is misleading: the client is honest, the archive it received simply is not the recorded one.

It happened on github.com/fosrl/badger, where every version from v1.6.0 on was served with a hash different from the recorded one. Archives are fetched from the Go proxy or from GitHub on each download, and they are not guaranteed to be byte-for-byte stable for a given version: the same content compressed differently is enough to change the sha256.

How

Both places now log the recorded hash and the one the client reports. Nothing else changes: /download keeps streaming the archive without hashing it, and the recorded hash stays immutable.

This only makes the drift visible. Fixing an affected version still requires recomputing its record.

Refs traefik/traefik#13771, traefik/piceus#156

@mmatur
mmatur force-pushed the fix/download-hash-sync branch from fa94486 to f6c7365 Compare August 27, 2026 14:27
@mmatur mmatur changed the title fix: keep the plugin hash in sync with the served archive fix: check the archive against the recorded hash before serving it Aug 27, 2026
@mmatur
mmatur force-pushed the fix/download-hash-sync branch from f6c7365 to 53de3f3 Compare August 27, 2026 14:37
@mmatur mmatur changed the title fix: check the archive against the recorded hash before serving it fix: log the plugin archive hash mismatches Aug 27, 2026
@mmatur
mmatur force-pushed the fix/download-hash-sync branch from 53de3f3 to 0cfa68e Compare August 27, 2026 14:39

@mloiseleur mloiseleur left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Non-blocking finding: unbounded client_hash on a public endpoint.
Header is unbounded (Go default MaxHeaderBytes = 1 MB), so it would be better to truncate it.

@mmatur
mmatur force-pushed the fix/download-hash-sync branch from 0cfa68e to 6d2ab3f Compare September 14, 2026 08:59
@traefiker
traefiker merged commit 1c088d8 into traefik:master Sep 14, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug/fix a bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants