
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2022-1642 is a vulnerability in swift-corelibs-foundation that was disclosed on June 16, 2022. The vulnerability affects programs using swift-corelibs-foundation up to version 5.6.1, making them susceptible to denial of service attacks through malicious JSON document processing (GitHub Advisory).
The vulnerability stems from the interaction between the Swift standard library's Codable protocol and the JSONDecoder class. When deserializing JSON data containing numeric values with floating-point portions into integer fields, JSONDecoder uses different type-eraser methods during validation than during final casting. This mismatch in type handling methods leads to a deterministic crash. The issue particularly affects Swift-based web frameworks that use JSONDecoder to parse HTTP request bodies (GitHub Advisory).
The vulnerability allows attackers to cause denial of service by sending specifically crafted JSON documents to affected endpoints. While the vulnerability itself doesn't directly compromise confidentiality or integrity, the resulting crashes could potentially trigger error conditions that might lead to more severe security implications. The issue primarily affects Swift applications running on Linux and Windows platforms (GitHub Advisory).
The vulnerability was patched in Swift 5.6.2 for Linux and Windows platforms. Users should upgrade to this version and recompile their applications. As a temporary workaround, users can either ensure JSON numeric fields don't contain fractional parts or use JSONSerialization class instead of JSONDecoder. Notably, versions of Swift running on Darwin-based operating systems are not affected by this vulnerability (GitHub Advisory).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."