CVE-2025-0343: CVE-2025-0343 Swift ASN.1 Can Crash When Vulnerability
LOWCVE-2025-0343 is a LOW swift asn.1 can crash when vulnerability (CWE-228: Improper Handling of Syntactically Invalid Structure) affecting CVE-2025-0343 libraries in the SwiftURL ecosystem. The issue involves swift asn.1 can crash when parsing maliciously formed ber/der. Remediation is available by upgrading affected packages to version 1.3.1.
CVE-2025-0343 at a Glance
How to Fix CVE-2025-0343
To remediate this vulnerability, upgrade all affected CVE-2025-0343 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/apple/swift-asn1 to 1.3.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/apple/swift-asn1
How to Check if You Are Affected
To determine whether your application is affected by CVE-2025-0343, inspect your project dependencies for CVE-2025-0343:
inspect dependencies for github.com/apple/swift-asn1
Analyze the terminal output to locate any version of CVE-2025-0343 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.3.1), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-228: Improper Handling of Syntactically Invalid Structure, where the product does not handle or incorrectly handles input that is not syntactically well-formed with respect to the associated specification. In CVE-2025-0343, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-0343 Affected CVE-2025-0343 Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/apple/swift-asn1
|
SwiftURL |
< 1.3.1
|
1.3.1
|
References
Frequently Asked Questions
What is CVE-2025-0343?
Which CVE-2025-0343 versions are affected?
What version fixes CVE-2025-0343?
Is github.com/apple/swift-asn1 affected?
What CWE is associated with CVE-2025-0343?
How can I check SwiftURL dependencies for CVE-2025-0343?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-w8xv-rwgf-4fwh",
"modified" : "2025-01-15T15:26:01Z",
"published" : "2025-01-14T16:32:07Z",
"aliases" : [ "CVE-2025-0343" ],
"summary" : "CVE-2025-0343: Swift ASN.1 can crash when parsing maliciously formed BER/DER",
"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.\n\nImportantly, 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.\n\nThese 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.\n\nMany thanks to @baarde for reporting this issue and providing the fix.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "SwiftURL",
"name" : "github.com/apple/swift-asn1"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.3.1"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.3.0"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/apple/swift-asn1/security/advisories/GHSA-w8xv-rwgf-4fwh"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-0343"
}, {
"type" : "WEB",
"url" : "https://github.com/apple/swift-asn1/commit/ae33e5941bb88d88538d0a6b19ca0b01e6c76dcf"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/apple/swift-asn1"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-228" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2025-01-14T16:32:07Z",
"nvd_published_at" : "2025-01-15T01:15:13Z"
}
}