viper-crypto-tls-audit
Skill22 starsChanged 15 days agoMITView on GitHub
Cryptography, Key Management & Password Hashing Auditor (modeled on Trail of Bits & OWASP Cryptographic Storage). Reviews algorithms, IV/nonce handling, CSPRNG usage, and Argon2/bcrypt.
In this repository72 other files it gives its agents.
- llms.txtllms.txt
- viper-agent-skill-supplychainSkill
- viper-ai-llm-guardrailsSkill
- viper-api-gateway-apigee-kongSkill
- viper-auth-oauth-jwtSkill
- viper-aws-iam-cloud-auditSkill
- viper-bola-idorSkill
- viper-browser-extension-mv3Skill
- viper-browseros-agentSkill
- viper-cicd-hardeningSkill
- viperclawSkill
- viper-container-k8s-auditSkill
- viper-csrf-samesite-auditSkill
- viper-dependency-sbomSkill
- viper-deserialization-parserSkill
- viper-diff-pr-reviewSkill
- viper-dns-email-domainSkill
- viper-electron-tauri-desktopSkill
- viper-fastapi-django-flaskSkill
- viper-file-upload-storageSkill
- viper-gcp-azure-cloud-auditSkill
- viper-github-repo-governanceSkill
- viper-go-service-auditSkill
- viper-graphql-wsSkill
- viper-grpc-protobuf-auditSkill
- viper-headers-csp-corsSkill
- viper-iac-terraform-auditSkill
- viper-incident-forensics-triageSkill
- viper-injection-oracleSkill
- viper-java-spring-auditSkill
- viper-js-harvesterSkill
- viper-kafka-rabbitmq-queueSkill
- viper-linux-systemd-hostSkill
- viper-logging-pii-complianceSkill
- viper-mcp-server-auditSkill
- viper-mobile-api-configSkill
- viper-multitenant-isolationSkill
- viper-nextjs-react-rscSkill
- viper-nginx-envoy-gatewaySkill
- viper-nodejs-express-nestjsSkill
- viper-oauth-oidc-complianceSkill
- viper-openapi-rest-schemaSkill
- viper-orchestratorSkill
- viper-payment-stripe-pciSkill
- viper-php-laravel-wordpressSkill
- viper-postgres-redis-mongoSkill
- viper-privacy-gdpr-hipaaSkill
- viper-proof-judgeSkill
- viper-proxy-fingerprintSkill
- viper-proxy-parser-alignmentSkill
- viper-race-logicSkill
- viper-rag-vector-auditSkill
- viper-rate-limit-dos-resilienceSkill
- viper-remediation-patch-verifierSkill
- viper-ruby-rails-auditSkill
- viper-rust-memory-unsafeSkill
- viper-saml-sso-enterpriseSkill
- viper-sbom-slsa-provenanceSkill
- viper-secrets-auditSkill
- viper-semgrep-rule-authorSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 30
Run the following discovery commands across the target repository before manual code review:
- Distinctive: line 62
Verify whether an upstream API Gateway, global middleware, or ORM hook already enforces the control before flagging a controller.
- Distinctive: line 92
Write a Positive Unit Test confirming authorized, schema-valid requests succeed.
- Distinctive: line 93
Write a Negative Security Regression Test confirming unauthorized, cross-tenant, or malformed inputs are deterministically rejected.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Cryptography, Key Management & Password Hashing Auditor (viper-crypto-tls-audit)
1. Executive Scope, Standards & CWE/OWASP Mapping
- Frameworks & Standards: OWASP Cryptographic Storage Cheat Sheet, OWASP Password Storage Cheat Sheet, NIST SP 800-57 / SP 800-63B, Trail of Bits Crypto Rules
- Primary CWE Mapping: CWE-327 (Use of a Broken or Risky Cryptographic Algorithm), CWE-323 (Reusing a Nonce, Key Pair in Encryption), CWE-338 (Use of Cryptographically Weak PRNG), CWE-916 (Weak Password Hashing)
- ViperClaw MCP Tools:
viper_taint_scan,viper_verify_and_report - ViperClaw CLI Command:
viperclaw taint ./src --db .viperclaw/graph.db
2. Threat Model & Root-Cause Architecture
flowchart LR
Secret["Plaintext Password / PII / Token"] --> CSPRNG["CSPRNG (secrets / crypto.randomBytes)"] --> Algo["Argon2id / AES-256-GCM / Ed25519"] --> Store[("Authenticated Ciphertext / Hash")]Root-Cause Analysis
Cryptographic failures occur when developers use fast general-purpose hashes (SHA-256, MD5) for passwords, unauthenticated encryption modes (AES-ECB, AES-CBC without HMAC—vulnerable to padding oracle decryption), static or reused IVs/nonces in AES-GCM, or non-cryptographic PRNGs (random, Math.random()) for security tokens.
3. Deterministic Discovery & Grep/AST Audit Commands
Run the following discovery commands across the target repository before manual code review:
# 1. Automated ViperClaw analysis
viperclaw taint ./src --db .viperclaw/graph.db
# 2. Rapid static pattern discovery (ripgrep)
rg -n "(hashlib\.(md5|sha1)|MD5\.Create|MessageDigest\.getInstance\(.(MD5|SHA-1).\))"
rg -n "(AES\.MODE_ECB|AES\.MODE_CBC|DES|RC4|Blowfish)"
rg -n "(random\.(randint|choice|random)|Math\.random\(|math/rand)"4. Senior Security Engineer 8-Point Audit Checklist
| Control ID | Audit Verification Target | Pass Criteria | Fail / Vulnerability Indicator |
CRYP-01 | Memory-Hard Password Hashing (Argon2id) | User passwords hashed with Argon2id (m>=19MiB, t>=2, p=1), bcrypt (cost >= 12), or scrypt. | Passwords hashed with MD5, SHA-1, unsalted SHA-256, or low-iteration PBKDF2. |
CRYP-02 | Authenticated Encryption (AEAD) Only | Symmetric encryption uses AES-256-GCM, ChaCha20-Poly1305, or Fernet / libsodium secretbox. | Unauthenticated AES-ECB (leaks patterns) or raw AES-CBC (vulnerable to PKCS#7 padding oracle). |
CRYP-03 | Unique CSPRNG Nonce / IV Per Encryption | Every AES-GCM or ChaCha20 encryption generates a fresh CSPRNG nonce (os.urandom(12)) prepended to the ciphertext. | Hardcoded/static IV (b'\x00'*12) or counter reuse under the same key (catastrophic key/plaintext recovery in GCM). |
CRYP-04 | CSPRNG for All Security Tokens | Reset tokens, OTPs, salts, and session IDs use secrets (Python), crypto.randomBytes (Node), or crypto/rand (Go). | random.choice(), uuid.uuid1() (MAC + timestamp), or Math.random() used for tokens. |
CRYP-05 | Constant-Time Secret Comparison | MACs, webhook signatures, and API tokens compared via hmac.compare_digest() / crypto.timingSafeEqual(). | Standard == string comparison leaking signature bytes via timing side channels. |
CRYP-06 | Asymmetric Key Lengths & Curve Safety | Ed25519, ECDSA P-256/P-384, or RSA >= 2048-bit with RSA-OAEP (encryption) and RSA-PSS (signatures). | RSA-1024 or legacy PKCS#1 v1.5 encryption padding (Bleichenbacher oracle). |
CRYP-07 | Key Separation & KMS Envelope Encryption | Signing keys and encryption keys are strictly separated (HKDF subkey derivation); master keys reside in KMS/HSM. | The same raw secret key is used for both JWT signing (HS256) and database field encryption. |
CRYP-08 | TLS 1.2+ & Certificate Verification | Outbound TLS clients verify hostname + certificate chain (CERT_REQUIRED) and enforce TLS 1.2/1.3. | verify=False, NODE_TLS_REJECT_UNAUTHORIZED=0, or InsecureSkipVerify: true enabled. |
5. False-Positive Elimination & CVSS v3.1 Triage Rubric
False-Positive Gate
- Verify whether an upstream API Gateway, global middleware, or ORM hook already enforces the control before flagging a controller.
- Confirm the code path is reachable from an external entrypoint (not dead code, CLI-only admin script, or unit-test fixture).
| Severity Tier | Baseline CVSS v3.1 Vector | Qualifying Security Impact |
| CRITICAL (9.1) | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N | Predictable PRNG reset tokens, static AES-GCM nonce reuse, or AES-CBC padding oracle compromising confidentiality. |
| HIGH (7.5) | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N | Disabled TLS certificate verification (verify=False) or fast unsalted password hashes (MD5/SHA1). |
| MEDIUM (5.3) | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N | Non-constant-time HMAC comparison or shared key material across signing and encryption. |
6. Production Remediation Patterns (Vulnerable vs. Hardened Code)
# ❌ VULNERABLE: Uses random.choices (Mersenne Twister) for OTP & fast SHA-256 for password
otp = "".join(random.choices("0123456789", k=6))
pw_hash = hashlib.sha256(password.encode()).hexdigest()
# ✅ HARDENED: CSPRNG secrets module for OTP & Argon2id for password hashing
import secrets
from argon2 import PasswordHasher
ph = PasswordHasher(time_cost=3, memory_cost=65536, parallelism=4)
otp = f"{secrets.randbelow(1_000_000):06d}"
pw_hash = ph.hash(password)7. Regression Testing & Continuous Verification
- Write a Positive Unit Test confirming authorized, schema-valid requests succeed.
- Write a Negative Security Regression Test confirming unauthorized, cross-tenant, or malformed inputs are deterministically rejected.
- Re-run
viperclaw taintandviperclaw verifyto confirm zero remaining unmitigated flows in.viperclaw/graph.db.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

