Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS13OHh2LXJ3Z2YtNGZ3aM4ABDT5

CVE-2025-0343: Swift ASN.1 can crash when parsing maliciously formed BER/DER

Swift ASN.1 can be caused to crash when parsing certain BER/DER constructions. This crash is caused by a confusion in the ASN.1 library itself which assumes that certain objects can only be provided in either constructed or primitive forms, and will trigger a preconditionFailure if that constraint isn't met.

Importantly, these constraints are actually required to be true in DER, but that correctness wasn't enforced on the early node parser side so it was incorrect to rely on it later on in decoding, which is what the library did.

These crashes can be triggered when parsing any DER/BER format object. There is no memory-safety issue here: the crash is a graceful one from the Swift runtime. The impact of this is that it can be used as a denial-of-service vector when parsing BER/DER data from unknown sources, e.g. when parsing TLS certificates.

Many thanks to @baarde for reporting this issue and providing the fix.

Permalink: https://github.com/advisories/GHSA-w8xv-rwgf-4fwh
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS13OHh2LXJ3Z2YtNGZ3aM4ABDT5
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Low
Classification: General
Published: 15 days ago
Updated: 14 days ago


EPSS Percentage: 0.00043
EPSS Percentile: 0.11266

Identifiers: GHSA-w8xv-rwgf-4fwh, CVE-2025-0343
References: Repository: https://github.com/apple/swift-asn1
Blast Radius: 0.0

Affected Packages

swift:github.com/apple/swift-asn1
Dependent packages: 2
Dependent repositories: 1
Downloads:
Affected Version Ranges: <= 1.3.0
Fixed in: 1.3.1
All affected versions: 0.1.0, 0.2.0, 0.2.1, 0.3.0, 0.4.0, 0.5.0, 0.6.0, 0.7.0, 0.8.0, 0.9.0, 0.9.1, 0.10.0, 1.0.0, 1.1.0, 1.2.0, 1.3.0
All unaffected versions: