{"id":"GHSA-pfgx-7g34-46fm","summary":"JWTKit: X.509 validation time controlled by unauthenticated JWT payload (certificate expiration bypass)","details":"### Summary\n X5CVerifier.verifyJWS() decodes ValidationTimePayload.signedDate before verifying the JWS signature and uses it as fixedExpiryValidationTime during X.509 certificate validation.\n\nSince signedDate originates from an unauthenticated payload, an attacker can backdate certificate validation and bypass certificate expiration if they possess the private key of an expired, previously trusted certificate.\n\n### Details\nAffected Code\n* Sources/JWTKit/X5C/X5CVerifier.swift (certificate validation order)\n* Sources/JWTKit/X5C/ValidationTimePayload.swift\n\nThe verification flow is:\n1. Parse JWT\n2. Decode payload\n3. Read signedDate\n4. Validate X.509 chain using signedDate\n5. Verify JWS signature\n\nThis allows untrusted input to influence a security decision before authentication.\n\n### PoC\nCertificate:\n```\nNot After: 2025-01-01\nCurrent date: 2026-06-01\n```\nJWT payload:\n```\n{\n  \"sub\": \"attacker\",\n  \"signedDate\": \"2024-06-01T12:00:00Z\"\n}\n```\nThe token is signed today using the expired private key.\nDuring verification:\n```\ndate = payload.signedDate\n\nRFC5280Policy(\n    fixedExpiryValidationTime: date\n)\n```\nThe certificate chain is validated against 2024-06-01 instead of the current time, succeeds, and the newly created JWT is accepted.\n\n### Impact\nAn attacker with the private key of an expired certificate can generate new JWTs that are accepted by setting signedDate to a time when the certificate was still valid, effectively bypassing certificate expiration.\n\n### Recommendation\n\nDo not derive X.509 validation time from unauthenticated JWT payloads. Validate the certificate chain using the current time (or another trusted source), and only trust signedDate after successful JWS verification.","aliases":["CVE-2026-142549"],"modified":"2026-12-02T22:15:03.903462628Z","published":"2026-12-02T22:05:14Z","database_specific":{"github_reviewed_at":"2026-12-02T22:05:14Z","nvd_published_at":"2026-12-02T21:18:16Z","cwe_ids":["CWE-345"],"severity":"MODERATE","github_reviewed":true},"references":[{"type":"WEB","url":"https://github.com/vapor/jwt-kit/security/advisories/GHSA-pfgx-7g34-46fm"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-142549"},{"type":"WEB","url":"https://github.com/vapor/jwt-kit/commit/8229a0aff8e60ab89f40839db4ea3e847a79bfa5"},{"type":"PACKAGE","url":"https://github.com/vapor/jwt-kit"},{"type":"WEB","url":"https://github.com/vapor/jwt-kit/releases/tag/5.8.0"}],"affected":[{"package":{"name":"github.com/vapor/jwt-kit","ecosystem":"SwiftURL","purl":"pkg:swift/github.com/vapor/jwt-kit"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"5.8.0"}]}],"database_specific":{"last_known_affected_version_range":"\u003c= 5.7.1","source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-pfgx-7g34-46fm/GHSA-pfgx-7g34-46fm.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:N"}]}