# enum_map macro can cause UB when `Enum` trait is incorrectly implemented

Source: https://junglewise.ai/threats/enum-map-macro-can-cause-ub-when-enum-trait-is-incorrectly-implemented-f935a406  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2022-06-16  
License: CC BY 4.0 with a link back

Severity: info · Published 2022-06-16

enum_map macro can cause UB when `Enum` trait is incorrectly implemented

Technologies: [enum-map (crates.io)](https://junglewise.ai/threats/technologies/enum-map). Vendors: [crates.io](https://junglewise.ai/threats/vendors/crates-io).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Informational severity, published 16 June 2022.

**Which products and versions are affected?** enum-map (crates.io) SEMVER:introduced=2.0.0-2,fixed=2.0.2.

**Is there a fix for This vulnerability?** Yes. enum-map (crates.io): upgrade to 2.0.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected?** Check whether you run enum-map (crates.io) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- enum-map (crates.io): upgrade to 2.0.2 or later

  ```sh
  cargo update -p enum-map
  ```


## Affected products

- enum-map (crates.io) SEMVER:introduced=2.0.0-2,fixed=2.0.2

## Related threats

- [RUSTSEC-2026-0218 - `Enum` trait allows type confusion when manually implemented](https://junglewise.ai/threats/rustsec-2026-0218-enum-trait-allows-type-confusion-when-manually-8d3b9632)
- [RUSTSEC-2022-0010 - enum_map macro can cause UB when `Enum` trait is incorrectly implemented](https://junglewise.ai/threats/rustsec-2022-0010-enum-map-macro-can-cause-ub-when-enum-trait-is-0fc2354e)
