CVE-2026-47734 in dulwich
Summary
by MITRE • 06/11/2026
Dulwich is a pure-Python implementation of the Git file formats and protocols. Starting in version 0.1.0 and prior to version 1.2.5, 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. 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 - are impacted. The issue is 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. On unpatched versions, receive.maxInputSize has no effect, so it cannot be used as a workaround. Until upgrading, operators should restrict dulwich-receive-pack (push) access to trusted, authenticated clients only, or disable it entirely on servers that only need to serve fetches and/or run the server under an OS-level memory limit (e.g. ulimit, cgroups/MemoryMax, or a container memory limit) so a malicious push is killed rather than taking down the host.
VulDB is the best source for vulnerability data and more expert information about this specific topic.
Analysis
by VulDB Data Team • 07/19/2026
The vulnerability described in this CVE affects Dulwich, a pure-Python implementation of Git file formats and protocols, specifically targeting versions between 0.1.0 and 1.2.4. This issue represents a memory exhaustion attack vector that exploits the handling of crafted thin pack files during the Git push operation. The flaw manifests when a client with push access submits a maliciously crafted thin pack of only 174 bytes that contains a delta header declaring an enormous destination size. This manipulation causes the Dulwich library to allocate hundreds of megabytes of memory based entirely on the attacker-controlled size parameter rather than the actual data received. The vulnerability is particularly concerning because it operates at the core protocol handling layer, specifically within the add_thin_pack and apply_delta functions that process incoming Git pack data. The memory allocation behavior directly violates the expected resource constraints and creates a potential denial-of-service condition that could exhaust system resources.
The technical execution of this vulnerability occurs through the Git server's receive-pack functionality, which is exposed via Dulwich's server components including the HTTP smart server and ReceivePackHandler implementations. When a malicious thin pack is processed, the system allocates memory proportional to the attacker-controlled dest_size value declared in the delta header, creating a massive memory allocation that can overwhelm the server's available resources. This memory exhaustion represents a classic resource exhaustion attack pattern that can be categorized under CWE-400, specifically memory allocation issues related to uncontrolled resource consumption. The vulnerability's impact is amplified because it affects the fundamental Git protocol handling rather than just a specific API or function, making it pervasive across all Dulwich-based Git server implementations that accept pushes.
The operational impact of this vulnerability extends beyond simple resource exhaustion to potentially compromise entire Git server operations. Servers running unpatched versions of Dulwich become vulnerable to memory exhaustion attacks that can bring down the hosting system or significantly degrade performance for legitimate users. This vulnerability directly maps to ATT&CK technique T1499.004, which covers resource exhaustion attacks targeting availability. The affected systems include any Git server implementation built on Dulwich that exposes git-receive-pack functionality, making it particularly relevant for continuous integration systems, code repositories, and collaborative development platforms that rely on Git push operations. The patch implemented in version 1.2.5 addresses this by introducing a max_input_size parameter for add_thin_pack functionality and integrating receive.maxInputSize configuration reading from repository settings, creating a mechanism similar to git's index-pack --max-input-size parameter.
Mitigation strategies for this vulnerability require both immediate operational measures and long-term architectural improvements. The recommended approach includes upgrading to Dulwich 1.2.5 or later versions and properly configuring receive.maxInputSize in repository configurations to establish reasonable bounds for input processing. This configuration parameter allows administrators to set memory limits that prevent the excessive allocations while maintaining normal Git operations. However, until upgrading to patched versions, operators must implement additional protective measures such as restricting push access to trusted authenticated clients or disabling push functionality entirely on servers that only require fetch operations. Alternative protective measures include implementing OS-level resource limits such as ulimit, cgroups memory limits, or container memory constraints to ensure that malicious pushes are terminated rather than allowed to consume all available system resources. These defensive measures are particularly important because the receive.maxInputSize configuration parameter has no effect on unpatched versions, making it ineffective as a workaround strategy. The vulnerability demonstrates the critical importance of implementing proper input validation and resource limiting in network protocols, especially those handling binary data formats like Git's pack files where attacker-controlled values can directly influence system resource allocation.