CVE-2020-26235: Time Segmentation Fault Vulnerability

MODERATE
Advisory Identifier: GHSA-wcg3-cvx6-7396
CVSS 6.2
CWE-476
Published
Advisory Summary

CVE-2020-26235 is a MODERATE (CVSS 6.2) segmentation fault vulnerability (CWE-476: NULL Pointer Dereference) affecting Time libraries in the crates.io ecosystem. The issue involves segmentation fault in time. Remediation is available by upgrading affected packages to version 0.2.23.

CVE-2020-26235 at a Glance

CVE Identifier CVE-2020-26235
GHSA Identifier GHSA-wcg3-cvx6-7396
Severity MODERATE
CVSS v3.1 Base Score 6.2
CWE Classification CWE-476: NULL Pointer Dereference
Affected Product Time
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 6.2

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2020-26235

To remediate this vulnerability, upgrade all affected Time dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

time fixed: 0.2.23
Upgrade time to 0.2.23
time fixed: 0.2.23
Upgrade time to 0.2.23
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for time

How to Check if You Are Affected

To determine whether your application is affected by CVE-2020-26235, inspect your project dependencies for Time:

inspect dependencies for time

Analyze the terminal output to locate any version of Time in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.2.23), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-476: NULL Pointer Dereference, where the product dereferences a pointer that it expects to be valid but is null. In Time, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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. The affected functions from time 0.2.7 through 0.2.22 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` - `time::OffsetDateTime::try_now_local` The affected functions in time 0.1 (all versions) are: - `at` - `at_utc` - `now` Non-Unix targets (including Windows and wasm) are unaffected. ### Patches In 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. Users and library authors with time in their dependency tree must perform `cargo update`, which will pull in the updated, unaffected code. Users 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. ### Workarounds Library 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. ### References [time-rs/time#293](https://github.com/time-rs/time/issues/293).

CVE-2020-26235 Affected Time Versions

2 component(s)
Fixed Versions:
0.2.23
Product / Package Ecosystem Affected Versions Fixed Version
time
crates.io
≥ 0.1.0
< 0.2.23
0.2.23
time
crates.io
≥ 0.2.7
< 0.2.23
0.2.23

References

Frequently Asked Questions

What is CVE-2020-26235?
CVE-2020-26235 is a security vulnerability in Time involving Segmentation fault in time under CWE-476: NULL Pointer Dereference.
Which Time versions are affected?
Affected versions include releases prior to 0.2.23 across affected packages: time.
What version fixes CVE-2020-26235?
Upgrading to 0.2.23 (or the latest patched release for your respective branch) resolves the vulnerability.
Is time affected?
Yes, time is affected in releases prior to 0.2.23. Upgrade your dependency to 0.2.23 or later.
What is the CVSS score of CVE-2020-26235?
CVE-2020-26235 has a CVSS v3.1 base score of 6.2 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2020-26235?
CVE-2020-26235 is classified under CWE-476: NULL Pointer Dereference (The product dereferences a pointer that it expects to be valid but is NULL.).
How can I check crates.io dependencies for CVE-2020-26235?
Run the dependency tree command: 'inspect dependencies for time'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-wcg3-cvx6-7396",
  "modified" : "2024-06-10T18:40:10Z",
  "published" : "2021-08-25T20:56:46Z",
  "aliases" : [ "CVE-2020-26235" ],
  "summary" : "Segmentation fault in time",
  "details" : "### 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).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "time"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.1.0"
      }, {
        "fixed" : "0.2.23"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "< 0.2.0"
    }
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "time"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.2.7"
      }, {
        "fixed" : "0.2.23"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/time-rs/time/security/advisories/GHSA-wcg3-cvx6-7396"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-26235"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/time-rs/time/issues/293"
  }, {
    "type" : "WEB",
    "url" : "https://crates.io/crates/time/0.2.23"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/time-rs/time"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2020-0071.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-476" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-08-18T21:06:21Z",
    "nvd_published_at" : "2020-11-24T22:15:00Z"
  }
}