Email me

Rust advisories / simple_asn1

Vulnerability MediumRUSTSEC-2021-0125 · simple_asn1

RUSTSEC-2021-0125: Panic on incorrect date input to `simple_asn1`

Short answerA security vulnerability in the simple_asn1 crate: Panic on incorrect date input to `simple_asn1`. GitHub rates it Medium. Fixed in 0.6.1: update to a fixed version.

Cratesimple_asn1
TypeVulnerability (denial-of-service)
Affected versionsFrom 0.6.0 before 0.6.1.
Fixed in0.6.1
SeverityMedium (GitHub rating)
Published2021-11-14
Last changed2023-11-08
Also known asCVE-2021-45711, GHSA-3m6f-3gfg-4x56, GHSA-g4h2-4wvh-grc5

What to do

  1. See which version you have: cargo tree -i simple_asn1 (it also shows which of your dependencies pulls it in).
  2. Update within your version requirement: cargo update -p simple_asn1. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for example simple_asn1 = "0.6.1") or update the dependency that pulls it in.
  3. Check again with cargo audit, or paste your Cargo.lock into our Cargo.toml checker.

Details from the advisory

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.

References

From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.

Up next

Are you affected?Check your whole dependency treePaste Cargo.lock: every advisory, for your exact versions.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ