Vulnerability in github.com/apple/swift-corelibs-foundation (CVE-2022-1642)
Summary
Vulnerability in github.com/apple/swift-corelibs-foundation (CVE-2022-1642). Risk of unauthorized operations or information disclosure. Mitigation: upgrade to 5.6.2 or later.
Original description
The description as published by the source.
Impact
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 no…
Source: OSV.dev (Open Source Vulnerabilities) NVD GitHub Advisory OSV
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2022-1642 has been found in github.com/apple/swift-corelibs-foundation.
Risk of unauthorized operations or information disclosure.
What to do: upgrade github.com/apple/swift-corelibs-foundation to 5.6.2 or later.
If unsure, ask your IT team or search "github.com/apple/swift-corelibs-foundation CVE-2022-1642" on the vendor's site.
CVE-2022-1642 (github.com/apple/swift-corelibs-foundation) — CWE-704
Attack vector: remote (network-reachable) / unauthenticated / no user interaction
Patched: 5.6.2 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
A vulnerability (CWE-704) exists in github.com/apple/swift-corelibs-foundation.
Check the vendor advisory for the affected versions of github.com/apple/swift-corelibs-foundation.
Severity: ?. Risk of unauthorized operations or information disclosure.
Update to 5.6.2.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'github.com/apple/swift-corelibs-foundation' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'github.com/apple/swift-corelibs-foundation' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
github.com/apple/swift-corelibs-foundationを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade github.com/apple/swift-corelibs-foundation to 5.6.2ステージング環境で 5.6.2 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
References
- advisory nvd.nist.gov
- package github.com
- web github.com
- web github.com