What’s Vulnerable › Vulnerabilities
CVE-2020-26235: Segmentation fault in Rust time crate
- Severity: medium (CVSS 5.3 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 2.0% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2020-11-24 · updated 2026-06-17
- Weakness: CWE-476
Description
In Rust time crate from version 0.2.7 and before version 0.2.23, unix-like operating systems may segfault due to dereferencing a dangling pointer in specific circumstances. This requires the user to set any environment variable in a different thread than the affected functions. The affected functions are time::UtcOffset::local_offset_at, time::UtcOffset::try_local_offset_at, time::UtcOffset::current_local_offset, time::UtcOffset::try_current_local_offset, time::OffsetDateTime::now_local and time::OffsetDateTime::try_now_local. Non-Unix targets are unaffected. This includes Windows and wasm. The issue was introduced in version 0.2.7 and fixed in version 0.2.23.
Affected products
- time-rs time: from 0.2.7 before 0.2.23 — fixed in 0.2.23
- Crates.Io Time: from 0.0.0-0 before 0.2.0; from 0.2.1-0 before 0.2.1; from 0.2.2-0 before 0.2.2; from 0.2.3-0 before 0.2.3; from 0.2.4-0 before 0.2.4; from 0.2.5-0 before 0.2.5 — fixed in 0.2.0, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.2.5
How to fix
Upgrade to a fixed version: time-rs time 0.2.23; Crates.Io Time 0.2.0, 0.2.1, 0.2.2, 0.2.3. Check the vendor advisory for mitigations.
References
- https://crates.io/crates/time/0.2.23
- https://github.com/time-rs/time/issues/293
- https://github.com/time-rs/time/security/advisories/GHSA-wcg3-cvx6-7396
- https://crates.io/crates/time/0.2.23
- https://github.com/time-rs/time/issues/293
- https://github.com/time-rs/time/security/advisories/GHSA-wcg3-cvx6-7396
Get alerted when CVE-2020-26235 or the next vulnerability affects your stack