GHSA-3m6f-3gfg-4x56: Simple asn1 Panic On Incorrect Date Input Vulnerability

MODERATE
Published
Advisory Summary

GHSA-3m6f-3gfg-4x56 is a MODERATE panic on incorrect date input vulnerability (General Security Weakness) affecting Simple asn1 libraries in the crates.io ecosystem. The issue involves panic on incorrect date input to `simple_asn1`. Remediation is available by upgrading affected packages to version 0.6.1.

GHSA-3m6f-3gfg-4x56 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-3m6f-3gfg-4x56
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Simple asn1
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-3m6f-3gfg-4x56

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

simple_asn1 fixed: 0.6.1
Upgrade simple_asn1 to 0.6.1
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 simple_asn1

How to Check if You Are Affected

To determine whether your application is affected by GHSA-3m6f-3gfg-4x56, inspect your project dependencies for Simple asn1:

inspect dependencies for simple_asn1

Analyze the terminal output to locate any version of Simple asn1 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.6.1), 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 Simple asn1, 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

Version 0.6.0 of the `simple_asn1` crate panics on certain malformed inputs to its parsing functions, including `from_der` and `der_decode`. Because this crate is frequently used with inputs from the network, this should be considered a security vulnerability. The issue occurs when parsing the old ASN.1 "UTCTime" time format. If an attacker provides a UTCTime where the first character is ASCII but the second character is above 0x7f, a string slice operation in the `from_der_` function will try to slice into the middle of a UTF-8 character, and cause a panic. This error was introduced in commit [`d7d39d709577710e9dc8`](https://github.com/acw/simple_asn1/commit/d7d39d709577710e9dc8833ee57d200eef366db8), which updated `simple_asn1` to use `time` instead of `chrono` because of [`RUSTSEC-2020-159`](https://rustsec.org/advisories/RUSTSEC-2020-0159). Versions of `simple_asn1` before 0.6.0 are not affected by this issue. The [patch](https://github.com/acw/simple_asn1/pull/28) was applied in `simple_asn1` version 0.6.1.

GHSA-3m6f-3gfg-4x56 Affected Simple asn1 Versions

1 component(s)
Fixed Versions:
0.6.1
Product / Package Ecosystem Affected Versions Fixed Version
simple_asn1
crates.io
≥ 0.6.0
< 0.6.1
All 1 versions
0.6.0
0.6.1

References

Frequently Asked Questions

What is GHSA-3m6f-3gfg-4x56?
GHSA-3m6f-3gfg-4x56 is a security vulnerability in Simple asn1 involving Panic on incorrect date input to `simple_asn1` under General Security Weakness.
Which Simple asn1 versions are affected?
Affected versions include releases prior to 0.6.1 across affected packages: simple_asn1.
What version fixes GHSA-3m6f-3gfg-4x56?
Upgrading to 0.6.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is simple_asn1 affected?
Yes, simple_asn1 is affected in releases prior to 0.6.1. Upgrade your dependency to 0.6.1 or later.
What CWE is associated with GHSA-3m6f-3gfg-4x56?
GHSA-3m6f-3gfg-4x56 is classified under General Security Weakness.
How can I check crates.io dependencies for GHSA-3m6f-3gfg-4x56?
Run the dependency tree command: 'inspect dependencies for simple_asn1'. 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-3m6f-3gfg-4x56",
  "modified" : "2022-06-17T00:19:49Z",
  "published" : "2022-06-17T00:19:49Z",
  "aliases" : [ ],
  "summary" : "Panic on incorrect date input to `simple_asn1`",
  "details" : "Version 0.6.0 of the `simple_asn1` crate panics on certain malformed\ninputs to its parsing functions, including `from_der` and `der_decode`.\nBecause this crate is frequently used with inputs from the network, this\nshould be considered a security vulnerability.\n\nThe issue occurs when parsing the old ASN.1 \"UTCTime\" time format.  If an\nattacker provides a UTCTime where the first character is ASCII but the\nsecond character is above 0x7f, a string slice operation in the\n`from_der_` function will try to slice into the middle of a UTF-8\ncharacter, and cause a panic.\n\nThis error was introduced in commit\n[`d7d39d709577710e9dc8`](https://github.com/acw/simple_asn1/commit/d7d39d709577710e9dc8833ee57d200eef366db8),\nwhich updated `simple_asn1` to use `time` instead of `chrono` because of\n[`RUSTSEC-2020-159`](https://rustsec.org/advisories/RUSTSEC-2020-0159).\nVersions of `simple_asn1` before 0.6.0 are not affected by this issue.\n\nThe [patch](https://github.com/acw/simple_asn1/pull/28) was applied in\n`simple_asn1` version 0.6.1.\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "simple_asn1"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.6.0"
      }, {
        "fixed" : "0.6.1"
      } ]
    } ],
    "versions" : [ "0.6.0" ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/acw/simple_asn1/issues/27"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/acw/simple_asn1/commit/d7d39d709577710e9dc8833ee57d200eef366db8"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/acw/simple_asn1"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2021-0125.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-17T00:19:49Z",
    "nvd_published_at" : null
  }
}