{"id":"CVE-2020-26235","aliases":["CVE-2020-26235","GHSA-wcg3-cvx6-7396","RUSTSEC-2020-0071"],"related":["RUSTSEC-2020-0159"],"kind":"vulnerability","state":"published","title":"Segmentation fault in Rust time crate","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nUnix-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.\n\nThe affected functions from time 0.2.7 through 0.2.22 are:\n\n- `time::UtcOffset::local_offset_at`\n- `time::UtcOffset::try_local_offset_at`\n- `time::UtcOffset::current_local_offset`\n- `time::UtcOffset::try_current_local_offset`\n- `time::OffsetDateTime::now_local`\n- `time::OffsetDateTime::try_now_local`\n\nThe affected functions in time 0.1 (all versions) are:\n\n- `at`\n- `at_utc`\n- `now`\n\nNon-Unix targets (including Windows and wasm) are unaffected.\n\n### Patches\n\nIn some versions of `time`, the internal method that determines the local offset has been modified to always return `None` on the affected operating systems. This has the effect of returning an `Err` on the `try_*` methods and `UTC` on the non-`try_*` methods. In later versions, `time` will attempt to determine the number of threads running in the process. If the process is single-threaded, the call will proceed as its safety invariant is upheld.\n\nUsers and library authors with time in their dependency tree must perform `cargo update`, which will pull in the updated, unaffected code.\n\nUsers of time 0.1 do not have a patch and must upgrade to an unaffected version: time 0.2.23 or greater or the 0.3 series.\n\n### Workarounds\n\nLibrary authors must ensure that the program only has one running thread at the time of calling any affected method. Binary authors may do the same and/or ensure that no other thread is actively mutating the environment.\n\n### References\n\n[time-rs/time#293](https://github.com/time-rs/time/issues/293).","format":"markdown","source":"ghsa"},{"lang":"en","text":"### Impact\n\nThe affected functions set environment variables without synchronization. On Unix-like operating systems, this can crash in multithreaded programs. Programs may segfault due to dereferencing a dangling pointer if an environment variable is read in a different thread than the affected functions. This may occur without the user's knowledge, notably in the Rust standard library or third-party libraries.\n\nThe affected functions from time 0.2.7 through 0.2.22 are:\n\n- `time::UtcOffset::local_offset_at`\n- `time::UtcOffset::try_local_offset_at`\n- `time::UtcOffset::current_local_offset`\n- `time::UtcOffset::try_current_local_offset`\n- `time::OffsetDateTime::now_local`\n- `time::OffsetDateTime::try_now_local`\n\nThe affected functions in time 0.1 (all versions) are:\n\n- `time::at_utc`\n- `time::at`\n- `time::now`\n- `time::tzset`\n\nNon-Unix targets (including Windows and wasm) are unaffected.\n\n### Patches\n\nPending a proper fix, the internal method that determines the local offset has been modified to always return `None` on the affected operating systems. This has the effect of returning an `Err` on the `try_*` methods and `UTC` on the non-`try_*` methods.\n\nUsers and library authors with time in their dependency tree should perform `cargo update`, which will pull in the updated, unaffected code.\n\nUsers of time 0.1 do not have a patch and should upgrade to an unaffected version: time 0.2.23 or greater or the 0.3 series.\n\n### Workarounds\n\nA possible workaround for crates affected through the transitive dependency in `chrono`, is to avoid using the default `oldtime` feature dependency of the `chrono` crate by disabling its `default-features` and manually specifying the required features instead.\n\n#### Examples:\n\n`Cargo.toml`:  \n\n```toml\nchrono = { version = \"0.4\", default-features = false, features = [\"serde\"] }\n```\n\n```toml\nchrono = { version = \"0.4.22\", default-features = false, features = [\"clock\"] }\n```\n\nCommandline:  \n\n```bash\ncargo add chrono --no-default-features -F clock\n```\n\nSources:  \n - [chronotope/chrono#602 (comment)](https://github.com/chronotope/chrono/issues/602#issuecomment-1242149249)  \n - [vityafx/serde-aux#21](https://github.com/vityafx/serde-aux/issues/21)","format":"markdown","source":"rustsec"},{"lang":"es","text":"En el crate time de Rust desde la versión 0.2.7 y anterior a versión 0.2.23, los sistemas operativos tipo Unix pueden segregarse debido a la desreferenciación de un puntero colgante en circunstancias específicas.&#xa0;Esto requiere que el usuario configure cualquier variable de entorno en un hilo diferente al de las funciones afectadas.&#xa0;Las funciones afectadas son 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 y time::OffsetDateTime::try_now_local.&#xa0;Los objetivos que no son Unix no están afectados.&#xa0;Esto incluye Windows y wasm.&#xa0;El problema se introdujo en la versión 0.2.7 y se corrigió en la versión 0.2.23","source":"nvd"}],"published":"2020-11-18T12:00:00.000Z","modified":"2026-09-10T03:49:08.359Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":6.2,"rating":"MEDIUM"},{"scorer":"RustSec Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":6.2,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.3,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:M/Au:S/C:N/I:N/A:P","score":3.5,"rating":"LOW"}],"cwes":["CWE-476"],"affected":[{"ranges":[{"version":">= 0.2.7, <0.2.23","status":"affected"}],"vendor":"time-rs","product":"time","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.1.0","status":"affected","fixed":"0.2.23"}],"ecosystem":"crates.io","package":"time","purl":"pkg:cargo/time","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.2.7","status":"affected","fixed":"0.2.23"}],"ecosystem":"crates.io","package":"time","purl":"pkg:cargo/time","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.2.0"},{"type":"semver","introduced":"0.2.1-0","status":"affected","fixed":"0.2.1"},{"type":"semver","introduced":"0.2.2-0","status":"affected","fixed":"0.2.2"},{"type":"semver","introduced":"0.2.3-0","status":"affected","fixed":"0.2.3"},{"type":"semver","introduced":"0.2.4-0","status":"affected","fixed":"0.2.4"},{"type":"semver","introduced":"0.2.5-0","status":"affected","fixed":"0.2.5"},{"type":"semver","introduced":"0.2.6-0","status":"affected","fixed":"0.2.6"},{"type":"semver","introduced":"0.2.7-0","status":"affected","fixed":"0.2.23"}],"ecosystem":"crates.io","package":"time","purl":"pkg:cargo/time","source":"rustsec"},{"ranges":[{"status":"affected","introduced":"0.2.7","fixed":"0.2.23"}],"vendor":"time_project","product":"time","cpe":"cpe:2.3:a:time_project:time:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/time-rs/time/security/advisories/GHSA-wcg3-cvx6-7396","tags":["patch","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/time-rs/time/issues/293","tags":["issue-tracking","report","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","rustsec","nvd"]},{"url":"https://crates.io/crates/time/0.2.23","tags":["release-notes","vendor-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2020-26235","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/time-rs/time","tags":["package"],"sources":["ghsa"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2020-0071.html","tags":["advisory","web"],"sources":["ghsa","rustsec"]},{"url":"https://crates.io/crates/time","tags":["package"],"sources":["rustsec"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2020-26235","url":"https://www.cve.org/CVERecord?id=CVE-2020-26235","licence":"CVE Terms of Use","modified":"2024-08-04T15:56:03.095Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-wcg3-cvx6-7396","url":"https://github.com/advisories/GHSA-wcg3-cvx6-7396","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:08.359Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2020-0071","url":"https://rustsec.org/advisories/RUSTSEC-2020-0071.html","licence":"CC0-1.0","modified":"2026-02-04T02:31:56.682Z"},{"source":"nvd","name":"NVD","id":"CVE-2020-26235","url":"https://nvd.nist.gov/vuln/detail/CVE-2020-26235","licence":"Public domain","modified":"2026-06-17T03:07:53.160Z"}],"updatedAt":"2026-11-25T22:57:55.945Z","epss":{"score":0.02003,"percentile":0.81374,"date":"2026-12-01T12:00:22.000Z"}}