CVE-2025-0343

Source
https://cve.org/CVERecord?id=CVE-2025-0343
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-0343.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2025-0343
Aliases
Published
2025-01-15T00:48:07.959Z
Modified
2026-07-15T01:49:18.549329200Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
[none]
Details

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.

Database specific
{
    "cna_assigner": "Swift",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/0xxx/CVE-2025-0343.json"
}
References

Affected packages

Git / github.com/apple/swift-asn1

Affected ranges

Type
GIT
Repo
https://github.com/apple/swift-asn1
Events
Database specific
{
    "extracted_events": [
        {
            "introduced": "1.0.0"
        },
        {
            "fixed": "1.3.1"
        }
    ],
    "source": "AFFECTED_FIELD"
}

Affected versions

1.*
1.0.0
1.0.0-beta.2
1.1.0
1.2.0
1.3.0

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-0343.json"