Skip to content

Singleton lacks bounds on Send and Sync.

Moderate severity GitHub Reviewed Published Aug 25, 2021 to the GitHub Advisory Database • Updated Jan 9, 2023
Withdrawn This advisory was withdrawn on Aug 24, 2021

Package

cargo ruspiro-singleton (Rust)

Affected versions

< 0.4.1

Patched versions

0.4.1

Description

Singleton<T> is meant to be a static object that can be initialized lazily. In
order to satisfy the requirement that static items must implement Sync,
Singleton implemented both Sync and Send unconditionally.

This allows for a bug where non-Sync types such as Cell can be used in
singletons and cause data races in concurrent programs.

The flaw was corrected in commit b0d2bd20e by adding trait bounds, requiring
the contaiend type to implement Sync.

References

Reviewed Aug 6, 2021
Withdrawn Aug 24, 2021
Published to the GitHub Advisory Database Aug 25, 2021
Last updated Jan 9, 2023

Severity

Moderate

Weaknesses

CVE ID

No known CVE

GHSA ID

GHSA-vj88-5667-w56p
Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.