Skip to content
vetkitChecksChangelogDocumentation

vetkit.ruby.rails.hardcoded-secret-key-base

secret_key_base / secret_token is set to a string literal in code. Anyone with the source can forge signed cookies and sessions and decrypt encrypted ones.

Last updated:

Suite: Security

ruby

secret_key_base / secret_token is set to a string literal in code. Anyone with the source can forge signed cookies and sessions and decrypt encrypted ones.

Category: SECURITY · Engine rule severity: WARNING

How to fix it

Load the secret from Rails credentials or ENV (ENV.fetch("SECRET_KEY_BASE")) and rotate the leaked value.

References

Source: packages/engine/rules/sast/ruby.yml.

Generated from shipped rule definitions at build time. Matching is a review signal, not proof of exploitability. “generic” denotes text matching, not complete language or framework coverage. Runtime configuration and available tools affect whether a rule runs.