{"id":"CVE-2026-142551","aliases":["EUVD-2026-141870","GHSA-gxx9-vxm7-hgrq"],"status":"published","title":"JWTKit: Missing aud validation in Apple/Google/Microsoft identity tokens can enable cross-client authentication bypass","description":"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.","severity":{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-12-04","score":0.00449,"percentile":0.40764,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true,"poc_reported":true},"cwes":["CWE-287","CWE-345"],"published":"2026-12-02T20:54:52Z","modified":"2026-12-03T21:00:14Z","fixes":[{"ecosystem":"SwiftURL","package":"github.com/vapor/jwt-kit","fixed_in":["5.8.0"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"SwiftURL","package":"github.com/vapor/jwt-kit","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.0.0"},{"last_affected":"5.7.1"},{"fixed":"5.8.0"}]}]},{"source":"osv","ecosystem":"SwiftURL","package":"github.com/vapor/jwt-kit","ranges":[{"type":"SEMVER","events":[{"introduced":"4.0.0"},{"fixed":"5.8.0"}]}]}],"products":[{"vendor":"vapor","product":"jwt-kit"}],"references":[{"url":"https://github.com/vapor/jwt-kit/security/advisories/GHSA-gxx9-vxm7-hgrq","tags":["x_refsource_CONFIRM","exploit","advisory","web"]},{"url":"https://github.com/vapor/jwt-kit/commit/a1551090db2a3bd86f0482622e2d201c199e75ad","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/vapor/jwt-kit/releases/tag/5.8.0","tags":["x_refsource_MISC","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-142551","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-gxx9-vxm7-hgrq"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/142xxx/CVE-2026-142551.json","tags":["advisory"]},{"url":"https://github.com/vapor/jwt-kit","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2026-142551","title":"JWTKit: Missing aud validation in Apple/Google/Microsoft identity tokens can enable cross-client authentication bypass","description":"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.","status":"published","published":"2026-12-02T20:54:52.923Z","modified":"2026-12-02T23:02:51.688Z","cvss":[{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N","level":"high","assessor":"cna"}],"cwes":["CWE-287","CWE-345"],"ssvc":{"exploitation":"poc","automatable":"no","technical_impact":"total","date":"2026-12-02"},"updated_at":"2026-12-02T23:23:06.228509Z"}],"euvd":[{"id":"EUVD-2026-141870","description":"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.","status":"published","published":"2026-12-02T20:54:52Z","modified":"2026-12-02T23:02:51Z","cvss":[{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N","level":"high"}],"updated_at":"2026-12-03T00:28:21.623185Z"}],"ghsa":[{"id":"GHSA-gxx9-vxm7-hgrq","title":"JWTKit: Missing aud validation in Apple/Google/Microsoft identity tokens can enable cross-client authentication bypass","description":"### Summary\n\n`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.\n\nThis 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.\n\nThe 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.\n\n### Details\n\n`JWTSigner.verify()` verifies the JWS signature and then automatically calls the payload's `verify(using:)` method:\n\n- `Sources/JWTKit/JWTSigner.swift:33-39`\n\n```swift\nguard try algorithm.verify(signature, signs: data) else {\n    throw JWTError.signatureVerificationFailed\n}\n\nlet (_, payload, _) = try parser.parse(token, as: Payload.self)\ntry await payload.verify(using: algorithm)\n```\n\nFor the vendor ID token payload types, `verify(using:)` does not check `audience`:\n\n- `Sources/JWTKit/Vendor/AppleIdentityToken.swift:85-90` checks only `iss` and `exp`\n- `Sources/JWTKit/Vendor/GoogleIdentityToken.swift:139-148` checks only `iss`, `sub` length, and `exp`\n- `Sources/JWTKit/Vendor/MicrosoftIdentityToken.swift:149-158` checks only `tid`/`iss` consistency and `exp`\n\nThe audience fields are decoded and documented as security-relevant, but are never enforced:\n\n- Apple: `audience` is documented as the application's `client_id`\n- Google: `audience` is documented as one of the application's OAuth client IDs\n- 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.\"\n\nThis 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/\u003cprojectId\u003e\"` (`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.\n\n[OpenID Connect Core ID Token validation](https://openid.net/specs/openid-connect-core-1_0.html#IDTokenValidation) 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.\n\n### PoC\n\nThis 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.\n\nCreate a temporary SwiftPM executable depending on the local `jwt-kit` checkout and run this code:\n\n```swift\nimport JWTKit\nimport Foundation\n\n@main\nstruct PoC {\n    static func main() async throws {\n        let keys = JWTKeyCollection()\n        await keys.add(hmac: \"secret\", digestAlgorithm: .sha256)\n\n        let apple = AppleIdentityToken(\n            issuer: \"https://appleid.apple.com\",\n            audience: \"com.attacker.app\",\n            expires: .init(value: Date().addingTimeInterval(3600)),\n            issuedAt: .init(value: Date()),\n            subject: \"victim-apple-sub\"\n        )\n        let appleJWT = try await keys.sign(apple)\n        _ = try await keys.verify(appleJWT, as: AppleIdentityToken.self)\n        print(\"Apple token accepted with aud=com.attacker.app\")\n\n        let wrongIssuer = AppleIdentityToken(\n            issuer: \"https://attacker.example\",\n            audience: \"com.attacker.app\",\n            expires: .init(value: Date().addingTimeInterval(3600)),\n            issuedAt: .init(value: Date()),\n            subject: \"victim-apple-sub\"\n        )\n        let wrongIssuerJWT = try await keys.sign(wrongIssuer)\n        do {\n            _ = try await keys.verify(wrongIssuerJWT, as: AppleIdentityToken.self)\n            fatalError(\"Apple token with wrong issuer was unexpectedly accepted\")\n        } catch {\n            print(\"Apple wrong-issuer control was rejected\")\n        }\n\n        let google = GoogleIdentityToken(\n            issuer: \"https://accounts.google.com\",\n            subject: \"victim-google-sub\",\n            audience: \"attacker-client.apps.googleusercontent.com\",\n            authorizedPresenter: \"attacker-client.apps.googleusercontent.com\",\n            issuedAt: .init(value: Date()),\n            expires: .init(value: Date().addingTimeInterval(3600))\n        )\n        let googleJWT = try await keys.sign(google)\n        _ = try await keys.verify(googleJWT, as: GoogleIdentityToken.self)\n        print(\"Google token accepted with attacker client audience\")\n\n        let tenant = \"11111111-2222-3333-4444-555555555555\"\n        let microsoft = MicrosoftIdentityToken(\n            audience: \"00000000-1111-2222-3333-444444444444\",\n            issuer: .init(value: \"https://login.microsoftonline.com/\\(tenant)/v2.0\"),\n            issuedAt: .init(value: Date()),\n            identityProvider: nil,\n            notBefore: .init(value: Date()),\n            expires: .init(value: Date().addingTimeInterval(3600)),\n            codeHash: nil,\n            accessTokenHash: nil,\n            preferredUsername: \"victim@example.com\",\n            email: nil,\n            name: nil,\n            nonce: nil,\n            objectId: \"victim-object-id\",\n            roles: nil,\n            subject: \"victim-ms-sub\",\n            tenantId: .init(value: tenant),\n            uniqueName: nil,\n            version: \"2.0\"\n        )\n        let microsoftJWT = try await keys.sign(microsoft)\n        _ = try await keys.verify(microsoftJWT, as: MicrosoftIdentityToken.self)\n        print(\"Microsoft token accepted with attacker app audience\")\n    }\n}\n```\n\nExpected result: all three wrong-audience `verify` calls succeed, while the wrong-issuer control is rejected. This shows that vendor claim verification is running, but audience validation is missing. If the `aud` claim were enforced against the current application's configured client ID, each wrong-audience token should be rejected.\n\nIn a real attack, the attacker does not forge provider signatures. They register their own OAuth/OIDC client, get the real provider to issue a valid ID token with `aud` set to that attacker client, then submit that token to a different application that uses JWTKit's vendor token type for login.\n\n### Impact\n\nApplications are impacted if they use `JWTKeyCollection.verify(..., as: AppleIdentityToken.self)`, `GoogleIdentityToken.self`, or `MicrosoftIdentityToken.self` as the authentication decision and do not perform a separate manual `audience.verifyIntendedAudience(...)` check.\n\nFor those applications, a token issued for the attacker's client can be accepted by the victim application as long as issuer, signature, and expiry are valid. Depending on the provider and the application's account-linking logic, this can become authentication bypass or account takeover. Applications that already perform their own explicit audience check are not vulnerable through this issue.\n\n### Suggested fix\n\nThe vendor token verification APIs need an expected audience from the caller. Possible fixes:\n\n1. Add provider-specific verifier/configuration APIs that require the expected client ID/application ID and validate `aud` before returning a verified payload.\n2. Add tests asserting that Apple, Google, and Microsoft tokens with a valid signature but wrong `aud` are rejected by the recommended verification path.\n3. For Google/OIDC multi-audience tokens, also follow the `azp` validation rules when applicable.\n\nAt minimum, the safe path should make it difficult to receive an `AppleIdentityToken`, `GoogleIdentityToken`, or `MicrosoftIdentityToken` from JWTKit verification without binding it to the caller's configured audience.","status":"published","published":"2026-12-02T21:55:43Z","modified":"2026-12-02T21:55:44Z","cvss":[{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N","level":"high"}],"cwes":["CWE-287","CWE-345"],"updated_at":"2026-12-02T22:10:03.084741Z"}],"nvd":[{"id":"CVE-2026-142551","description":"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.","status":"published","published":"2026-12-02T21:18:16.88Z","modified":"2026-12-03T00:18:07.333Z","cvss":[{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N","level":"high","assessor":"secondary"}],"cwes":["CWE-287","CWE-345"],"ssvc":{"exploitation":"poc","automatable":"no","technical_impact":"total","date":"2026-12-02"},"updated_at":"2026-12-03T00:20:05.019864Z"}],"osv":[{"id":"CVE-2026-142551","title":"JWTKit: Missing aud validation in Apple/Google/Microsoft identity tokens can enable cross-client authentication bypass","description":"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.","status":"published","published":"2026-12-02T20:54:52.923Z","modified":"2026-12-03T21:00:14.944523876Z","cvss":[{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N","level":"high"}],"cwes":["CWE-287","CWE-345"],"updated_at":"2026-12-03T21:10:28.714974Z"},{"id":"GHSA-gxx9-vxm7-hgrq","title":"JWTKit: Missing aud validation in Apple/Google/Microsoft identity tokens can enable cross-client authentication bypass","description":"### Summary\n\n`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.\n\nThis 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.\n\nThe 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.\n\n### Details\n\n`JWTSigner.verify()` verifies the JWS signature and then automatically calls the payload's `verify(using:)` method:\n\n- `Sources/JWTKit/JWTSigner.swift:33-39`\n\n```swift\nguard try algorithm.verify(signature, signs: data) else {\n    throw JWTError.signatureVerificationFailed\n}\n\nlet (_, payload, _) = try parser.parse(token, as: Payload.self)\ntry await payload.verify(using: algorithm)\n```\n\nFor the vendor ID token payload types, `verify(using:)` does not check `audience`:\n\n- `Sources/JWTKit/Vendor/AppleIdentityToken.swift:85-90` checks only `iss` and `exp`\n- `Sources/JWTKit/Vendor/GoogleIdentityToken.swift:139-148` checks only `iss`, `sub` length, and `exp`\n- `Sources/JWTKit/Vendor/MicrosoftIdentityToken.swift:149-158` checks only `tid`/`iss` consistency and `exp`\n\nThe audience fields are decoded and documented as security-relevant, but are never enforced:\n\n- Apple: `audience` is documented as the application's `client_id`\n- Google: `audience` is documented as one of the application's OAuth client IDs\n- 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.\"\n\nThis 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/\u003cprojectId\u003e\"` (`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.\n\n[OpenID Connect Core ID Token validation](https://openid.net/specs/openid-connect-core-1_0.html#IDTokenValidation) 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.\n\n### PoC\n\nThis 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.\n\nCreate a temporary SwiftPM executable depending on the local `jwt-kit` checkout and run this code:\n\n```swift\nimport JWTKit\nimport Foundation\n\n@main\nstruct PoC {\n    static func main() async throws {\n        let keys = JWTKeyCollection()\n        await keys.add(hmac: \"secret\", digestAlgorithm: .sha256)\n\n        let apple = AppleIdentityToken(\n            issuer: \"https://appleid.apple.com\",\n            audience: \"com.attacker.app\",\n            expires: .init(value: Date().addingTimeInterval(3600)),\n            issuedAt: .init(value: Date()),\n            subject: \"victim-apple-sub\"\n        )\n        let appleJWT = try await keys.sign(apple)\n        _ = try await keys.verify(appleJWT, as: AppleIdentityToken.self)\n        print(\"Apple token accepted with aud=com.attacker.app\")\n\n        let wrongIssuer = AppleIdentityToken(\n            issuer: \"https://attacker.example\",\n            audience: \"com.attacker.app\",\n            expires: .init(value: Date().addingTimeInterval(3600)),\n            issuedAt: .init(value: Date()),\n            subject: \"victim-apple-sub\"\n        )\n        let wrongIssuerJWT = try await keys.sign(wrongIssuer)\n        do {\n            _ = try await keys.verify(wrongIssuerJWT, as: AppleIdentityToken.self)\n            fatalError(\"Apple token with wrong issuer was unexpectedly accepted\")\n        } catch {\n            print(\"Apple wrong-issuer control was rejected\")\n        }\n\n        let google = GoogleIdentityToken(\n            issuer: \"https://accounts.google.com\",\n            subject: \"victim-google-sub\",\n            audience: \"attacker-client.apps.googleusercontent.com\",\n            authorizedPresenter: \"attacker-client.apps.googleusercontent.com\",\n            issuedAt: .init(value: Date()),\n            expires: .init(value: Date().addingTimeInterval(3600))\n        )\n        let googleJWT = try await keys.sign(google)\n        _ = try await keys.verify(googleJWT, as: GoogleIdentityToken.self)\n        print(\"Google token accepted with attacker client audience\")\n\n        let tenant = \"11111111-2222-3333-4444-555555555555\"\n        let microsoft = MicrosoftIdentityToken(\n            audience: \"00000000-1111-2222-3333-444444444444\",\n            issuer: .init(value: \"https://login.microsoftonline.com/\\(tenant)/v2.0\"),\n            issuedAt: .init(value: Date()),\n            identityProvider: nil,\n            notBefore: .init(value: Date()),\n            expires: .init(value: Date().addingTimeInterval(3600)),\n            codeHash: nil,\n            accessTokenHash: nil,\n            preferredUsername: \"victim@example.com\",\n            email: nil,\n            name: nil,\n            nonce: nil,\n            objectId: \"victim-object-id\",\n            roles: nil,\n            subject: \"victim-ms-sub\",\n            tenantId: .init(value: tenant),\n            uniqueName: nil,\n            version: \"2.0\"\n        )\n        let microsoftJWT = try await keys.sign(microsoft)\n        _ = try await keys.verify(microsoftJWT, as: MicrosoftIdentityToken.self)\n        print(\"Microsoft token accepted with attacker app audience\")\n    }\n}\n```\n\nExpected result: all three wrong-audience `verify` calls succeed, while the wrong-issuer control is rejected. This shows that vendor claim verification is running, but audience validation is missing. If the `aud` claim were enforced against the current application's configured client ID, each wrong-audience token should be rejected.\n\nIn a real attack, the attacker does not forge provider signatures. They register their own OAuth/OIDC client, get the real provider to issue a valid ID token with `aud` set to that attacker client, then submit that token to a different application that uses JWTKit's vendor token type for login.\n\n### Impact\n\nApplications are impacted if they use `JWTKeyCollection.verify(..., as: AppleIdentityToken.self)`, `GoogleIdentityToken.self`, or `MicrosoftIdentityToken.self` as the authentication decision and do not perform a separate manual `audience.verifyIntendedAudience(...)` check.\n\nFor those applications, a token issued for the attacker's client can be accepted by the victim application as long as issuer, signature, and expiry are valid. Depending on the provider and the application's account-linking logic, this can become authentication bypass or account takeover. Applications that already perform their own explicit audience check are not vulnerable through this issue.\n\n### Suggested fix\n\nThe vendor token verification APIs need an expected audience from the caller. Possible fixes:\n\n1. Add provider-specific verifier/configuration APIs that require the expected client ID/application ID and validate `aud` before returning a verified payload.\n2. Add tests asserting that Apple, Google, and Microsoft tokens with a valid signature but wrong `aud` are rejected by the recommended verification path.\n3. For Google/OIDC multi-audience tokens, also follow the `azp` validation rules when applicable.\n\nAt minimum, the safe path should make it difficult to receive an `AppleIdentityToken`, `GoogleIdentityToken`, or `MicrosoftIdentityToken` from JWTKit verification without binding it to the caller's configured audience.","status":"published","published":"2026-12-02T21:55:43Z","modified":"2026-12-02T22:00:04.059416426Z","cvss":[{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N","level":"high"}],"cwes":["CWE-287","CWE-345"],"updated_at":"2026-12-02T22:30:21.249332Z"}]}}
