Skip to content

    Type a page, a command such as keryn scan, or a rule id.

    crypto-claim-integrity-v1

    View as Markdown

    15 rules · Keryn Software Licence · rules 0.8.0 · all packs

    How to read a rule
    Severity
    How bad the finding is if it is real: error fails a default gate, warning and info do not.
    Confidence
    P0 exploitable as written; P1 dangerous in context; P2 a heuristic or a posture check: confirm by reading the code.
    False-positive risk
    low: an exact API or flag, so hits are almost always real; medium: the pattern is legitimate in many programs, so check each hit; high: it finds a lead to confirm, so expect benign hits.
    Edge
    The relationship the finding sits on. reaches: content or traffic gets to a thing; calls: one thing invokes another; reads: one thing reads from another; writes: one thing writes to another; sends: data leaves for another party; grants: authority is given or left unchecked; depends_on: something relies on a component it does not verify; trusts: one party believes another without evidence. The boundary it crosses, when there is one: user->prompt (untrusted input reaching a prompt); model->code (model output reaching code, a shell, a query or a page); secret->outside (a secret leaving the trusted side); supply-chain (code, models or prompts pulled in from outside).
    Taxonomy chips
    References for readers who work in OWASP LLM 2025, OWASP Agentic, CWE or NIST AI RMF. They say where a rule belongs, not that a framework is satisfied.

    keryn.cryptoclaim.py.jwt-verification-disabled

    Section titled “keryn.cryptoclaim.py.jwt-verification-disabled”

    error python python, pyjwt, python-jose

    A JWT is decoded with signature verification disabled (options verify_signature False, verify False, or algorithms including “none”). Anyone can forge claims, including identity and role. Verify the signature with a fixed allow-list of asymmetric or HMAC algorithms and reject “none”.

    Confidence P0: exploitable as written. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: trusts one party believes another without evidence.

    CWE-347 CWE-345 LLM06 ASI03

    Fix: Call jwt.decode with a key and an explicit algorithms allow-list of the exact algorithm you issue (for example [“RS256”] or [“EdDSA”]); never include “none” and never set verify_signature or verify to False outside tests.

    References: https://pyjwt.readthedocs.io/en/stable/api.html#jwt.decode · https://cwe.mitre.org/data/definitions/347.html

    error python python, pycryptodome, cryptography

    A cipher is created in ECB mode. ECB encrypts each block independently, so equal plaintext blocks produce equal ciphertext and blocks can be reordered or spliced — fatal for tokens, badges or claim blobs. Use an authenticated mode (AES-GCM or ChaCha20-Poly1305).

    Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: trusts one party believes another without evidence.

    CWE-327 CWE-1240 LLM06 ASI03

    Fix: Replace ECB with an AEAD construction (AES-GCM or ChaCha20-Poly1305) that provides confidentiality and integrity, and bind the associated data (purpose, principal, expiry).

    References: https://cwe.mitre.org/data/definitions/327.html · https://cryptography.io/en/latest/hazmat/primitives/symmetric-encryption/

    keryn.cryptoclaim.ts.jwt-verification-disabled

    Section titled “keryn.cryptoclaim.ts.jwt-verification-disabled”

    error typescript, javascript typescript, nodejs, jsonwebtoken

    A JWT is verified with the “none” algorithm allowed (or only decoded, not verified). Anyone can forge claims. Verify with an explicit algorithms allow-list of the exact algorithm you issue and reject “none”.

    Confidence P0: exploitable as written. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: trusts one party believes another without evidence.

    CWE-347 CWE-345 LLM06 ASI03

    Fix: Call jwt.verify with a key and options.algorithms set to the exact algorithm you issue (for example [“RS256”]); never include “none”.

    References: https://github.com/auth0/node-jsonwebtoken#jwtverifytoken-secretorpublickey-options-callback · https://cwe.mitre.org/data/definitions/347.html

    error typescript, javascript typescript, nodejs

    A cipher is created in ECB mode (createCipheriv/createDecipheriv with an aes-*-ecb algorithm). ECB encrypts each block independently, so blocks can be reordered or spliced — fatal for tokens or claim blobs. Use an authenticated mode such as aes-256-gcm.

    Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: trusts one party believes another without evidence.

    CWE-327 CWE-1240 LLM06 ASI03

    Fix: Use an AEAD algorithm (aes-256-gcm or chacha20-poly1305) and verify the auth tag on decrypt; bind associated data (purpose, principal, expiry).

    References: https://nodejs.org/api/crypto.html#cryptocreatecipherivalgorithm-key-iv-options · https://cwe.mitre.org/data/definitions/327.html

    keryn.cryptoclaim.java.jwt-verification-disabled

    Section titled “keryn.cryptoclaim.java.jwt-verification-disabled”

    error java java, java-jwt, jjwt

    A JWT is handled with the “none” algorithm (Algorithm.none) or parsed as an unsigned JWT (parseClaimsJwt), so its signature is not verified and claims can be forged. Verify with a fixed algorithm (HMAC/RSA/EC) and reject unsigned tokens.

    Confidence P0: exploitable as written. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: trusts one party believes another without evidence.

    CWE-347 CWE-345 LLM06 ASI03

    Fix: Use a concrete Algorithm (Algorithm.HMAC256, RSA256, …) with JWT.require(…).build().verify(token), or jjwt parseSignedClaims with a verification key; never Algorithm.none or parseClaimsJwt.

    References: https://github.com/auth0/java-jwt · https://cwe.mitre.org/data/definitions/347.html

    keryn.cryptoclaim.go.jwt-verification-disabled

    Section titled “keryn.cryptoclaim.go.jwt-verification-disabled”

    error go go, golang-jwt

    A JWT is handled with the unsafe “none” signing method (jwt.SigningMethodNone / jwt.UnsafeAllowNoneSignatureType), so its signature is not verified. Parse with jwt.WithValidMethods listing only the algorithm you issue and reject “none”.

    Confidence P0: exploitable as written. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: trusts one party believes another without evidence.

    CWE-347 CWE-345 LLM06 ASI03

    Fix: Call jwt.Parse with jwt.WithValidMethods([]string{“RS256”}) (or your exact algorithm) and a keyfunc that checks token.Method; never use SigningMethodNone / UnsafeAllowNoneSignatureType.

    References: https://pkg.go.dev/github.com/golang-jwt/jwt/v5 · https://cwe.mitre.org/data/definitions/347.html

    keryn.cryptoclaim.php.jwt-verification-disabled

    Section titled “keryn.cryptoclaim.php.jwt-verification-disabled”

    error php php, firebase-php-jwt

    A JWT is decoded allowing the “none” algorithm, so its signature is not verified and claims can be forged. Decode with the single algorithm you issue and a real key; never allow “none”.

    Confidence P0: exploitable as written. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: trusts one party believes another without evidence.

    CWE-347 CWE-345 LLM06 ASI03

    Fix: Pass a Firebase\JWT\Key with the exact algorithm you issue (for example new Key($key, ‘RS256’)) and never ‘none’.

    References: https://github.com/googleapis/php-jwt · https://cwe.mitre.org/data/definitions/347.html

    keryn.cryptoclaim.cs.jwt-verification-disabled

    Section titled “keryn.cryptoclaim.cs.jwt-verification-disabled”

    error csharp csharp, dotnet, microsoft-identitymodel

    JWT validation is configured to accept unsigned tokens (RequireSignedTokens = false) or to skip signing-key validation (ValidateIssuerSigningKey = false), so claims can be forged. Keep both true and set ValidAlgorithms to the exact algorithm you issue.

    Confidence P0: exploitable as written. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: trusts one party believes another without evidence.

    CWE-347 CWE-345 LLM06 ASI03

    Fix: Leave RequireSignedTokens and ValidateIssuerSigningKey true, set IssuerSigningKey to your key, and set ValidAlgorithms to the single algorithm you issue.

    References: https://learn.microsoft.com/en-us/dotnet/api/microsoft.identitymodel.tokens.tokenvalidationparameters · https://cwe.mitre.org/data/definitions/347.html

    keryn.cryptoclaim.java.ecb-mode-for-claims

    Section titled “keryn.cryptoclaim.java.ecb-mode-for-claims”

    error java java

    A Cipher is requested in ECB mode. ECB encrypts each block independently, so blocks can be reordered or spliced — fatal for tokens or claim blobs. Use an authenticated mode (AES/GCM).

    Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: trusts one party believes another without evidence.

    CWE-327 CWE-1240 LLM06 ASI03

    Fix: Request an AEAD transformation (AES/GCM/NoPadding) and verify the tag on decrypt; bind associated data (purpose, principal, expiry).

    References: https://docs.oracle.com/en/java/javase/17/docs/api/java.base/javax/crypto/Cipher.html · https://cwe.mitre.org/data/definitions/327.html

    error go go

    An ECB block mode is constructed (NewECBEncrypter/NewECBDecrypter). ECB encrypts each block independently, so blocks can be reordered or spliced. Use an AEAD construction (crypto/cipher GCM) instead.

    Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: trusts one party believes another without evidence.

    CWE-327 CWE-1240 LLM06 ASI03

    Fix: Use cipher.NewGCM over an AES block and seal/open with a unique nonce; bind associated data.

    References: https://pkg.go.dev/crypto/cipher#NewGCM · https://cwe.mitre.org/data/definitions/327.html

    error php php

    openssl_encrypt is called with an ECB cipher. ECB encrypts each block independently, so blocks can be reordered or spliced — fatal for tokens or claim blobs. Use aes-256-gcm with the tag.

    Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: trusts one party believes another without evidence.

    CWE-327 CWE-1240 LLM06 ASI03

    Fix: Use an AEAD cipher (aes-256-gcm) and capture and verify the authentication tag; bind AAD.

    References: https://www.php.net/manual/en/function.openssl-encrypt.php · https://cwe.mitre.org/data/definitions/327.html

    error csharp csharp, dotnet

    A symmetric cipher’s Mode is set to CipherMode.ECB. ECB encrypts each block independently, so blocks can be reordered or spliced — fatal for tokens or claim blobs. Use AES-GCM (AesGcm).

    Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: trusts one party believes another without evidence.

    CWE-327 CWE-1240 LLM06 ASI03

    Fix: Use the AesGcm class (or another AEAD) and verify the tag on decrypt; bind associated data.

    References: https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.ciphermode · https://cwe.mitre.org/data/definitions/327.html

    keryn.cryptoclaim.kotlin.jwt-verification-disabled

    Section titled “keryn.cryptoclaim.kotlin.jwt-verification-disabled”

    error kotlin kotlin, android, java-jwt, jjwt

    A JWT is handled with the “none” algorithm (Algorithm.none) or parsed as an unsigned JWT (parseClaimsJwt), so its signature is not verified. Verify with a concrete algorithm and reject unsigned tokens.

    Confidence P0: exploitable as written. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: trusts one party believes another without evidence.

    CWE-347 CWE-345 LLM06 ASI03

    Fix: Use a concrete Algorithm with verify(), or jjwt parseSignedClaims with a key; never Algorithm.none or parseClaimsJwt.

    References: https://github.com/auth0/java-jwt · https://cwe.mitre.org/data/definitions/347.html

    keryn.cryptoclaim.kotlin.ecb-mode-for-claims

    Section titled “keryn.cryptoclaim.kotlin.ecb-mode-for-claims”

    error kotlin kotlin, android

    A Cipher is requested in ECB mode. ECB encrypts each block independently, so blocks can be reordered or spliced — fatal for tokens or claim blobs. Use AES/GCM.

    Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: trusts one party believes another without evidence.

    CWE-327 CWE-1240 LLM06 ASI03

    Fix: Request an AEAD transformation (AES/GCM/NoPadding) and verify the tag on decrypt.

    References: https://developer.android.com/guide/topics/security/cryptography · https://cwe.mitre.org/data/definitions/327.html

    keryn.cryptoclaim.swift.ecb-mode-for-claims

    Section titled “keryn.cryptoclaim.swift.ecb-mode-for-claims”

    error swift swift, ios, commoncrypto

    CommonCrypto is invoked with the ECB option (kCCOptionECBMode). ECB encrypts each block independently, so blocks can be reordered or spliced — fatal for tokens or claim blobs. Use an authenticated construction (AES-GCM via CryptoKit).

    Confidence P1: dangerous in context. False-positive risk low: an exact API or flag, so hits are almost always real.

    Edge inspected: trusts one party believes another without evidence.

    CWE-327 CWE-1240 LLM06 ASI03

    Fix: Use CryptoKit AES.GCM (or ChaCha20-Poly1305) and verify the tag on open; drop CommonCrypto ECB.

    References: https://developer.apple.com/documentation/cryptokit/aes/gcm · https://cwe.mitre.org/data/definitions/327.html