Listen to this Post
The vulnerability is a JWT algorithm confusion attack. The `verifyJsonWebToken` method in `SecurityIO.groovy` (lines 244-249) decodes a provided JWT and verifies its signature using the `verifyRS256Base64Url` method. However, it does not validate the “alg” (algorithm) parameter in the JWT header before processing. An attacker can forge a token by changing the header to specify “alg”:”HS256″ (symmetric HMAC) instead of the expected “alg”:”RS256″ (asymmetric RSA). If the system’s public key is known, the attacker can sign the malicious token with this public key as if it were an HMAC secret key. The vulnerable verification method will use the same public key to verify the HMAC signature, incorrectly validating the forged token because it does not enforce that the signing algorithm must be RS256.
Platform: Jervis
Version: Pre-2.2
Vulnerability: JWT Algorithm Confusion
Severity: Moderate
date: 2026-01-13
Prediction: January 2026
What Undercode Say:
openssl genrsa -out /tmp/id_rsa 4096 openssl rsa -in /tmp/id_rsa -pubout -out /tmp/id_rsa.pub
String jwt = security.getGitHubJWT('1234')
Boolean isValid = security.verifyJsonWebToken(jwt)
How Exploit:
1. Attacker obtains the public RSA key.
2. Forges JWT with `”alg”:”HS256″` header.
- Signs token using public key as HMAC secret.
- Submits token; system verifies it with same key.
Protection from this CVE:
Upgrade to Jervis 2.2.
Validate “alg” parameter explicitly.
Use alternative JWT library.
Impact:
Potential JWT forgery.
Unauthorized GitHub API access.
Impact limited to GitHub integration.
🎯Let’s Practice Exploiting & Learn Patching For Free:
Sources:
Reported By: github.com
Extra Source Hub:
Undercode

