Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2025-65945-poc — PoC for CVE-2025-65945 (Improper Verification of Cryptographic Signature in node-jws) | Kitploit
Tools/GitHubGitHub/jedisct1/cve-2025-65945-poc
Vulnerability AnalysisExploitationWeb Application ExploitationCryptographyPenetration TestingAuthentication
GitHubjedisct1/cve-2025-65945-poc

CVE-2025-65945-poc

PoC for CVE-2025-65945 (Improper Verification of Cryptographic Signature in node-jws)

View Repository
513311 months agoNot yet reviewed
Share

CVE-2025-65945: node-jws Signature Bypass

This is a proof of concept for a signature verification bypass in the node-jws library. The bug lets attackers forge valid JWTs when the server derives HMAC secrets from user-controlled data.

What's the bug?

The jws.createVerify() function doesn't validate that a secret was actually provided when using HMAC algorithms. If your app looks up secrets based on something in the JWT (like a kid header) and that lookup fails, you might end up verifying against an empty secret.

An attacker can exploit this by:

  1. Sending a JWT with a fake key ID that doesn't exist in your database
  2. Signing their malicious payload with an empty string as the secret
  3. Your server's lookup returns undefined, which gets coerced to empty string
  4. Both sides now agree on the "secret" (empty string), so the signature validates

The attacker can now impersonate anyone or grant themselves admin privileges.

Affected versions

  • jws 3.2.2 and earlier
  • jws 4.0.0

Upgrade to 3.2.3+ or 4.0.1+ to fix this.

Running the PoC

Make sure you have Bun installed, then:

# Install the vulnerable version
bun install [email protected]

# Run the exploit
bun run exploit.js

You should see output showing a forged admin token being accepted as valid.

What does the exploit do?

The PoC simulates a server that:

  • Has a secret store with a couple of API keys
  • Looks up secrets based on the JWT's kid (key ID) header
  • Uses createVerify() with the streaming API

The attacker creates a JWT with kid: "non-existent-key" and signs it with an empty secret. When the server tries to look up this key, it gets undefined, writes an empty string to the verification stream, and the forged token passes validation.

Testing the fix

# Upgrade to patched version
bun install [email protected]

# Run again - should fail now
bun run exploit.js

With the patched version, you'll see an error: secret must be a string or buffer or a KeyObject. The fix validates that HMAC operations have a proper secret before proceeding.

The vulnerable code pattern

If your code looks anything like this, you might be affected:

const decoded = jws.decode(token);
const secret = lookupSecret(decoded.header.kid); // might return undefined!

const verifier = jws.createVerify({
  algorithm: "HS256",
  signature: token,
});

verifier.secret.write(secret); // oops
verifier.secret.end();

References

  • GitHub Advisory
  • Fix commit
Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    837
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    536
  • 3

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    424
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    355
  • 5

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    294
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    276

Explore all tools

Browse our collection of tools

View all tools →