CVE-2026-58471: GNU Wget Heap Buffer Overflow in Filename Conversion
GNU Wget, a widely-used command-line download utility, contains a heap buffer overflow vulnerability in how it processes filenames from remote servers when character set conversion is needed. An attacker controlling a web or FTP server could craft a malicious filename that causes Wget to write beyond allocated memory boundaries, potentially crashing the application or corrupting memory. The vulnerability requires specific conditions: the filename must need character conversion, and user interaction is typically involved (such as accepting a download prompt). The issue was introduced in the filename conversion logic and has been patched in the project's main development branch.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 5.9 MEDIUM · CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:H
- Weaknesses (CWE)
- CWE-122
- Affected products
- 1 configuration(s)
- Published / Modified
- 2026-07-07 / 2026-07-09
NVD description (verbatim)
GNU Wget through 1.25.0, fixed in commit c2640fe, contains a heap buffer overflow vulnerability in the convert_fname() function within src/url.c that allows remote attackers to trigger memory corruption through a server-supplied filename requiring character set conversion. When the output buffer is too small during iconv E2BIG reallocation, the reallocation logic miscalculates the remaining space, leading to a heap buffer overflow that can be exploited via a maliciously crafted server response.
2 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The vulnerability exists in the convert_fname() function within src/url.c, which handles character set conversion for filenames using the iconv library. When iconv encounters an E2BIG error (output buffer too small), the code reallocates a larger buffer but miscalculates the remaining space for subsequent conversion operations. This arithmetic error allows iconv to write past the heap buffer's actual bounds. The flaw is triggered when a server supplies a filename that requires character set conversion and the initial buffer proves insufficient after reallocation. The vulnerability was resolved in commit c2640fe of the GNU Wget repository.
Business impact
For organizations relying on Wget for automated downloads, backups, or build pipelines, this vulnerability could disrupt operations if exploited against trusted internal servers or if users are social-engineered into downloading from attacker-controlled hosts. The memory corruption could lead to Wget crashing mid-transfer, causing incomplete downloads and potential data loss. In automated scenarios without user supervision, silent memory corruption is theoretically possible, though the requirement for filename-based triggers limits blast radius compared to network-level exploits. Organizations with Wget in air-gapped or restricted environments face lower risk, while those with end-users using Wget directly should prioritize patching.
Affected systems
GNU Wget versions through 1.25.0 are affected. The vulnerability is present in all builds that include the vulnerable convert_fname() function. Systems using Wget as a dependency in scripts, package managers, or download automation are in scope. Notably, this includes many Linux distributions that bundle Wget as a standard utility, embedded systems using Wget for updates, and CI/CD pipelines that rely on Wget for artifact retrieval. Custom builds or downstream distributions that have backported a fix to an older version would not be vulnerable; verify the specific commit history of your deployed version.
Exploitability
The attack requires an attacker to control or compromise a web/FTP server that a Wget user connects to, or to perform a man-in-the-middle attack on an unencrypted connection. The attacker then crafts a filename that triggers character set conversion and buffer reallocation. User interaction is required—someone must initiate the download or the automation must be configured to connect to the attacker's server. These constraints place exploitability in the 'difficult' category; this is not a wormable or network-propagating flaw. The CVSS vector (AC:H) reflects the requirement for specific environmental conditions. Exploitation is feasible for targeted attacks against high-value targets or for triggering denial-of-service in batch download scenarios, but mass exploitation is unlikely.
Remediation
Apply the fix from GNU Wget's main development branch (commit c2640fe or later). For distribution packages, wait for your OS vendor to release an updated Wget version and apply it via standard package management. If you maintain custom Wget builds, cherry-pick the relevant patch or upgrade to the next stable release once available. In the interim, consider restricting Wget downloads to trusted, internal servers, enforcing HTTPS with certificate pinning where possible to reduce man-in-the-middle risk, and disabling automatic filename conversion if your use case permits. For automated systems, implement integrity checks on downloaded files to detect corruption.
Patch guidance
Monitor GNU Wget's official release channels (https://savannah.gnu.org/projects/wget/) for the next stable release incorporating commit c2640fe. Distributors such as Debian, Ubuntu, Red Hat, and Alpine will release patched versions through their respective repositories. Once available, apply updates via your standard patch management process. Verify the patch by checking that your deployed Wget version matches or exceeds the patched commit. For users compiling from source, fetch the latest code from the official repository and rebuild. Testing the patch in a staging environment with files requiring character conversion is advisable to confirm the fix.
Detection guidance
Monitor system logs and application output for Wget crashes, segmentation faults, or unexpected terminations, particularly when downloading files with non-ASCII characters in filenames or when connecting to unusual servers. Network detection is difficult without visibility into server responses; focus on endpoint telemetry. Check your Wget version using `wget --version` and cross-reference against known affected versions. In centralized logging, search for error messages related to iconv or memory allocation failures emanating from Wget processes. If you maintain a file integrity monitoring system, look for unexpected heap corruption signatures in process crash dumps. Implement alerting on any Wget process terminating with a segmentation fault.
Why prioritize this
This vulnerability warrants prioritization in patching cycles because Wget is pervasive across Linux infrastructure, particularly in automation and packaging scenarios where unattended downloads occur. The CVSS score of 5.9 (MEDIUM) reflects the requirement for user interaction and difficult exploitation conditions, but the combination of memory corruption and automation risk argues for faster-than-typical MEDIUM-severity patching. Organizations with Wget integrated into CI/CD, package managers, or mirror systems should patch within their standard critical-update window. Those using Wget only for ad-hoc manual downloads can follow a more relaxed timeline, though patching within 30 days remains prudent.
Risk score, explained
The CVSS 3.1 score of 5.9 is driven by a network attack vector (AV:N), high complexity (AC:H due to the need for specific filename conditions and user interaction), no privilege escalation, no confidentiality impact (C:N), limited integrity impact (I:L—file corruption, not system compromise), and high availability impact (A:H—process crash). The AC:H and UI:R components significantly reduce severity despite the network attack surface. This is neither a critical remote code execution nor a trivial local issue; it sits squarely in the medium range for severity but requires active monitoring and timely patching to avoid operational disruption.
Frequently asked questions
Can this vulnerability be exploited without the user downloading from a malicious server?
Exploitation requires an attacker-controlled or compromised server that a Wget user connects to, or a successful man-in-the-middle attack on an unencrypted connection. An attacker cannot exploit this vulnerability by simply sending a malicious filename to a user; the download must actually be initiated from the attacker's host. This is a significant limiting factor compared to remote code execution vulnerabilities.
Will my Wget installation automatically be patched by my Linux distribution?
That depends on your distribution's maintenance cycle and the urgency they assign to this issue. Major distributions like Debian, Ubuntu, and Red Hat typically release security updates within 7-30 days of a vendor fix. Check your distribution's security advisory pages or subscribe to their security mailing lists. You can also manually check for updates using your package manager (`apt update && apt upgrade` for Debian/Ubuntu, `yum check-update` for RHEL/CentOS, etc.).
What's the difference between this vulnerability and a typical buffer overflow?
This is a heap buffer overflow rather than a stack-based one, and it's triggered specifically by the character set conversion logic when reallocating buffers. The vulnerable code miscalculates how much space remains after reallocation, causing subsequent writes to overflow. Heap overflows are typically harder to exploit for code execution but can corrupt heap metadata and cause denial of service. In this case, the impact is primarily availability (crash) and potential data corruption.
Should I disable character set conversion in Wget to mitigate this issue?
Disabling conversion is not a practical mitigation because the vulnerability is in the reallocation logic, not the conversion itself, and Wget's command-line interface provides limited control over this behavior. The proper fix is to apply the patch. If you absolutely cannot patch immediately, the best interim measures are restricting downloads to trusted servers and enforcing HTTPS with certificate verification.
This analysis is provided for informational purposes and reflects the details available as of the publication date. Exploit code and proof-of-concept demonstrations are not included in this advisory. Organizations should verify patch availability and applicability to their specific deployments with their vendors and distribution maintainers. SEC.co makes no guarantee regarding the accuracy, completeness, or timeliness of vulnerability information and recommends consulting official vendor advisories for definitive guidance. Risk assessment and remediation prioritization should account for your organization's specific infrastructure, threat landscape, and business objectives. Source: NVD (public-domain), retrieved 2026-08-16. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2025-15666MEDIUMAssimp Heap Buffer Overflow in Model File Handler
- CVE-2025-55645MEDIUMHeap Buffer Overflow in GPAC MP4Box v2.4 – DoS Vulnerability
- CVE-2025-55648MEDIUMGPAC MP4Box Heap Buffer Overflow DoS Vulnerability
- CVE-2025-55652MEDIUMHeap Buffer Overflow in GPAC MP4Box v2.4 – DoS Vulnerability
- CVE-2025-55661MEDIUMGPAC MP4Box v2.4 Opus Parser Heap Buffer Overflow
- CVE-2025-55664MEDIUMGPAC MP4Box Heap Buffer Overflow DoS Vulnerability
- CVE-2025-60468MEDIUMGPAC MP4Box Heap Use-After-Free Denial of Service
- CVE-2026-10194MEDIUMOFFIS DCMTK Heap Buffer Overflow in Query/Retrieve Service