VYPR
Moderate severityNVD Advisory· Published Nov 24, 2020· Updated Aug 4, 2024

Segmentation fault in Rust time crate

CVE-2020-26235

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.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

A dangling pointer in Rust's time crate (0.2.7–0.2.22) causes segfaults on Unix when an environment variable is set in another thread.

Vulnerability

The Rust time crate versions 0.2.7 through 0.2.22 contain a memory safety bug that can lead to a segfault on Unix-like operating systems. The issue arises from dereferencing a dangling pointer when the affected functions — 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 — are called. Internally, these functions access environment variables, and if an environment variable is set by a different thread concurrently, the internal pointer may become invalid [1][2].

Exploitation

Exploitation requires the attacker or a third-party library to set any environment variable in a thread separate from the one calling an affected function. No special privileges or user interaction are needed beyond the presence of multi-threaded execution. The attack vector is local, meaning the attacker must already have code execution capability within the process [2][3]. Non-Unix targets, including Windows and WebAssembly, are unaffected because they do not implement the same internal mechanism [3].

Impact

Successful exploitation results in a segfault, causing a denial of service (availability impact). There is no confidentiality or integrity impact. The CVSS v3.1 score is 6.2 (Medium) with vector AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H [2].

Mitigation

The vulnerability is fixed in time version 0.2.23 and later. Users of time 0.1 must upgrade to 0.2.23 or the 0.3 series, as no patch exists for 0.1. The recommended action is to run cargo update to pull in the patched version. A workaround is to ensure that only one thread runs when calling the affected functions and that no other thread modifies environment variables concurrently [3].

AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
timecrates.io
>= 0.1.0, < 0.2.230.2.23
timecrates.io
>= 0.2.7, < 0.2.230.2.23

Affected products

14

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

6

News mentions

0

No linked articles in our index yet.