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

- Severity: High 7.5 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.34%, higher than 30% of CVEs (2026-12-01)
- Published: 2025-01-14T16:32:07.000Z
- Modified: 2026-06-17T08:26:18.920Z
- Also known as: GHSA-w8xv-rwgf-4fwh
- Weaknesses: CWE-228
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial
- Assigned by: Swift

## Description

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.

(As written by CVE List.)

## Affected

- Swift Project Swift ASN1: from 1.0.0 before 1.3.1
- github.com/apple/swift-asn1 (SwiftURL): before 1.3.1

## Every score

- CISA-ADP: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- GitHub: rating Low

## References

- <https://github.com/apple/swift-asn1/security/advisories/GHSA-w8xv-rwgf-4fwh> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2025-0343> (advisory)
- <https://github.com/apple/swift-asn1/commit/ae33e5941bb88d88538d0a6b19ca0b01e6c76dcf> (web)
- <https://github.com/apple/swift-asn1> (package)

## Sources

- CVE List: [CVE-2025-0343](https://www.cve.org/CVERecord?id=CVE-2025-0343), CVE Terms of Use, modified 2025-03-24
- GitHub Advisory Database: [GHSA-w8xv-rwgf-4fwh](https://github.com/advisories/GHSA-w8xv-rwgf-4fwh), CC-BY-4.0, modified 2025-01-15
- NVD: [CVE-2025-0343](https://nvd.nist.gov/vuln/detail/CVE-2025-0343), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2025-0343 · Whole record: https://cve.day/CVE-2025-0343.json · Rebuilt by cve.day 2026-11-25T22:58:53.324Z
