Every CVESearch/Get API key

CVE-2026-142551

JWTKit: Missing aud validation in Apple/Google/Microsoft identity tokens can enable cross-client authentication bypass

Explain with AI
ChatGPTClaudeGoogle AI
Severity
8.1High
Network attack, no privileges, needs user interactionCVSS 3.1, CVE List
Exploitation
Proof of concept
CISA reports one, no source links it
Exploit chance
0.45% in 30 days
Percentile40th
EPSS, scored
Listed fix
5.8.0 for github.com/vapor/jwt-kit
From GitHub Advisories and OSV

Overview

JWTKit is a Swift library for signing and verifying JSON Web Tokens. From 4.0.0 until 5.8.0, JWTSigner.verify() in Sources/JWTKit/JWTSigner.swift invokes payload verification after validating the JWS signature, but AppleIdentityToken, GoogleIdentityToken, and MicrosoftIdentityToken in Sources/JWTKit/Vendor/AppleIdentityToken.swift, Sources/JWTKit/Vendor/GoogleIdentityToken.swift, and Sources/JWTKit/Vendor/MicrosoftIdentityToken.swift do not validate the aud claim against the application's intended audience. An attacker can obtain a legitimate provider-issued ID token for an attacker-controlled OAuth or OIDC client and submit it to a different application using the same provider keys. If that application relies on the built-in verification as its authentication decision without a separate audience.verifyIntendedAudience(...) check, the token can be accepted despite being intended for another client. Depending on the application's identity mapping, the resulting cross-client token reuse can enable authentication bypass or account takeover. Applications that independently validate the intended audience are not affected through this issue. This issue is fixed in 5.8.0.

CVSS 3.1 vector

Exploitability

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
Required

Impact

Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N

Exploit chance over time

Unchanged since Dec 3, 2026
EPSS score 0.45% every day from Dec 3, 2026 to Dec 4, 2026.

Affected

Packages 1

Affected packages
PackageAffectedFixed
github.com/vapor/jwt-kit
SwiftURL
4.0.0 to 5.7.1
5.8.0
4.0.0 up to 5.8.0
5.8.0

Products 1

Sources

CVE List Score usedCVSS 3.18.1

JWTKit: Missing aud validation in Apple/Google/Microsoft identity tokens can enable cross-client authentication bypass

JWTKit is a Swift library for signing and verifying JSON Web Tokens. From 4.0.0 until 5.8.0, JWTSigner.verify() in Sources/JWTKit/JWTSigner.swift invokes payload verification after validating the JWS signature, but AppleIdentityToken, GoogleIdentityToken, and MicrosoftIdentityToken in Sources/JWTKit/Vendor/AppleIdentityToken.swift, Sources/JWTKit/Vendor/GoogleIdentityToken.swift, and Sources/JWTKit/Vendor/MicrosoftIdentityToken.swift do not validate the aud claim against the application's intended audience. An attacker can obtain a legitimate provider-issued ID token for an attacker-controlled OAuth or OIDC client and submit it to a different application using the same provider keys. If that application relies on the built-in verification as its authentication decision without a separate audience.verifyIntendedAudience(...) check, the token can be accepted despite being intended for another client. Depending on the application's identity mapping, the resulting cross-client token reuse can enable authentication bypass or account takeover. Applications that independently validate the intended audience are not affected through this issue. This issue is fixed in 5.8.0.

Record
CVE-2026-142551
CVSS 3.1
8.1 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
Weakness
CWE-287, CWE-345
Updated
2026-12-02
EUVDEUVD-2026-141870CVSS 3.18.1

JWTKit is a Swift library for signing and verifying JSON Web Tokens. From 4.0.0 until 5.8.0, JWTSigner.verify() in Sources/JWTKit/JWTSigner.swift invokes payload verification after validating the JWS signature, but AppleIdentityToken, GoogleIdentityToken, and MicrosoftIdentityToken in Sources/JWTKit/Vendor/AppleIdentityToken.swift, Sources/JWTKit/Vendor/GoogleIdentityToken.swift, and Sources/JWTKit/Vendor/MicrosoftIdentityToken.swift do not validate the aud claim against the application's intended audience. An attacker can obtain a legitimate provider-issued ID token for an attacker-controlled OAuth or OIDC client and submit it to a different application using the same provider keys. If that application relies on the built-in verification as its authentication decision without a separate audience.verifyIntendedAudience(...) check, the token can be accepted despite being intended for another client. Depending on the application's identity mapping, the resulting cross-client token reuse can enable authentication bypass or account takeover. Applications that independently validate the intended audience are not affected through this issue. This issue is fixed in 5.8.0.

Record
EUVD-2026-141870
CVSS 3.1
8.1 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
Updated
2026-12-03
GitHub AdvisoriesGHSA-gxx9-vxm7-hgrqCVSS 3.18.1

JWTKit: Missing aud validation in Apple/Google/Microsoft identity tokens can enable cross-client authentication bypass

Summary

AppleIdentityToken, GoogleIdentityToken, and MicrosoftIdentityToken validate a signed ID token's issuer and expiry, but do not validate that the aud claim is intended for the current application.

This allows cross-client ID token reuse when an application relies on JWTKit's built-in vendor token verification as complete authentication. An attacker can obtain a legitimate Apple/Google/Microsoft ID token for an attacker-controlled OAuth/OIDC client and submit it to a different application using the same provider keys. JWTKit accepts the token even though its aud identifies the attacker's client, not the victim application.

The exact account-level impact depends on how the application maps provider identities, but the security boundary is already broken once a token issued for another relying party is accepted as a verified login token.

Details

JWTSigner.verify() verifies the JWS signature and then automatically calls the payload's verify(using:) method:

  • Sources/JWTKit/JWTSigner.swift:33-39
guard try algorithm.verify(signature, signs: data) else {
    throw JWTError.signatureVerificationFailed
}

let (_, payload, _) = try parser.parse(token, as: Payload.self)
try await payload.verify(using: algorithm)

For the vendor ID token payload types, verify(using:) does not check audience:

  • Sources/JWTKit/Vendor/AppleIdentityToken.swift:85-90 checks only iss and exp
  • Sources/JWTKit/Vendor/GoogleIdentityToken.swift:139-148 checks only iss, sub length, and exp
  • Sources/JWTKit/Vendor/MicrosoftIdentityToken.swift:149-158 checks only tid/iss consistency and exp

The audience fields are decoded and documented as security-relevant, but are never enforced:

  • Apple: audience is documented as the application's client_id
  • Google: audience is documented as one of the application's OAuth client IDs
  • Microsoft: audience is documented as the app's Application ID, with a comment saying: "Your app should validate this value, and reject the token if the value does not match."

This is also inconsistent with the existing Firebase vendor token implementation. FirebaseAuthIdentityToken.verify(using:) derives the Firebase project ID from audience and requires issuer == "https://securetoken.google.com/<projectId>" (Sources/JWTKit/Vendor/FirebaseAuthIdentityToken.swift:122-136). That shows JWTKit already treats audience binding as part of safe vendor-token verification for at least one provider.

OpenID Connect Core ID Token validation requires the relying party to validate that the aud claim contains its own client_id. A valid provider signature only proves that the provider issued the token for some client. It does not prove that the token was issued for this application.

PoC

This PoC uses a local HMAC key only to avoid needing live Apple/Google/Microsoft credentials. The cryptographic signature is not the vulnerable part; the relevant behavior is that after a valid signature, JWTKit's real verify(using:) implementation accepts tokens with attacker-controlled aud values. JWTSigner.verify() invokes payload.verify(using:) after signature verification regardless of which JWT algorithm verified the signature.

Create a temporary SwiftPM executable depending on the local jwt-kit checkout and run this code:

import JWTKit
import Foundation

@main
struct PoC {
    static func main() async throws {
        let keys = JWTKeyCollection()
        await keys.add(hmac: "secret", digestAlgorithm: .sha256)

        let apple = AppleIdentityToken(
            issuer: "https://appleid.apple.com",
            audience: "com.attacker.app",
            expires: .init(value: Date().addingTimeInterval(3600)),
            issuedAt: .init(value: Date()),
            subject: "victim-apple-sub"
        )
        let appleJWT = try await keys.sign(apple)
        _ = try await…
Record
GHSA-gxx9-vxm7-hgrq
CVSS 3.1
8.1 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
Weakness
CWE-287, CWE-345
Updated
2026-12-02
NVDCVSS 3.18.1

JWTKit is a Swift library for signing and verifying JSON Web Tokens. From 4.0.0 until 5.8.0, JWTSigner.verify() in Sources/JWTKit/JWTSigner.swift invokes payload verification after validating the JWS signature, but AppleIdentityToken, GoogleIdentityToken, and MicrosoftIdentityToken in Sources/JWTKit/Vendor/AppleIdentityToken.swift, Sources/JWTKit/Vendor/GoogleIdentityToken.swift, and Sources/JWTKit/Vendor/MicrosoftIdentityToken.swift do not validate the aud claim against the application's intended audience. An attacker can obtain a legitimate provider-issued ID token for an attacker-controlled OAuth or OIDC client and submit it to a different application using the same provider keys. If that application relies on the built-in verification as its authentication decision without a separate audience.verifyIntendedAudience(...) check, the token can be accepted despite being intended for another client. Depending on the application's identity mapping, the resulting cross-client token reuse can enable authentication bypass or account takeover. Applications that independently validate the intended audience are not affected through this issue. This issue is fixed in 5.8.0.

Record
CVE-2026-142551
CVSS 3.1
8.1 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
Weakness
CWE-287, CWE-345
Updated
2026-12-03
OSVCVSS 3.18.1

JWTKit: Missing aud validation in Apple/Google/Microsoft identity tokens can enable cross-client authentication bypass

JWTKit is a Swift library for signing and verifying JSON Web Tokens. From 4.0.0 until 5.8.0, JWTSigner.verify() in Sources/JWTKit/JWTSigner.swift invokes payload verification after validating the JWS signature, but AppleIdentityToken, GoogleIdentityToken, and MicrosoftIdentityToken in Sources/JWTKit/Vendor/AppleIdentityToken.swift, Sources/JWTKit/Vendor/GoogleIdentityToken.swift, and Sources/JWTKit/Vendor/MicrosoftIdentityToken.swift do not validate the aud claim against the application's intended audience. An attacker can obtain a legitimate provider-issued ID token for an attacker-controlled OAuth or OIDC client and submit it to a different application using the same provider keys. If that application relies on the built-in verification as its authentication decision without a separate audience.verifyIntendedAudience(...) check, the token can be accepted despite being intended for another client. Depending on the application's identity mapping, the resulting cross-client token reuse can enable authentication bypass or account takeover. Applications that independently validate the intended audience are not affected through this issue. This issue is fixed in 5.8.0.

Record
CVE-2026-142551
CVSS 3.1
8.1 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
Weakness
CWE-287, CWE-345
Updated
2026-12-03
OSVGHSA-gxx9-vxm7-hgrqCVSS 3.18.1

JWTKit: Missing aud validation in Apple/Google/Microsoft identity tokens can enable cross-client authentication bypass

Summary

AppleIdentityToken, GoogleIdentityToken, and MicrosoftIdentityToken validate a signed ID token's issuer and expiry, but do not validate that the aud claim is intended for the current application.

This allows cross-client ID token reuse when an application relies on JWTKit's built-in vendor token verification as complete authentication. An attacker can obtain a legitimate Apple/Google/Microsoft ID token for an attacker-controlled OAuth/OIDC client and submit it to a different application using the same provider keys. JWTKit accepts the token even though its aud identifies the attacker's client, not the victim application.

The exact account-level impact depends on how the application maps provider identities, but the security boundary is already broken once a token issued for another relying party is accepted as a verified login token.

Details

JWTSigner.verify() verifies the JWS signature and then automatically calls the payload's verify(using:) method:

  • Sources/JWTKit/JWTSigner.swift:33-39
guard try algorithm.verify(signature, signs: data) else {
    throw JWTError.signatureVerificationFailed
}

let (_, payload, _) = try parser.parse(token, as: Payload.self)
try await payload.verify(using: algorithm)

For the vendor ID token payload types, verify(using:) does not check audience:

  • Sources/JWTKit/Vendor/AppleIdentityToken.swift:85-90 checks only iss and exp
  • Sources/JWTKit/Vendor/GoogleIdentityToken.swift:139-148 checks only iss, sub length, and exp
  • Sources/JWTKit/Vendor/MicrosoftIdentityToken.swift:149-158 checks only tid/iss consistency and exp

The audience fields are decoded and documented as security-relevant, but are never enforced:

  • Apple: audience is documented as the application's client_id
  • Google: audience is documented as one of the application's OAuth client IDs
  • Microsoft: audience is documented as the app's Application ID, with a comment saying: "Your app should validate this value, and reject the token if the value does not match."

This is also inconsistent with the existing Firebase vendor token implementation. FirebaseAuthIdentityToken.verify(using:) derives the Firebase project ID from audience and requires issuer == "https://securetoken.google.com/<projectId>" (Sources/JWTKit/Vendor/FirebaseAuthIdentityToken.swift:122-136). That shows JWTKit already treats audience binding as part of safe vendor-token verification for at least one provider.

OpenID Connect Core ID Token validation requires the relying party to validate that the aud claim contains its own client_id. A valid provider signature only proves that the provider issued the token for some client. It does not prove that the token was issued for this application.

PoC

This PoC uses a local HMAC key only to avoid needing live Apple/Google/Microsoft credentials. The cryptographic signature is not the vulnerable part; the relevant behavior is that after a valid signature, JWTKit's real verify(using:) implementation accepts tokens with attacker-controlled aud values. JWTSigner.verify() invokes payload.verify(using:) after signature verification regardless of which JWT algorithm verified the signature.

Create a temporary SwiftPM executable depending on the local jwt-kit checkout and run this code:

import JWTKit
import Foundation

@main
struct PoC {
    static func main() async throws {
        let keys = JWTKeyCollection()
        await keys.add(hmac: "secret", digestAlgorithm: .sha256)

        let apple = AppleIdentityToken(
            issuer: "https://appleid.apple.com",
            audience: "com.attacker.app",
            expires: .init(value: Date().addingTimeInterval(3600)),
            issuedAt: .init(value: Date()),
            subject: "victim-apple-sub"
        )
        let appleJWT = try await keys.sign(apple)
        _ = try await…
Record
GHSA-gxx9-vxm7-hgrq
CVSS 3.1
8.1 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
Weakness
CWE-287, CWE-345
Updated
2026-12-02

The JSON record also has the rest of 2 source descriptions.

History

Recorded by Every CVE

Changes recorded by Every CVE
DayChangedSources
Published dateEUVD, NVD
ReferencesOSV
Published dateEUVD
Key facts, referencesCVE List
Affected packages, referencesOSV
Other IDs, published dateEUVD
Affected packages, other IDs, key facts, referencesGitHub Advisories, NVD
First indexedCVE List

Upstream dates may differ.

References

MoveEnter Open