Repository navigation
Update dependency dulwich to v1 [SECURITY] - #20
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
Author
|
renovate
Bot
force-pushed
the
renovate/pypi-dulwich-vulnerability
branch
from
October 9, 2026 22:14
2a4bbcc to
131cb54
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR body was truncated due to platform limits.
This PR contains the following updates:
==0.22.1→==1.2.9Dulwich has an arbitrary file write via NTFS-hostile tree entries on Windows
CVE-2026-42305 / GHSA-897w-fcg9-f6xj
More information
Details
Impact
Arbitrary file write leading to remote code execution when cloning or checking out a malicious Git repository on Windows.
Dulwich's path-element validator accepted tree entries whose filenames contained bytes that Windows interprets as structural path syntax:
executes that hook on the next git commit, giving the attacker arbitrary code execution in the victim's user context. The same primitive can be used with ..\outside.txt to escape the work tree.
1 was rejected; git2, git10, GIT1, etc. were all accepted.Contributing configuration bugs made matters worse. The core.protectNTFS and core.protectHFS settings were looked up under a wrong option name and so user-set values were silently ignored, and core.protectNTFS only defaulted to true on Windows (Git upstream has defaulted it to true everywhere since CVE-2019-1353). Both have been corrected.
Anyone who clones, fetches, or checks out an untrusted repository with Dulwich on Windows - either through the Dulwich CLI, porcelain.clone, or any downstream tool built on Dulwich - is impacted. POSIX clones are not directly exploitable (on POSIX \ is a literal filename byte), but a POSIX user can unknowingly propagate a malicious tree to Windows consumers via push or re-publication.
Patches
Fixed in Dulwich 1.2.5. Users should upgrade to 1.2.5 or later.
The fix lives in three commits:
Workarounds
There is no effective pre-patch workaround. On affected versions the core.protectNTFS configuration key was silently ignored, so setting it to true does not mitigate the issue. Users who cannot upgrade should avoid cloning, fetching, or checking out untrusted repositories with Dulwich on Windows. After upgrading the NTFS validator is on by default on every platform, so no additional configuration is required.
Resources
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:HReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Dulwich has unbounded memory allocation in receive-pack from crafted thin packs
CVE-2026-47734 / GHSA-xrvj-v92f-53gj
More information
Details
Impact
An uncontrolled-resource-consumption (memory exhaustion) denial-of-service vulnerability (CWE-400 / CWE-789).
A client with push access could push a tiny crafted thin pack (~174 bytes) whose delta header declares a huge dest_size. When dulwich ingested it via add_thin_pack / apply_delta, it would allocate hundreds of MB of memory based on that attacker-controlled size, with no relationship to the actual bytes received.
Who is impacted: Operators running a Dulwich-based Git server that exposes git-receive-pack (i.e. accepts pushes) -
for example via dulwich.server functionality, the HTTP smart server, or anything built on ReceivePackHandler.
Patches
Patched in 1.2.5.
add_thin_pack now accepts a max_input_size keyword (bytes; 0/None = unlimited, matching git's semantics), and ReceivePackHandler reads receive.maxInputSize from the repository config and passes it through. Wire reads are counted and a PackInputTooLarge exception is raised once the cap is exceeded - equivalent to git index-pack --max-input-size.
Users should upgrade to Dulwich 1.2.5 or later and set receive.maxInputSize in their server's repository config to a sane bound for their environment.
Workarounds
On unpatched versions, receive.maxInputSize has no effect, so it cannot be used as a workaround. Until upgrading, operators should:
Resources
Severity
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:HReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Dulwich: Infinite Loop Denial of Service (DoS) in Packfile Object Resolution
GHSA-35mr-4567-66vg
More information
Details
Affected file
dulwich/pack.py(Method:Pack.resolve_object)Description / Summary
A High-severity Denial of Service (DoS) vulnerability exists in the
Pack.resolve_objectmethod. When resolving anOFS_DELTAobject, the resolver calculates the base offset usingbase_offset = obj_offset - delta_offset.If a malicious packfile contains an
OFS_DELTAobject wheredelta_offsetis0, the calculationobj_offset - 0resolves back to the current object's own offset. Because the implementation lacks a depth counter, a "visited" set, or an explicit rejection ofdelta_offset == 0, the resolver enters an infinite recursive loop, exhausting CPU resources and eventually crashing the process.Vulnerable Code Breakdown (
dulwich/pack.py):Potential impact
An attacker can trigger this infinite loop via any operation that walks packfiles (e.g.,
dulwich clone,fetch,cat-file, or internalPack.__getitem__lookups).dulwich(web interfaces, CI/CD runners) will hang or crash, preventing legitimate repository access.gitC client explicitly guards against this:if (!base_offset) die("delta offset == 0 is invalid");.POC (Proof of Concept)
The following Python script generates a 44-byte packfile that triggers the loop:
Possible solution
Pack.resolve_objectto rejectdelta_offset == 0:MAX_DELTA_DEPTH = 50) to prevent long, non-looping chains of deltas (OFS or REF).Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:HReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Dulwich: Arbitrary File Write (RCE) on Windows via Unvalidated Drive Letters in Tree Paths
GHSA-8mcx-5rqc-vhmf
More information
Details
Affected files
dulwich/index.py(Methods:validate_path_element_ntfs,_tree_to_fs_path)dulwich/porcelain/__init__.py(Method:_checked_worktree_path)Description / Summary
A High-severity Path Traversal vulnerability exists in Dulwich's checkout logic when running on Windows. The functions responsible for validating NTFS paths strictly reject
.gitvariants, Alternate Data Streams (ADS),git~1short names, and reserved device names, but they completely fail to check for DOS drive letter prefixes.A malicious Git tree can contain an entry named
C:. When Dulwich processes this tree on a Windows client, the string passes thevalidate_path_element_ntfscheck. Later,_tree_to_fs_pathpasses this path toos.path.join(root, b"C:\\\\Users\\\\...").On Windows, if the second argument to
os.path.joincontains an absolute drive letter, therootpath is completely discarded. As a result, Dulwich writes the repository file to the absolute path outside of the intended Git worktree.While the standard C
gitclient explicitly blocks this viahas_dos_drive_prefix()inpath.c, Dulwich lacks this protection. Because Git trees are cross-platform, an attacker can author a malicious repository on Linux and wait for a Windows victim (or CI runner) to clone it.Potential impact
This vulnerability allows an attacker to achieve Arbitrary File Write, which can trivially be escalated to Remote Code Execution (RCE) or total system compromise on the victim's Windows machine.
Attack vectors include:
C:\\Users\\<victim>\\.gitconfigfile to setcore.sshCommandto an arbitrary executable, granting RCE the next time the user interacts with Git.C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\.C:\\Users\\<victim>\\.ssh\\authorized_keysto compromise remote servers accessible by the victim.Proof of Concept (PoC)
The following Python script (runnable on Linux) generates a malicious Git repository containing a payload that targets Windows clients.
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:HReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
dulwich/dulwich (dulwich)
v1.2.9Compare Source
Highlights of this release:
Security fixes
C:), whichos.path.joinwould otherwise treat as absolute and let a crafted tree write outside the work tree. (reported by Luke Baton)read_zlib_chunksnow caps the inflated size at the declareddecomp_len, and loose-object parsing acceptsmax_sizedefaulting to git'score.bigFileThreshold(512 MiB). (reported by Luke Bento)OFS_DELTApack entries whosedelta_base_offsetis zero. Such an entry references itself, soPack.resolve_objectwould loop forever growing its delta stack until OOM. (reported by Luke Banto)Transfer-Encoding: chunkedrequest bodies indulwich.web: strip chunk extensions, reject negative sizes, enforce per-chunk and per-request size limits, and cap requests that omitContent-Length..bitmapindex raisesValueErrorinstead of hanging in an unbounded loop that exhausts memory.Other changes
git-upload-pack/git-receive-packPOSTs whoseContent-Typeis not the exactapplication/x-<service>-requestvalue, matchinggit http-backend.dulwich.web: Warn at startup that runningpython3 -m dulwich.webis not intended as a production web server (no authentication, etc.).See NEWS for the full list.
v1.2.8Compare Source
Security
build_file_from_blobin path-restrictedporcelain.checkout(paths=...)instead of a rawos.open. The old path followed a symlink left at the target, so a crafted repository could write attacker content outside the work tree (e.g. into.git/hooks) oncheckout.filter-branch --index-filterin memory instead of materializing tree entries into CWD. Persisted entries between commits let a symlink from an ancestor commit redirect a descendant's writes outside the work tree.stash.pop. The oldos.path.existscheck followed symlinks, so a crafted stash whose parent path was a symlink already present in the worktree (e.g.link->.git/hooks) let the subsequent write land outside the work tree.porcelain.checkout,restoreandreset_filewrites whose leading directory is an existing symlink, so a crafted repository can no longer landsubas a link to.git/hooksand have a write tosub/anythingtraverse it.0o644/0o755beforechmodon checkout and patch apply, matching git. An untrusted tree entry or patch `new file mode` could otherwise set setuid/setgid/sticky or world-writable bits on a materialized file.int(sizestr, 16)accepted a leading-, whose negative length made the following `read(size - 4)` slurp the rest of the stream and caused `PktLineParser` to loop without consuming its buffer. (#2267)TCPGitClientbefore invoking thecore.gitProxycommand, matching theSubprocessSSHVendorguard, so a URL like `git://-oProxyCommand=...` can no longer be interpreted as a flag by the proxy program. (#2240)..cannot escape the LFS directory. (#2255)include/includeIfdirectives when parsing bundle lists served by an untrusted bundle-uri host, matching the handling of `.gitmodules`. (#2243)--status-fd(VALIDSIG) in `GPGCliSignatureVendor.verify` instead of the human-readable stderr text, which could be spoofed by embedding a matching line in the signed payload. (#2245)UntrustedSignaturefromverify_commit/verify_tagwhenkeyidsis set and the object carries no signature, instead of silently accepting it. (#2238)_find_scissors_lineso a crafted patch can no longer stallmailinfo/git am --scissors. (#2239)*wildcards to at most**in.gitattributes,.gitignoreand config glob translation to avoid catastrophic backtracking (ReDoS). (#2237)web.ChunkReader.read. (#2262)..,.git, etc.) in `diff_working_tree_to_tree` instead of joining them onto the work tree; a working-tree diff against an untrusted commit could otherwise read a file outside the work tree and disclose its contents. (#2261)ShaFile._parse_message. (#2273)Fixes
git-receive-packrequest body starts streaming. `generate_pack_data` previously ran lazily inside the body generator, after the header pkt-lines were already on the wire, so on large repositories the request stalled mid-body while objects were counted and servers such as GitHub aborted the push with a timeout / broken pipe. (#2248)build_file_from_blobinstead of writing through it, matching git on checkout. (#2259)GitProtocolErrorcarrying the server's message when the fetch/send-pack tail loop sees a fatal side-band channel (\x03), instead of crashing with `AssertionError: Invalid sideband channel 3` and swallowing the server's error text.ThreadingHTTPServerand advertise HTTP/1.1 inlfs_serverso urllib3's keep-alive pool doesn't race a torn-down connection intoRemoteDisconnected.Other
http.postBuffer. (#2248)dulwich.objects.filename_to_hex, which is unused.v1.2.7: 1.2.7Compare Source
Security
includedirectives when parsing.gitmodules, so a crafted.gitmodulesin a cloned repository can no longer makeclone --recurse-submodulesread arbitrary files.../../secretcan no longer read a file outside the ref store. Closes a traversal via git-upload-archive'sargumentand other lookup paths. (#2212)ChecksumMismatchotherwise. (#2223)New features
porcelain.request_pulland adulwich request-pullcommand, likegit request-pull. (#1823)porcelain.range_diffand adulwich range-diffcommand, likegit range-diff(requires thedulwich[range_diff]extra). (#1828)Fixes
apply_patchwriting index entries with mode0, which made native git abort. (#2218)gc/repackfixes on Windows (read-only pack files, leaked temporary packs, files-in-use).pack-names such asloose-<hash>(written bygit maintenance). (#2229)See NEWS for the full changelog.
v1.2.6Compare Source
v1.2.5: 1.2.5Compare Source
This is a security release. All users are encouraged to upgrade.
Security fixes
GHSA-gfhv-vqv2-4544 -- Validate submodule paths in
porcelain.submodule_update(and thusporcelain.clone(recurse_submodules=True)). A crafted upstream repository could carry a submodule whose path was.git/hooks(or any other path inside.gitor above the work tree), causing the submodule's tree contents to be written there with their executable bits intact. The dulwich analogue of git's CVE-2024-32002 / CVE-2024-32004. (Reported by tonghuaroot)CVE-2026-42305 -- Harden tree path validation against entry names that are harmless on POSIX but dangerous when checked out on Windows.
validate_path_element_ntfsnow also rejects Windows path separators, the alternate data stream marker:, NTFS 8.3 short-name aliases of.git, and reserved Windows device names.core.protectNTFSnow defaults to true on every platform, and bothcore.protectNTFSandcore.protectHFSare now read under their correct option names. (Reported by Christopher Toth)CVE-2026-42563 -- Shell-quote values substituted into
ProcessMergeDrivercommands. A malicious branch could inject shell commands when a merge driver referencing%Pwas configured. (Reported by Ravishanker Kusuma (hayageek))CVE-2026-47712 -- Sanitize commit subjects used in
porcelain.format_patchfilenames so a malicious subject (e.g.x/../../x) cannot direct the generated patch outsideoutdir. (Reported by Christopher Toth)receive.maxInputSize -- Honour
receive.maxInputSizeinReceivePackHandler. Previously a remote unauthenticated client could send a tiny crafted pack that declared a hugedest_sizeand trigger hundreds of MB of allocation overgit-receive-pack. (Reported by Liyi, Ziyue, Strick, Maurice and Chenchen @ University of Sydney)v1.2.4: 1.2.4Compare Source
What's Changed
Full Changelog: jelmer/dulwich@dulwich-1.2.3...dulwich-1.2.4
v1.2.3Compare Source
v1.2.2Compare Source
v1.2.1: 1.2.1Compare Source
Changes since 1.2.0
Derive the LFS endpoint as the remote's on-disk LFS store
(
<remote>/.git/lfsfor worktrees,<remote>/lfsfor bare repos)when
remote.origin.urlpoints at a local filesystem path orfile://URL, matching git-lfs behaviour. Previously the built-insmudge filter constructed an HTTP-style
<remote>.git/info/lfspaththat did not exist on disk, leaving LFS-tracked files as pointers
when cloning from a local repo.
Deduplicate objects when writing a multi-pack-index. Objects present
in multiple packs (e.g. after
git gccreates a cruft pack) wouldotherwise produce an OIDL chunk with repeated SHAs, causing
git multi-pack-index verifyto fail with "oid lookup out of order".(#2152)
Extend ignorecase and precomposeunicode support to index lookups.
(#1807)
v1.2.0: 1.2.0Compare Source
Notable changes since 1.1.0
New features
amcommand andporcelain.am()for applying mailbox-style email patches (git am), with state persistence for--continue,--skip,--abort, and--quitrecovery (#1692).applycommand andporcelain.apply_patch()for applying unified diffs, including rename/copy detection, binary patches with Git's base85 encoding, and--3waymerge fallback (#1784).logcommand options:--oneline,--abbrev-commit,--author,--committer,--grep,--since/--after,--until/--before,-n/--max-count,--no-merges,--merges,--stat,-p/--patch,--name-only, and--follow(#1779).-o/--push-option) inpush, enabling AGit flow and other server-side push option workflows.--all,--tags,--delete,--dry-run,--prune,--set-upstream,--follow-tags, and--mirror(#1844).--atomic): either all ref updates succeed or none are applied (#1781).extensions.relativeworktreesrepository extension, allowing worktrees to use relative paths (#2112).Configuration support
gc.pruneExpire— grace period before unreachable objects are pruned (#1859).core.precomposeunicode— normalize NFD Unicode paths from macOS filesystems to NFC (#1804).core.gitProxy— proxy command forgit://protocol connections (#1850).core.maxStat— limit stat operations when checking for unstaged changes (#1853).core.packedGitLimit— cap memory used for mmapped pack files, closing LRU packs when exceeded (#1848).core.deltaBaseCacheLimit— cap memory used for caching delta base objects; defaults to 96 MiB (#1849).http.userAgent— customize the User-Agent header (global and URL-specific); default isgit/dulwich/{version}.Fixes
BadSignaturefor all GPG errors, not justBadSignatures; also detect when GPG returns no signatures.unbornargument in Git protocol v2ls-refsrequests to servers that don't advertisels-refs=unborn, preventing clones from older servers like Gerrit 3.12.2 (#2104).read_info_refs()to show the actual line content when parsing fails (#2103)..gitignoreparent re-include handling so a later!dir/re-include allows a subsequent file-level negation to take effect (#2141, N0zoM1z0).contrib/paramiko_vendor.pyby loading known hosts and rejecting unknown SSH host keys by default (#2123, quart27219).Packaging
contrib/as part of the distribution. Thecontrib/directory has always been documented as unsupported and is now excluded from the installed package (#2122).v1.1.0: 1.1.0Compare Source
What's Changed
New Contributors
Full Changelog: jelmer/dulwich@dulwich-1.0.0...dulwich-1.1.0
v1.0.0: 1.0.0Compare Source
What's Changed
Full Changelog: jelmer/dulwich@dulwich-0.25.2...dulwich-1.0.0
v0.25.2: dulwich-0.25.1Compare Source
What's Changed
Full Changelog: jelmer/dulwich@dulwich-0.25.1...dulwich-0.25.2
v0.25.1Compare Source
Full Changelog: jelmer/dulwich@dulwich-0.25.0...dulwich-0.25.1
v0.25.0: v0.25.0Compare Source
What's Changed
porcelain.addcheck explicit forNoneby @ejfine in jelmer#2027New Contributors
Full Changelog: jelmer/dulwich@dulwich-0.24.10...dulwich-0.25.0
v0.24.10: 0.24.10Compare Source
Full Changelog: jelmer/dulwich@dulwich-0.24.9...dulwich-0.24.10
v0.24.9Compare Source
Fix passing key_filename and ssh_command parameters to SSHGitClient by @skshetry
Relax check to support subclasses of Urllib3HttpGitClient. Fixes
regression from 0.24.2 where subclasses of Urllib3HttpGitClient would
not receive the config object. by @skshetry
Fix test_concurrent_ref_operations_compatibility test flakiness by @jelmer
Fix warnings in test suite by @jelmer
Full Changelog: jelmer/dulwich@dulwich-0.24.8...dulwich-0.24.9
v0.24.8Compare Source
What's Changed
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.