Skip to content

archive: reject unsafe tree paths in tar_stream - #2185

Merged
jelmer merged 1 commit into
mainfrom
tar-harden
May 19, 2026
Merged

jelmer merged 1 commit into
mainfrom
tar-harden

Conversation

@jelmer

@jelmer jelmer commented May 19, 2026

Copy link
Copy Markdown
Owner

A malicious repository could contain tree entry names that git rejects as invalid (../evil, /absolute, .git/..., names embedding \ or :) but that dulwich.archive.tar_stream would emit verbatim as tar member names, unsafe for downstream extraction.

Reported by Christopher Toth.

A malicious repository could contain tree entry names that git rejects
as invalid (``../evil``, ``/absolute``, ``.git/...``, names embedding
``\`` or ``:``) but that ``dulwich.archive.tar_stream`` would emit
verbatim as tar member names, unsafe for downstream extraction.

Reported by Christopher Toth.
@jelmer
jelmer merged commit 6e85082 into main May 19, 2026
38 checks passed
@jelmer
jelmer deleted the tar-harden branch May 19, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant