CVE-2026-28815: Swift Crypto X-Wing HPKE Decapsulation Malformed Ciphertext Vulnerability
Summary
CVE-2026-28815: Swift Crypto: X-Wing HPKE Decapsulation Accepts Malformed Ciphertext Length. Affects swift-crypto versions >= 4.0.0, < 4.3.1. Fixed in 4.3.1. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Swift Crypto is a robust cryptographic library designed for Swift applications, providing essential cryptographic functionalities such as encryption, decryption, and key management. It is widely used in secure communications and data protection. However, a vulnerability has been identified in the X-Wing decapsulation process, where the library fails to enforce the required fixed ciphertext length, leading to potential memory safety issues.
Vulnerability Detail
The vulnerability arises from the X-Wing decapsulation path accepting attacker-controlled encapsulated ciphertext bytes without enforcing the required fixed ciphertext length of 1120 bytes. This oversight allows for an out-of-bounds read in the C API, which can lead to undefined behavior, crashes, or memory disclosure. The issue is triggered when a malformed encapsulated key is passed during the initialization of an HPKE.Recipient, which subsequently calls the vulnerable decapsulate function. The lack of a length check before passing data to the C API creates a significant security risk.
How To Fix
Minimum fixed version
4.3.1
This is the first release that contains the fix.
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
Currently, there are no specific workarounds to mitigate this vulnerability without updating to the patched version. It is highly recommended to avoid using the vulnerable functionality until the update is applied.
Conclusion
The CVE-2026-28815 vulnerability in Swift Crypto poses a significant risk due to improper handling of ciphertext lengths in the X-Wing decapsulation process. It is essential for developers using this library to update to the patched version to ensure the security and stability of their applications.
See every vulnerability recorded for swift-crypto →
FAQ
CVE-2026-28815 is a vulnerability in the Swift Crypto library that allows for out-of-bounds memory access due to improper handling of ciphertext length in the X-Wing decapsulation process.
If your application uses the affected version of Swift Crypto, it may be susceptible to crashes or memory disclosure when processing malformed encapsulated keys.
While there are no workarounds available, it is crucial to prioritize updating to the patched version as soon as possible to mitigate the risk.
You can use the Vulert platform to monitor and alert for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected by this vulnerability.
The CVSS score for this vulnerability is 8.8, indicating a high severity level.