GHSA-cqpr-pcm7-m3jc: Chrono Potential Segfault Vulnerability

MODERATE
Published
Advisory Summary

GHSA-cqpr-pcm7-m3jc is a MODERATE potential segfault vulnerability (General Security Weakness) affecting Chrono libraries in the crates.io ecosystem. The issue involves potential segfault in `localtime_r` invocations. Remediation is available by upgrading affected packages to version 0.4.20.

GHSA-cqpr-pcm7-m3jc at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-cqpr-pcm7-m3jc
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Chrono
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-cqpr-pcm7-m3jc

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

chrono fixed: 0.4.20
Upgrade chrono to 0.4.20
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 chrono

How to Check if You Are Affected

To determine whether your application is affected by GHSA-cqpr-pcm7-m3jc, inspect your project dependencies for Chrono:

inspect dependencies for chrono

Analyze the terminal output to locate any version of Chrono in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.4.20), 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 General Security Weakness. In Chrono, 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. ### Workarounds No workarounds are known.

GHSA-cqpr-pcm7-m3jc Affected Chrono Versions

1 component(s)
Fixed Versions:
0.4.20
Product / Package Ecosystem Affected Versions Fixed Version
chrono
crates.io
< 0.4.20
0.4.20

References

Frequently Asked Questions

What is GHSA-cqpr-pcm7-m3jc?
GHSA-cqpr-pcm7-m3jc is a security vulnerability in Chrono involving Potential segfault in `localtime_r` invocations under General Security Weakness.
Which Chrono versions are affected?
Affected versions include releases prior to 0.4.20 across affected packages: chrono.
What version fixes GHSA-cqpr-pcm7-m3jc?
Upgrading to 0.4.20 (or the latest patched release for your respective branch) resolves the vulnerability.
Is chrono affected?
Yes, chrono is affected in releases prior to 0.4.20. Upgrade your dependency to 0.4.20 or later.
What CWE is associated with GHSA-cqpr-pcm7-m3jc?
GHSA-cqpr-pcm7-m3jc is classified under General Security Weakness.
How can I check crates.io dependencies for GHSA-cqpr-pcm7-m3jc?
Run the dependency tree command: 'inspect dependencies for chrono'. 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-cqpr-pcm7-m3jc",
  "modified" : "2022-08-04T19:38:53Z",
  "published" : "2022-06-16T23:48:34Z",
  "withdrawn" : "2022-07-21T18:06:06Z",
  "aliases" : [ ],
  "summary" : "Potential segfault in `localtime_r` invocations",
  "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\n### Workarounds \n\nNo workarounds are known.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "chrono"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.4.20"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/chronotope/chrono/issues/499"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/time-rs/time/issues/293"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/chronotope/chrono"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2020-0159.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-16T23:48:34Z",
    "nvd_published_at" : null
  }
}