Oct 1, 2026·5 min read·15 visits
Unvalidated 32-bit response length fields in the pageant crate allow a local process to cause an out-of-memory crash or perform out-of-bounds reads against russh-based clients.
A critical memory handling vulnerability exists in the pageant crate, a workspace component of the Rust-based russh SSH client library, during communication with the PuTTY Pageant SSH agent on Windows systems. Prior to version 0.2.3, the library's shared memory parsing logic blindly trusted a peer-controlled, 32-bit big-endian response length field. This allows local attackers running within the same user session to trigger out-of-bounds reads or execute an out-of-memory crash of the client application.
The pageant crate functions as a workspace utility inside the russh SSH client library, facilitating communications with the PuTTY Pageant SSH agent on Windows systems.
This communication depends on local Inter-Process Communication (IPC) involving Windows Messaging (WM_COPYDATA) and Shared Memory Map Views. The client establishes a shared file mapping with a static capacity constraint of 8,192 bytes (8 KiB) and passes this file name to the Pageant agent, which then writes responses directly to the shared space.
The vulnerability is located in the MemoryMap::read parser within the pageant/src/wmmessage.rs file. By failing to validate the boundaries of incoming messages, the parser exposes the client program's runtime memory to crashes or local information leaks. This flaw represents a severe design oversight when handling boundaries inside shared memory mappings.
The root cause of the vulnerability lies in the implementation of the MemoryMap::read stream reader and its interaction with the query_pageant_direct handler. When reading raw responses, the client first reads a 4-byte length prefix directly from the shared memory view, parsing it as a big-endian u32 value assigned to the variable size.
Because the peer process (which can be impersonated by any standard user process on the same desktop environment) fully controls this shared memory view, the size variable can be manipulated to contain arbitrary values. The library then executes MemoryMap::read(size) without validating whether the requested index range (self.pos + size) exceeds the physical size of the memory map (self.length), which is typically bounded at 8,192 bytes.
This lack of validation triggers two primary failure modes: first, an Out-of-Memory (OOM) abort via CWE-789 due to an excessive vector allocation size request; and second, an Out-of-Bounds Read (CWE-125) during the execution of std::ptr::copy_nonoverlapping inside an unsafe block. If the copy operation points to adjacent unmapped system space, the OS terminates the process with an access violation.
The sequence of IPC messaging and the interception point where a malicious local process triggers the crash are represented in the flowchart below.
This architecture highlights that the security of this local communication depends entirely on verifying boundary limits during the parsing phase, since the Windows Messaging API does not inherently isolate client-to-agent channel registrations within standard interactive sessions.
An inspection of the vulnerable source code confirms that raw pointer operations were executed without bounds checking.
Below is the vulnerable implementation of the reader function:
// VULNERABLE: Prior to pageant version 0.2.3
impl MemoryMap {
fn read(&mut self, n: usize) -> Vec<u8> {
let out = vec![0; n]; // CWE-789: Excessive memory allocation if 'n' is massive
unsafe {
std::ptr::copy_nonoverlapping(
self.ptr.add(self.pos),
out.as_ptr() as *mut u8,
n, // CWE-125: Out-of-bounds pointer copy if 'self.pos + n' > self.length
);
}
self.pos += n;
out
}
}To address this vulnerability, the maintainers refactored the function's signature and introduced boundary validation checks:
// PATCHED: pageant version 0.2.3
impl MemoryMap {
fn read(&mut self, n: usize) -> Result<Vec<u8>, Error> {
// Validate bounds and prevent integer overflow using checked_add
if self.pos.checked_add(n).is_none_or(|end| end > self.length) {
return Err(Error::Overflow);
}
let out = vec![0; n];
unsafe {
std::ptr::copy_nonoverlapping(
self.ptr.add(self.pos),
out.as_ptr() as *mut u8,
n,
);
}
self.pos += n;
Ok(out)
}
}This patch adds robust boundary checking. Using checked_add prevents integer wrapping attacks when calculating memory offsets, and checking end > self.length prevents reads from exceeding the size of the 8,192-byte file mapping. These modifications ensure that memory is only allocated if the request falls within the active map boundaries.
Exploiting this flaw requires local code execution within the victim's Windows session. This scenario is common in shared development server environments or terminal environments containing multi-user services.
An attacker can register a window class matching the standard name of the legitimate PuTTY Pageant program (Pageant). If the genuine Pageant agent is not running, the victim client's call to connect_pageant will target the malicious window handle. When the client transmits a request and waits for an answer, the attacker-controlled window receives the notification, writes a payload containing 0xFFFFFFFF into the first four bytes of the shared mapping, and signals the client to resume.
Upon parsing this length, the client allocates a 4 GiB buffer. Because standard 32-bit and some 64-bit user processes lack the memory allocation headroom for an immediate block allocation of this scale, the memory manager aborts the program. If the attacker specifies a size exceeding the remaining unread buffer but within system allocation limits, the copy_nonoverlapping function reads adjacent heap memory, exposing potential secrets if the application subsequently processes, logs, or transmits this data.
The CVSS vector is rated as CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H, yielding a severity score of 6.2.
The attack vector is local (AV:L) because triggering the condition requires interacting with local Windows API messaging loops. Attack complexity is low (AC:L) because standard programmatic window registration and shared memory access do not require advanced administrative rights on Windows systems.
While the official classification rates Confidentiality Impact as None (C:N), the presence of an out-of-bounds pointer copy operation means that adjacent heap contents could be copied into the output vector. Depending on how the client application processes error buffers, this could lead to the exposure of other private SSH keys or session structures.
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
pageant Eugeny | < 0.2.3 | 0.2.3 |
russh Eugeny | >= 0.58.0, < 0.63.2 | 0.63.2 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-125, CWE-789 |
| Attack Vector | Local |
| CVSS v3.1 Score | 6.2 (Medium) |
| EPSS Score | 0.00129 (0.129% probability) |
| Impact | Denial of Service (DoS) and potential Information Disclosure |
| Exploit Status | poc |
| KEV Status | Not Listed |
The software reads data past the end, or before the beginning, of the intended buffer, or allocates memory with an excessive size value.
CVE-2026-126300 (GHSA-ffr9-mgrr-wcvr) is an inefficient algorithmic complexity vulnerability (CWE-407) in the Natural Language Toolkit (NLTK) Python library affecting versions 3.2.5 prior to 3.10.4. The flaw resides in the quote-restoration routine of TreebankWordTokenizer.span_tokenize and NLTKWordTokenizer.span_tokenize, where repeated calls to list.pop(0) over matched quote tokens introduce quadratic O(n^2) time complexity. An unauthenticated remote attacker who supplies input containing long sequences of double-quote characters can exhaust CPU resources and degrade service availability.
The Natural Language Toolkit (NLTK) versions 3.6 through 3.10.3 contain an algorithmic complexity vulnerability in the LegalitySyllableTokenizer.tokenize method. When processing tokens composed of continuous runs of vowels, an unguarded string reversal and set membership lookup loop executes in quadratic time relative to the input token length. Remote attackers capable of submitting arbitrary text to applications utilizing this tokenizer can trigger sustained single-core CPU exhaustion and application-level denial of service.
CVE-2026-126304 is a symlink path traversal vulnerability (CWE-59) in the Natural Language Toolkit (NLTK) versions 3.10.0 prior to 3.10.4. The YCOECorpusReader class constructs internal sub-readers for the 'psd' and 'pos' subdirectories using FileSystemPathPointer.join(), which relies exclusively on lexical string-prefix validation rather than canonical path resolution. An attacker who supplies a crafted YCOE corpus containing symbolic links in place of the 'psd' or 'pos' subdirectories can bypass directory confinement and read arbitrary files from sibling corpora or sensitive directories within the NLTK data sandbox.
CVE-2026-128077 (GHSA-r99w-jh2x-3mg9) is an authorization bypass and interpretation conflict vulnerability affecting Nuxt and its underlying @nuxt/nitro-server package in versions 4.6.0 through 4.6.3. When an incoming HTTP request path begins with a double forward slash (e.g., //x/admin), the WHATWG URL parser within the Nuxt server-side page renderer interprets the initial segment as a network host/authority and resolves the remaining path (/admin) against the application's page router. Because Nitro server middleware, route-scoped serverHandlers, and Nitro routeRules evaluate the unparsed request path (//x/admin), path-based access controls, redirects, and security header policies configured for /admin fail to match and are bypassed.
Prior to version 2.10.2, the sqlite3-ruby gem explicitly cast 64-bit Ruby string lengths (long) to 32-bit signed integers (int) when invoking the underlying SQLite C API. On 64-bit platforms, providing a string of 4 GiB (2^32 bytes) or larger causes integer truncation, instructing SQLite to process only a prefix of the string. This flaw affects SQL query preparation, bound parameter values, and return values from custom Ruby-defined SQL functions and aggregates, allowing trailing SQL clauses such as WHERE restrictions to be silently dropped under specific conditions.
CVE-2026-128068 (GHSA-cpgf-5mjf-73p7) is a Regular Expression Denial of Service (ReDoS) vulnerability in the rails-html-sanitizer Ruby gem affecting versions 1.0.3 through 1.7.1. The flaw resides in the Rails::HTML::PermitScrubber#scrub_attribute method, which uses the multiline regular expression /^\s*[^#\s].*/m to enforce local-only URI fragment references on SVG elements. On Ruby runtimes prior to version 3.2 (CRuby <= 3.1 and JRuby), evaluating an attribute value composed of repeated newline and whitespace characters without a hash character triggers quadratic backtracking O(n^2). Applications are only vulnerable if their sanitization allowlist is explicitly configured to permit SVG reference elements such as <use> alongside href or xlink:href attributes.