CVE-2026-142550 — Github.com/vapor/jwt-kit — CWE-681
### Summary JWTKit can crash while parsing a JWT header containing an extremely large integer value. When decoding header fields, the library parses JSON numbers as Double and converts integral values to Int without checking whether the value fits into the valid Int range. A header containing a value such as 1e300 causes a Swift runtime trap. Because JWT headers are parsed before signature verification, an attacker can crash the application by sending a specially crafted JWT without requiring a valid signature. ### Details `JWTKeyCollection.verify()` parses the JWT header before selecting a signer and verifying the token signature. The header is decoded by `JWTParser.parseHeader()`, which deserializes the JSON into JWTHeader. During this process, `JWTHeaderField.init(from:)` decodes JSON numbers as Double and converts integral values to Int without validating that they fit within the representable Int range: ``` let doubleValue = try container.decode(Double.self) if doubleValue.truncatingRemainder(dividingBy: 1) == 0 { self = .int(Int(doubleValue)) } ``` An attacker can supply an extremely large integral value (for example, 1e300), causing the Int(doubleValue) conversion to trigger a Swift runtime trap. Because this occurs while parsing the JWT header, the application crashes before signature verification. Affected code: * Sources/JWTKit/JWTKeyCollection.swift (verify() - parseHeader()) * Sources/JWTKit/JWTParser.swift (parseHeader()) * Sources/JWTKit/JWTHeaderFie
### Summary JWTKit can crash while parsing a JWT header containing an extremely large integer value. When decoding header fields, the library parses JSON numbers as Double and converts integral values to Int without checking whether the value fits into the valid Int range. A header containing a value such as 1e300 causes a Swift runtime trap. Because JWT headers are parsed before signature verification, an attacker can crash the application by sending a specially crafted JWT without requiring a valid signature. ### Details `JWTKeyCollection.verify()` parses the JWT header before selecting a signer and verifying the token signature. The header is decoded by `JWTParser.parseHeader()`, which deserializes the JSON into JWTHeader. During this process, `JWTHeaderField.init(from:)` decodes JSON numbers as Double and converts integral values to Int without validating that they fit within the representable Int range: ``` let doubleValue = try container.decode(Double.self) if doubleValue.truncatingRemainder(dividingBy: 1) == 0 { self = .int(Int(doubleValue)) } ``` An attacker can supply an extremely large integral value (for example, 1e300), causing the Int(doubleValue) conversion to trigger a Swift runtime trap. Because this occurs while parsing the JWT header, the application crashes before signature verification. Affected code: * Sources/JWTKit/JWTKeyCollection.swift (verify() - parseHeader()) * Sources/JWTKit/JWTParser.swift (parseHeader()) * Sources/JWTKit/JWTHeaderFie
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CVE-2026-142550
CVSS 7.5/10 · HIGH · 02.12.2026
CWE: CWE-681
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 WHAT IS THIS VULNERABILITY?
Summary: ### Summary
JWTKit can crash while parsing a JWT header containing an extremely large integer value. When decoding header fields, the library parses JSON numbers as Double and converts integral values to Int without checking whether the value fits into the valid Int range. A header containing a value such as 1e300 causes a Swift runtime trap.
Affected: github.com/vapor/jwt-kit
⚡ ATTACK VECTOR
Network / Remote (AV:N) · no authentication required (PR:N) · no user interaction (UI:N) · low attack complexity (AC:L).
🌍 REAL WORLD IMPACT
Partial confidentiality disclosure (C:L); service can be completely taken down.
🛡️ REMEDIATION
→ Apply vendor security update for github.com/vapor/jwt-kit.
→ Pre-patch: put service behind VPN or apply IP allowlist.
→ Add WAF rule, create IDS alert for anomalous traffic.
⚠️ URGENCY
⚠️ This week (7 days) — High risk, anonymous remote.
────────────────────────────────────────
[Automated Technical Vulnerability & CVSS Vector Analysis]