CVE-2022-1642
Apache Swift Corelibs Foundation Denial of Service
Description
A program using swift-corelibs-foundation is vulnerable to a denial of service attack caused by a potentially malicious source producing a JSON document containing a type mismatch. This vulnerability is caused by the interaction between a deserialization mechanism offered by the Swift standard library, the Codable protocol; and the JSONDecoder class offered by swift-corelibs-foundation, which can deserialize types that adopt the Codable protocol based on the content of a provided JSON document. When a type that adopts Codable requests the initialization of a field with an integer value, the JSONDecoder class uses a type-erased container with different accessor methods to attempt and coerce a corresponding JSON value and produce an integer. In the case the JSON value was a numeric literal with a floating-point portion, JSONDecoder used different type-eraser methods during validation than it did during the final casting of the value. The checked casting produces a deterministic crash due to this mismatch. The JSONDecoder class is often wrapped by popular Swift-based web frameworks to parse the body of HTTP requests and perform basic type validation. This makes the attack low-effort: sending a specifically crafted JSON document during a request to these endpoints will cause them to crash. The attack does not have any confidentiality or integrity risks in and of itself; the crash is produced deterministically by an abort function that ensures that execution does not continue in the face of this violation of assumptions. However, unexpected crashes can lead to violations of invariants in services, so it's possible that this attack can be used to trigger error conditions that escalate the risk. Producing a denial of service may also be the goal of an attacker in itself. This issue is solved in Swift 5.6.2 for Linux and Windows. This issue was solved by ensuring that the same methods are invoked both when validating and during casting, so that no type mismatch occurs. Swift for Linux and Windows versions are not ABI-interchangeable. To upgrade a service, its owner must update to this version of the Swift toolchain, then recompile and redeploy their software. The new version of Swift includes an updated swift-corelibs-foundation package. Versions of Swift running on Darwin-based operating systems are not affected.
INFO
Published Date :
June 16, 2022, 5:15 p.m.
Last Modified :
July 5, 2022, 8:28 p.m.
Source :
[email protected]
Remotely Exploitable :
Yes !
Impact Score :
3.6
Exploitability Score :
3.9
Public PoC/Exploit Available at Github
CVE-2022-1642 has a 1 public PoC/Exploit
available at Github.
Go to the Public Exploits
tab to see the list.
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2022-1642
.
URL | Resource |
---|---|
https://github.com/apple/swift-corelibs-foundation/security/advisories/GHSA-239c-6cv2-wwx8 | Third Party Advisory |
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
This will includes swift UI realted stuff.
Swift
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2022-1642
vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2022-1642
vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
CVE Modified by [email protected]
May. 14, 2024
Action Type Old Value New Value -
Initial Analysis by [email protected]
Jul. 05, 2022
Action Type Old Value New Value Added CVSS V2 NIST (AV:N/AC:L/Au:N/C:N/I:N/A:P) Added CVSS V3.1 NIST AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H Changed Reference Type https://github.com/apple/swift-corelibs-foundation/security/advisories/GHSA-239c-6cv2-wwx8 No Types Assigned https://github.com/apple/swift-corelibs-foundation/security/advisories/GHSA-239c-6cv2-wwx8 Third Party Advisory Added CWE NIST CWE-704 Added CPE Configuration OR *cpe:2.3:a:apple:swift:*:*:*:*:*:linux:*:* versions up to (excluding) 5.6.2 *cpe:2.3:a:apple:swift:*:*:*:*:*:windows:*:* versions up to (excluding) 5.6.2
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2022-1642
is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2022-1642
weaknesses.
Exploit Prediction
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days.
0.09 }} 0.00%
score
0.37824
percentile