Skip to content
High 7.5

JWTKitに認証なしでサービス停止に陥る脆弱性、5.8.0で修正

CVE-2026-142550 First seen on SecPulse

Summary

JWTKitには、悪意のあるJWTヘッダーを解析させると、署名を検証する前にアプリケーションがクラッシュする脆弱性があります。認証が不要なため、外部から遠隔で攻撃される可能性があります。5.8.0より前のバージョンを使っている場合は、5.8.0に更新してください。

AI summary

Produced by SecPulse using an external AI model; it may contain mistakes. Check the original description and references below before acting on it.

JWTKitには、悪意のあるJWTヘッダーを解析させると、署名を検証する前にアプリケーションがクラッシュする脆弱性があります。認証が不要なため、外部から遠隔で攻撃される可能性があります。5.8.0より前のバージョンを使っている場合は、5.8.0に更新してください。

Affected packages

PackageAffected → Fixed
vaporjwt-kit —
SwiftURLgithub.com/vapor/jwt-kit
< 5.8.0→ 5.8.0
swiftgithub.com/vapor/jwt-kit
< 5.8.0→ 5.8.0
Original description The description as published by the source.

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…

Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details