GHSA-3m6f-3gfg-4x56

Suggest an improvement
Source
https://github.com/advisories/GHSA-3m6f-3gfg-4x56
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/06/GHSA-3m6f-3gfg-4x56/GHSA-3m6f-3gfg-4x56.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-3m6f-3gfg-4x56
Aliases
Published
2022-06-17T00:19:49Z
Modified
2023-11-08T04:07:23Z
Summary
Panic on incorrect date input to `simple_asn1`
Details

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, which updated simple_asn1 to use time instead of chrono because of RUSTSEC-2020-159. Versions of simple_asn1 before 0.6.0 are not affected by this issue.

The patch was applied in simple_asn1 version 0.6.1.

Database specific
{
    "cwe_ids":  [],
    "github_reviewed":  true,
    "github_reviewed_at":  "2022-06-17T00:19:49Z",
    "nvd_published_at":  null,
    "severity":  "MODERATE"
}
References

Affected packages

crates.io / simple_asn1

Package

Name
simple_asn1
View open source insights on deps.dev
Purl
pkg:cargo/simple_asn1

Affected ranges

Type
SEMVER
Events
Introduced
0.6.0
Fixed
0.6.1

Affected versions

0.*
0.6.0

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/06/GHSA-3m6f-3gfg-4x56/GHSA-3m6f-3gfg-4x56.json"