For the complete documentation index, see llms.txt. This page is also available as Markdown.
Cortex CloudApplication Security

Rails Secret Key Base detected in code

Rule Details

Cortex AppSec Rule ID

APPSEC_SECRET_167

Category

Sensitive Tokens

Severity

MEDIUM

Framework

Git

Impact

A Rails Secret Key Base is a critical, confidential string used for cryptographic signing, session integrity, cookie hashing, and encryption of sensitive application data.

Exposure of this key is Critical, allowing an attacker to forge session cookies (account takeover), decrypt sensitive configurations, and potentially bypass authentication.

How to Fix

To remediate exposed Auth tokens or Signing Keys:

  1. Log in to your Identity Provider or OAuth provider settings.

  2. Rotate the compromised Client Secret, Private Key, or Signing Certificate.

  3. Update your application configuration with the new credentials.

  4. Redeploy your application to ensure the new keys are in effect.

Next, remove the secret from your codebase:

  1. Locate the exposed secret in your codebase.

  2. Replace the hardcoded value with a secure variable or reference.

Finally, clean your version control history:

  1. Permanently remove the sensitive data from your version control history to ensure it cannot be retrieved.

Warning: Rotating signing keys or client secrets will likely invalidate active user sessions or tokens. Be prepared for users to be logged out.

Last updated

Was this helpful?