High severityRubyAuthentication & SecretsHIGH confidence
Hardcoded Secret Key Base
The Rails secret_key_base is hard-coded in source.
Standards mapping
- OWASP ASVS
- V6.4.1 (L2)
Vulnerable vs. safe
Flagged by this check
Rails.application.config.secret_key_base = "0a1b2c3d4e5f60718293a4b5c6d7e8f9"Passes - the safe pattern
Rails.application.config.secret_key_base = ENV["SECRET_KEY_BASE"]Why it matters & how to fix it
The Rails secret_key_base is hard-coded in source. Anyone with the code can forge signed cookies and sessions (CWE-798). Store it in encrypted credentials or an environment variable (ENV["SECRET_KEY_BASE"]) and rotate the exposed value.
References
Rule ID integsec-ruby-hardcoded-secret-key-base - engine: Opengrep - license: MIT - Copyright (c) IntegSec Inc.
TurboPentest runs this check automatically
Connect a GitHub repo and this check runs on every white-box pentest - AI-validated and reported with proof, from $99 per target.
Start a pentestRelated checks
- JavaScript / TypeScript - Authentication & SecretsHardcoded JWT Secret
- JavaScript / TypeScript - Authentication & SecretsHardcoded Secret
- JavaScript / TypeScript - Authentication & SecretsInsecure Cookie Flags
- JavaScript / TypeScript - Authentication & SecretsJWT Algorithm None
- JavaScript / TypeScript - Authentication & SecretsJWT Decode Without Verify
- JavaScript / TypeScript - Authentication & SecretsTLS Verification Disabled