Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1325 CNY

100%

CVE-2015-9235 PoC — jsonwebtoken node模块安全漏洞

Source
Associated Vulnerability
Title:jsonwebtoken node模块安全漏洞 (CVE-2015-9235)
Description:In jsonwebtoken node module before 4.2.2 it is possible for an attacker to bypass verification when a token digitally signed with an asymmetric key (RS/ES family) of algorithms but instead the attacker send a token digitally signed with a symmetric algorithm (HS* family).
Description
JWT Key Confusion PoC (CVE-2015-9235) Written for the Hack the Box challenge - Under Construction
Readme
# JWT Key Confusion PoC (CVE-2015-9235)

Written for the Hack the Box challenges - Under Construction and Secret

Both included scripts perform a Java Web Token Key Confusion Attack (CVE-2015-9235).

To perform the attack it is required that the attacker know the public key which the server will use to verify the signature as well as the server being configured to use the HS256 algorithm. Because HS256 is a symmetric-key algorithm (the same key is used to sign and verify the message), we can use the public key to sign our tampered token. 
Since the web server knows the public key, when it receives the tampered token it will be able to verify it. 

## Screenshot

![jwt_confusion](https://user-images.githubusercontent.com/6628565/149454773-86c5f286-e411-42be-ab83-a79205ae0373.png)

## Usage


```python3 jwt-9235.py [-h] [token_location] [claim_key] [claim_value]```

```
positional arguments:
  token_location  location of JWT token (must include 'pk' payload)
  claim_key       payload claim to target
  claim_value     new claim value

optional arguments:
  -h, --help      show this help message and exit
```
If no arguments are provided the application will look for a token file ```./token```, target the ```username``` claim, and replace the claim value with ```‘ or 1=1;–```

## Requirements

```pip install hashlib hmac base64 json argparse colorama```
File Snapshot

Log in to view the POC file snapshot cached by Shenlong Bot

Log in to view
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →