CVE-2026-142549: JWTKit: X.509 validation time controlled by unauthenticated JWT payload (certificate expiration bypass)

Published Dec 2, 2026
·
Updated

Summary X5CVerifier.verifyJWS() decodes ValidationTimePayload.signedDate before verifying the JWS signature and uses it as fixedExpiryValidationTime during X.509 certificate validation.

Since 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.

Details Affected Code Sources/JWTKit/X5C/X5CVerifier.swift (certificate validation order) Sources/JWTKit/X5C/ValidationTimePayload.swift

The verification flow is: 1. Parse JWT 2. Decode payload 3. Read signedDate 4. Validate X.509 chain using signedDate 5. Verify JWS signature

This allows untrusted input to influence a security decision before authentication.

PoC Certificate: Not After: 2025-01-01 Current date: 2026-06-01 JWT payload: { "sub": "attacker", "signedDate": "2024-06-01T12:00:00Z" } The token is signed today using the expired private key. During verification: date = payload.signedDate

RFC5280Policy( fixedExpiryValidationTime: date ) The certificate chain is validated against 2024-06-01 instead of the current time, succeeds, and the newly created JWT is accepted.

Impact An 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.

Recommendation

Do 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.

Other sources

JWTKit is a Swift library for signing and verifying JSON Web Tokens. Prior to 5.8.0, X5CVerifier.verifyJWS() in Sources/JWTKit/X5C/X5CVerifier.swift reads ValidationTimePayload.signedDate, defined in Sources/JWTKit/X5C/ValidationTimePayload.swift, from the token payload before verifying the JWS signature. The verifier uses that unauthenticated date as fixedExpiryValidationTime for X.509 certificate validation. An attacker possessing the private key of an expired, previously trusted certificate can backdate the value and cause newly signed tokens to be accepted despite certificate expiration. This issue is fixed in version 5.8.0.

— MITRE

Affected Software

3 affected componentsFixes available
swift/vapor/jwt-kit<5.8.0
swift/github.com/vapor/jwt-kit<=5.7.1
5.8.0
swift/github.com/vapor/jwt-kit<5.8.0
5.8.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade swift/github.com/vapor/jwt-kit to a version that resolves this vulnerability.

    Fixed in 5.8.0
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 5.8.0

Event History

Dec 2, 2026
CVE Published
via MITRE·08:47 PM
Data Sourced
via MITRE·08:47 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:18 PM
DescriptionSeverityWeakness
Advisory Published
via GitHub·10:05 PM
Data Sourced
via GitHub·10:05 PM
DescriptionSeverityWeaknessAffected Software
Data Sourced
via OSV·10:05 PM
Affected Software

Frequently Asked Questions

1

Who is exposed to this issue?

Applications using JWTKit versions earlier than 5.8.0 that verify JWS tokens through X5CVerifier.verifyJWS() are exposed if an attacker has the private key for an expired certificate that was previously trusted by the application.

2

What does an attacker need to exploit the flaw?

The attacker needs possession of the private key corresponding to an expired, previously trusted certificate. They can then sign a new token and supply a backdated signedDate value in the JWT payload to make certificate validation occur at an earlier time.

3

How can this be remediated?

Upgrade JWTKit to version 5.8.0, which fixes the use of the unauthenticated payload date during X.509 certificate validation.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203