HistoryEdit

RUSTSEC-2019-0017

Panic during initialization of Lazy might trigger undefined behavior

Issued
Package
once_cell (crates.io)
Type
Vulnerability
Keywords
#undefined_behavior
Aliases
Details
https://github.com/matklad/once_cell/issues/46
CVSS Score
7.5 HIGH
CVSS Details
Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Patched
  • >=1.0.1
Unaffected
  • <0.2.5
Keywords
#undefined_behavior
Affected Functions
Version
once_cell::sync::Lazy::deref
  • <1.0.1, >=0.2.5
once_cell::sync::Lazy::force
  • <1.0.1, >=0.2.5
once_cell::unsync::Lazy::deref
  • <1.0.1, >=0.2.5
once_cell::unsync::Lazy::force
  • <1.0.1, >=0.2.5

Description

If during the first dereference of Lazy the initialization function panics, subsequent dereferences will execute std::hints::unreachable_unchecked.

Applications with panic = "abort" are not affected, as there will be no subsequent dereferences.