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-0218

UNSCORED

`Enum` trait allows type confusion when manually implemented

Mitigation

  • Upgrade enum-map to 3.1.0 or later.

Who should check

  • Projects that depend on crates.io package enum-map (>= 3.0.0-0.gat.0, < 3.1.0)

Vulnerability facts

Affected
enum-map >= 3.0.0-0.gat.0, < 3.1.0
Fixed in
3.1.0
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Unknown
CVSS
Not scored yet
Published
Modified

Description

Affected versions of this crate did not require the element type of the `Array` associated type in the `Enum` trait to match the array's generic parameter `V`. This can result in type confusion, and consequently memory corruption, when a manual `Enum` implementation declares an `Array<V>` whose elements are not actually of type `V`: ```rust struct IntentionallyWrong; impl Enum for IntentionallyWrong { type Array<V> = [String; 4]; fn from_usize(_: usize) -> Self { IntentionallyWrong } fn into_usize(self) -> usize { 0 } } enum_map! { IntentionallyWrong => 42 }; ``` The flaw was corrected in commit [7a8b815432](https://codeberg.org/sugar700/enum-map/commit/7a8b8154323d426415a10accf104cd05c394cda9) by adding a `Value = V` bound to the `Array` type in the `Enum` trait.

Affected and fixed versions

Package / productAffectedFixedSource
crates.io enum-map>= 3.0.0-0.gat.0, < 3.1.03.1.0osv

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-0218. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/RUSTSEC-2026-0218.md
Affected: enum-map >= 3.0.0-0.gat.0, < 3.1.0
Fixed in: 3.1.0

Steps:
1. Search this machine and project for enum-map (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-0218 being exploited?

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

How serious is RUSTSEC-2026-0218?

It has no CVSS score yet. Unknown.

Which versions are affected by RUSTSEC-2026-0218?

enum-map >= 3.0.0-0.gat.0, < 3.1.0.

Is there a fix for RUSTSEC-2026-0218?

Yes. Fixed in 3.1.0. Upgrade enum-map to 3.1.0 or later.

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

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