Skip to content
FlawDB
Sign in
Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

RUSTSEC-2026-0365

UNSCORED

Remote DoS through unchecked `IdList` allocation in negentropy

Mitigation

  • Upgrade negentropy to one of 0.4.4, 0.5.2 (or later in the same release line).

Who should check

  • Projects that depend on crates.io package negentropy (>= 0.2.0, < 0.4.4; >= 0.5.0, < 0.5.2)

Vulnerability facts

Affected
negentropy >= 0.2.0, < 0.4.4; >= 0.5.0, < 0.5.2
Fixed in
0.4.4, 0.5.2
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Unknown
CVSS
Not scored yet
Published
Modified

Description

## Summary The `negentropy` crate is vulnerable to denial-of-service through an unchecked, peer-controlled ID count in reconciliation messages. With the `std` feature enabled, which is the default configuration, a small malformed message can trigger an enormous memory allocation and terminate the application. ## Details When processing an `IdList` range, the reconciliation parser uses the peer-provided ID count to reserve memory before checking whether the message contains the corresponding IDs: ```rust let mut their_elems: HashSet<Id> = HashSet::with_capacity(num_ids as usize); ``` An attacker can declare an arbitrarily large count without supplying any IDs. The allocation occurs before the parser reaches the ID-reading loop, which would otherwise reject the truncated message. With Rust's default allocation-error behavior, a failed allocation aborts the process rather than unwinding. Consequently, `catch_unwind` cannot contain the failure. Both `reconcile` and `reconcile_with_ids` reach the vulnerable parser. The patched versions validate the count against the remaining message length before allocating: ```rust if num_ids > (query.len() / ID_SIZE) as u64 { return Err(Error::ParseEndsPrematurely); } ``` ## Impact An unauthenticated remote attacker can terminate an application that exposes reconciliation to untrusted peers without additional validation. For example, a Nostr relay that forwards `NEG-OPEN` or `NEG-MSG` reconciliation payloads to the vulnerable parser can be taken down by a single client message. Clients processing messages from malicious relays are also exposed. This specific vulnerability affects builds with the default `std` feature enabled. Builds without `std` use a `BTreeSet` and do not perform the vulnerable preallocation. A message-size limit alone does not prevent exploitation because the malicious payload can be only a few bytes long. ## Credit Discovered and fixed by **Alex Gleason** (<https://github.com/alexgleason>).

Affected and fixed versions

Package / productAffectedFixedSource
crates.io negentropy>= 0.2.0, < 0.4.4; >= 0.5.0, < 0.5.20.4.4, 0.5.2osv

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by RUSTSEC-2026-0365. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/RUSTSEC-2026-0365.md
Affected: negentropy >= 0.2.0, < 0.4.4; >= 0.5.0, < 0.5.2
Fixed in: 0.4.4, 0.5.2

Steps:
1. Search this machine and project for negentropy (crates.io): dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

References

FAQ

Is RUSTSEC-2026-0365 being exploited?

There is no confirmed exploitation: RUSTSEC-2026-0365 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known.

How serious is RUSTSEC-2026-0365?

It has no CVSS score yet. Unknown.

Which versions are affected by RUSTSEC-2026-0365?

negentropy >= 0.2.0, < 0.4.4; >= 0.5.0, < 0.5.2.

Is there a fix for RUSTSEC-2026-0365?

Yes. Fixed in 0.4.4, 0.5.2. Upgrade negentropy to one of 0.4.4, 0.5.2 (or later in the same release line).

How do I check if I'm affected by RUSTSEC-2026-0365?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

Sponsors