CVE-2015-9235: Jsonwebtoken Verification Bypass Vulnerability

CRITICAL
Advisory Identifier: GHSA-c7hr-j4mj-j2w6
CWE-20
Published
Advisory Summary

CVE-2015-9235 is a CRITICAL verification bypass vulnerability (CWE-20: Improper Input Validation) affecting Jsonwebtoken libraries in the npm ecosystem. The issue involves verification bypass in jsonwebtoken. Remediation is available by upgrading affected packages to version 4.2.2.

CVE-2015-9235 at a Glance

CVE Identifier CVE-2015-9235
GHSA Identifier GHSA-c7hr-j4mj-j2w6
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-20: Improper Input Validation
Affected Product Jsonwebtoken
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2015-9235

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

jsonwebtoken fixed: 4.2.2
npm install jsonwebtoken@4.2.2
Verify Direct and Transitive Dependencies

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

npm ls jsonwebtoken

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2015-9235, inspect your project dependencies using npm:

npm ls jsonwebtoken

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

Note: The npm ls jsonwebtoken command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Jsonwebtoken, 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

Versions 4.2.1 and earlier of `jsonwebtoken` are affected by a verification bypass vulnerability. This is a result of weak validation of the JWT algorithm type, occuring when an attacker is allowed to arbitrarily specify the JWT algorithm. ## Recommendation Update to version 4.2.2 or later.

CVE-2015-9235 Affected Jsonwebtoken Versions

1 component(s)
Fixed Versions:
4.2.2
Product / Package Ecosystem Affected Versions Fixed Version
jsonwebtoken
npm
< 4.2.2
4.2.2

References

Frequently Asked Questions

What is CVE-2015-9235?
CVE-2015-9235 is a security vulnerability in Jsonwebtoken involving Verification Bypass in jsonwebtoken under CWE-20: Improper Input Validation.
Which Jsonwebtoken versions are affected?
Affected versions include releases prior to 4.2.2 across affected packages: jsonwebtoken.
What version fixes CVE-2015-9235?
Upgrading to 4.2.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is jsonwebtoken affected?
Yes, jsonwebtoken is affected in releases prior to 4.2.2. Upgrade your dependency to 4.2.2 or later.
What CWE is associated with CVE-2015-9235?
CVE-2015-9235 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check npm dependencies for CVE-2015-9235?
Run the dependency tree command: 'npm ls jsonwebtoken'. 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-c7hr-j4mj-j2w6",
  "modified" : "2020-08-31T18:07:57Z",
  "published" : "2018-10-09T00:38:30Z",
  "aliases" : [ "CVE-2015-9235" ],
  "summary" : "Verification Bypass in jsonwebtoken",
  "details" : "Versions 4.2.1 and earlier of `jsonwebtoken` are affected by a verification bypass vulnerability. This is a result of weak validation of the JWT algorithm type, occuring when an attacker is allowed to arbitrarily specify the JWT algorithm.\n\n\n\n\n## Recommendation\n\nUpdate to version 4.2.2 or later.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "jsonwebtoken"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.2.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2015-9235"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/auth0/node-jsonwebtoken/commit/1bb584bc382295eeb7ee8c4452a673a77a68b687"
  }, {
    "type" : "WEB",
    "url" : "https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-c7hr-j4mj-j2w6"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/17"
  }, {
    "type" : "WEB",
    "url" : "https://www.timmclean.net/2015/02/25/jwt-alg-none.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:30:27Z",
    "nvd_published_at" : null
  }
}