Skip to content

VNX-347: Improper Verification of Cryptographic Signature

A signature or MAC check whose result is discarded, or whose failure is caught and swallowed, so forged data is processed as genuine. Java, Go, JavaScript/TypeScript and Python.

Updated 02 Nov 2026Checked against cli@de9b52a
Field Value
Rule ID VNX-347
Severity High
SARIF level error
Kind sast
Languages Go, Java, JavaScript / TypeScript, Python
CWE CWE-347
CAPEC CAPEC-66
ATT&CK T1190
CWSS vector CWSS:1.0/TI:H/AP:A/AL:A/IC:N/FC:LT/RP:N/RL:A/AV:I/AS:N/IN:A/SC:A/BI:H/DI:H/EX:H/EC:N/P:H
Tags signature crypto cwe-347
Source internal/sast/rules/vnx-347.rego

Overview

VNX-347 maps to CWE-347: Improper Verification of Cryptographic Signature. It reports code that runs a signature or MAC check and then ignores the outcome:

  • Result discarded (the call is a bare statement): Java java.security.Signature.verify(); Go ed25519.Verify, ecdsa.Verify/VerifyASN1, hmac.Equal, subtle.ConstantTimeCompare, rsa.VerifyPKCS1v15/VerifyPSS (also assigned to _); Node.js verify() on a createVerify() object, crypto.verify() without a callback, crypto.timingSafeEqual(), crypto.subtle.verify(), the jws package’s boolean jws.verify(); Python hmac.compare_digest().
  • Failure swallowed: Python except InvalidSignature/BadSignature/BadSignatureError/InvalidSignatureError (or a bare/Exception handler around a .verify() statement) whose body is only pass, ... or a log call; Java catch (SignatureException | SignatureVerificationException | InvalidSignatureException | JWTVerificationException | JwtException ...) (or Exception around a .verify() statement) whose block is empty or only logs.

Why This Matters

A verification that nobody checks is no verification: a forged update, webhook, licence or token is accepted exactly as a genuine one. The bug survives review because the verify call is visibly there.

Not reported: a Python handler whose try body only assigns the verified value to names set to None/False/empty just above it (user_id = None; try: user_id = s.loads(v) except BadSignature: pass fails closed; a default holding the unverified input is still reported); results that are tested, assigned, returned or passed on (including an assignment split over two lines); calls that throw on failure (jsonwebtoken jwt.verify, auth0 JWTVerifier.verify) outside a swallowing handler; crypto.verify with a callback; handlers that raise, return or rethrow; empty catches around code that verifies nothing; comments and string literals. Disabled TLS certificate validation is VNX-CRYPTO-005’s concern and disabled JWT verification VNX-JWT-001’s.

What Gets Flagged

sig.update(payload);
sig.verify(sigBytes);
return payload;
ed25519.Verify(pub, body, sig)
_ = rsa.VerifyPKCS1v15(pub, crypto.SHA256, digest, sig)
verifier.verify(publicKey, signature, "base64");
crypto.timingSafeEqual(digest, Buffer.from(req.get("X-Signature"), "hex"));
try:
    public_key.verify(signature, blob)
except InvalidSignature:
    pass

Remediation

  1. Test the result and stop on failure: if (!sig.verify(s)) throw ..., if !ed25519.Verify(...) { return err }, if not hmac.compare_digest(...): abort(401).
  2. In a handler for a signature failure, reject the input: raise, return an error, or abort the request.

References

Suppressing this rule

Put a nosec comment on the line, or on line 1 to cover the whole file. Use the comment marker of the file’s language (#, //, -- or ;):

# nosec vnx-347
// nosec vnx-347

Or record an ignore rule: vulnetix ignore add --rule vnx-347 --reason "...". See Suppressing findings.

Edit this pageSources: cli/internal/sast/rules/vnx-347.rego, cli/internal/sast/docs/vnx-347.md
esc
↑ ↓ move↵ openSearches in your browser. A key like autonomy.max or a code like threshold_required jumps straight to it.