Skip to main content
VulnerabilityPublished

unordered-containers leak elements between calls · FromList Functions

Affects unordered-containersSource GCVE Database

0
Severity
High

Rated High by Threat Radar's AI analysis

Patch
Available – fixed in 0.2.21.1

Data as of 30 Nov 2026, 14:19 UTC

What to do

Upgrade unordered-containers to 0.2.21.1.

Affected software

ProductAffectedFixed in
Hackageunordered-containersAffected
  • >=0.2.0.1 <0.2.21.1
Fixed in
  • 0.2.21.1

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

Upgrade unordered-containers to version 0.2.21.1 or later, where the issue is fixed by isolating map construction in the ST monad. Downgrading only helps for Data.HashSet.fromList and is not a recommended solution. If upgrading is not immediately possible, compiling without optimizations (-O0) or disabling full laziness (-fno-full-laziness) can avoid the issue, but these are temporary workarounds.

Description

The fromList functions in the Haskell unordered-containers library leak elements between calls when compiled with optimizations. This causes HashMap or HashSet instances built from lists to incorrectly include elements from previous calls, potentially mixing data across different uses. The issue affects versions from 0.2.0.1 up to but not including 0.2.21.1. The flaw is fixed in version 0.2.21.1 by changing the implementation to build maps in the ST monad, preventing shared state between calls.

References

Community reviews

Loading reviews…