VulnerabilityRUSTSEC-2020-0159 · chrono
RUSTSEC-2020-0159: Potential segfault in `localtime_r` invocations
Short answerA security vulnerability in the chrono crate: Potential segfault in `localtime_r` invocations. No severity score was published. Fixed in 0.4.20: update to a fixed version.
| Crate | chrono |
|---|---|
| Type | Vulnerability (code-execution, memory-corruption) |
| Affected versions | Before 0.4.20. |
| Fixed in | 0.4.20 |
| Severity | not scored |
| Published | 2020-11-10 |
| Last changed | 2026-02-04 |
| Also known as | none |
What to do
- See which version you have:
cargo tree -i chrono(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p chrono. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for examplechrono = "0.4.20") or update the dependency that pulls it in. - Check again with
cargo audit, or paste your Cargo.lock into our Cargo.toml checker.
Details from the advisory
Impact
Unix-like operating systems may segfault due to dereferencing a dangling pointer in specific circumstances. This requires an environment variable to be set in a different thread than the affected functions. This may occur without the user's knowledge, notably in a third-party library.
Workarounds
No workarounds are known.
References
References
- Package: crates.io/crates/chrono
- Advisory: rustsec.org/advisories/RUSTSEC-2020-0159.html
- Report: github.com/chronotope/chrono/issues/499
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Up next
Same cratechrono: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →Did this answer your question?