Intel

AIKIDO-2026-682008

enum-map is vulnerable to Type Confusion

Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Jul 30, 2026
July 30, 2026

10

CVE Score

Low

Type Confusion

Are you affected? Scan for Free

TL;DR

Affected versions of enum-map do not require the element type of the Array associated type in the Enum trait to match the array's generic parameter V. A manual Enum implementation can declare an Array<V> whose elements are not actually of type V, causing type confusion and memory corruption when the map is constructed (for example via enum_map!). Versions that use #[derive(Enum)] are not affected by a mistaken associated type. The fix adds a Value = V bound to the Array associated type so mismatched element types are rejected at compile time.

How do I fix this?

Upgrade the enum-map library to the patch version.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you manually implement the Enum trait with an incorrect Array associated type. Enums that use #[derive(Enum)] are not affected.

Package

Versions

3.0.0 - 3.0.0

Fixed in 3.1.0

Background info

enum-map is vulnerable to Type Confusion in versions 3.0.0 - 3.0.0.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea