Advisory

RUSTSEC-2021-0125

Also known as: CVE-2021-45711, GHSA-3m6f-3gfg-4x56, GHSA-g4h2-4wvh-grc5

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.

Severity

Not rated by the source.

Dates

Published
2021-11-14 12:00 UTC
Modified
2023-11-08 04:07 UTC

Affected packages and fixes

simple_asn1

crates.io · All systems

Affected

  • introduced 0.6.0, fixed 0.6.1 (semver)

Fixed versions

0.6.1

Fix

  • Fixed version 0.6.1
    cargo update -p simple_asn1 --precise 0.6.1

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: RustSec Advisory Database · CC0-1.0

Sources & licences