Vulnerability DatabaseRUSTSEC-2021-0031

RUSTSEC-2021-0031
Rust vulnerability analysis and mitigation

Overview

The nano_arena crate before version 0.5.2 contains a vulnerability related to aliasing violations in the split_at function. The issue was discovered on March 1, 2021, where the function could create two mutable references to the same element if the Borrow trait implementation behaves in certain ways (RUSTSEC Advisory).

Technical details

The vulnerability stems from the split_at function calling selected.borrow() twice - once to select a value from the arena and again to create the split. Since the Borrow trait is not required to return the same value on subsequent calls, this can lead to the creation of multiple mutable references to the same object, violating Rust's aliasing rules. The issue manifests when a custom implementation of the Borrow trait returns different indexes on consecutive calls (GitHub Issue).

Impact

When exploited, this vulnerability can result in undefined behavior through the creation of multiple mutable references to the same memory location. This can potentially lead to memory corruption, use-after-free conditions, or out-of-bounds writes in unsafe code (RUSTSEC Advisory).

Exploitability

The vulnerability can be triggered by implementing the Borrow trait in a way that returns different indexes on consecutive calls. A proof-of-concept exploit demonstrates the creation of two mutable references to the same memory location, which violates Rust's memory safety guarantees (GitHub Issue).

Mitigation and workarounds

The issue has been fixed in version 0.5.2 of the nano_arena crate. Users are advised to upgrade to this version or later to resolve the vulnerability. If upgrading is not immediately possible, users should ensure their Borrow implementations consistently return the same index (RUSTSEC Advisory).

Additional resources


SourceThis report was generated using AI

Related Rust vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-24890MEDIUM6.8
  • Rust logoRust
  • igvm
NoYesSep 14, 2026
CVE-2026-55093MEDIUM6.1
  • Rust logoRust
  • tract-nnef
NoYesSep 14, 2026
CVE-2026-55832MEDIUM6.1
  • Rust logoRust
  • tract-onnx
NoYesSep 14, 2026
CVE-2026-54542LOW3.7
  • Rust logoRust
  • nimiq-primitives
NoYesSep 14, 2026
CVE-2026-54541LOW3.7
  • Rust logoRust
  • nimiq-primitives
NoYesSep 14, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management