CVE-2026-142549: JWTKit X.509 Validation Time Controlled By Vulnerability

MODERATE
Advisory Identifier: GHSA-pfgx-7g34-46fm
CVSS 4.9
CWE-345
Published
Advisory Summary

CVE-2026-142549 is a MODERATE (CVSS 4.9) x.509 validation time controlled by vulnerability (CWE-345: Insufficient Verification of Data Authenticity) affecting JWTKit libraries in the SwiftURL ecosystem. The issue involves x.509 validation time controlled by unauthenticated jwt payload (certificate expiration bypass). Remediation is available by upgrading affected packages to version 5.8.0.

CVE-2026-142549 at a Glance

CVE Identifier CVE-2026-142549
GHSA Identifier GHSA-pfgx-7g34-46fm
Severity MODERATE
CVSS v3.1 Base Score 4.9
CWE Classification CWE-345: Insufficient Verification of Data Authenticity
Affected Product JWTKit
Package Ecosystem SwiftURL
Published Date
Last Updated

Security Impact

CVSS: 4.9

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-142549

To remediate this vulnerability, upgrade all affected JWTKit dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/vapor/jwt-kit fixed: 5.8.0
Upgrade github.com/vapor/jwt-kit to 5.8.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/vapor/jwt-kit

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-142549, inspect your project dependencies for JWTKit:

inspect dependencies for github.com/vapor/jwt-kit

Analyze the terminal output to locate any version of JWTKit in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.8.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-345: Insufficient Verification of Data Authenticity, where the product does not sufficiently verify the origin or authenticity of data, in a way that causes it to accept invalid data. In JWTKit, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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

CVE-2026-142549 Affected JWTKit Versions

1 component(s)
Fixed Versions:
5.8.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/vapor/jwt-kit
SwiftURL
< 5.8.0
5.8.0

References

Frequently Asked Questions

What is CVE-2026-142549?
CVE-2026-142549 is a security vulnerability in JWTKit involving X.509 validation time controlled by unauthenticated JWT payload (certificate expiration bypass) under CWE-345: Insufficient Verification of Data Authenticity.
Which JWTKit versions are affected?
Affected versions include releases prior to 5.8.0 across affected packages: github.com/vapor/jwt-kit.
What version fixes CVE-2026-142549?
Upgrading to 5.8.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/vapor/jwt-kit affected?
Yes, github.com/vapor/jwt-kit is affected in releases prior to 5.8.0. Upgrade your dependency to 5.8.0 or later.
What is the CVSS score of CVE-2026-142549?
CVE-2026-142549 has a CVSS v3.1 base score of 4.9 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2026-142549?
CVE-2026-142549 is classified under CWE-345: Insufficient Verification of Data Authenticity (The product does not sufficiently verify the origin or authenticity of data, in a way that causes it to accept invalid data.).
How can I check SwiftURL dependencies for CVE-2026-142549?
Run the dependency tree command: 'inspect dependencies for github.com/vapor/jwt-kit'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-pfgx-7g34-46fm",
  "modified" : "2026-12-02T22:05:14Z",
  "published" : "2026-12-02T22:05:14Z",
  "aliases" : [ "CVE-2026-142549" ],
  "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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "SwiftURL",
      "name" : "github.com/vapor/jwt-kit"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.8.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.7.1"
    }
  } ],
  "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"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-345" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-12-02T22:05:14Z",
    "nvd_published_at" : "2026-12-02T21:18:16Z"
  }
}