Security Disclosure Recommendation: Rotate Redis Database Credentials

Learn how to Security Disclosure Recommendation: Rotate Redis Database Credentials

Mykal Machon ۳ دقیقه مطالعهمتن اصلی

Author: Mykal Machon

This guide is part of Railway's response to the security disclosure published on October 21, 2026.

If you use Redis on Railway, regenerate its password, redeploy every service that uses it, and confirm nothing is still connecting with the old credential.

If your Redis password or REDIS_URL may have been exposed, rotate your credentials. This guide applies if your database uses the Railway Redis template. The fastest path is Regenerate in the Database View, which changes the password inside Redis and updates the service variables in one step.

## Before you rotate

Three checks tell you how exposed the credential is and what you must update afterwards.

  1. Find every consumer. Open the Redis service's Variables tab. Services that use reference variables such as ${{ Redis.REDIS_URL }} pick up the new password on their next deploy. Services with a pasted connection string don't, so note them.
  2. Check public access. Open the Redis service's Settings and find Networking. If Public Access is enabled, the credential is usable from anywhere through the TCP proxy until you rotate. Remove public access now if nothing outside the project needs it.
  3. List external consumers. Anything that uses REDIS_PUBLIC_URL needs the new value by hand.

## Regenerate the password

Regenerate is the supported way to change a database password on Railway. It keeps the database and the variables in sync.

  1. Open the Redis service and click the Database tab, then Config.
  2. In the Connection section, click Regenerate next to the password. See Database View: Connection.
  3. Expect clients authenticated with the old password to fail on their next command.

⚠️ Don't edit REDISPASSWORD by hand and don't run CONFIG SET requirepass yourself. Each changes only one side and leaves the variable and the database out of sync. If that already happened, see how to recover.

## Redeploy the services that use it

Containers read variables only at startup, so every service that uses the credential must be redeployed.

  1. Redeploy every service that references the Redis variables. Regenerate redeploys only the database, so these services keep the old password until you do.
  2. If a service has a pasted connection string, replace it with the reference ${{ Redis.REDIS_URL }} so the next rotation reaches it automatically, then deploy.
  3. Update external consumers with the new REDIS_PUBLIC_URL.

Queue workers that hold long-lived connections reconnect on redeploy. Expect a short gap in job processing.

## Verify the rotation

Confirm the new credential works and nothing is still connected with the old one.

  1. Check each dependent service's deploy logs for no NOAUTH or WRONGPASS errors.
  2. Open the Database tab and confirm the Data view lists keys.
  3. Connect with the new credential using railway connect and run PING. railway connect Redis
  4. List connected clients and look for addresses you don't recognize. CLIENT LIST
  5. Disconnect a suspicious client with CLIENT KILL ID <id>.

## Look for misuse

A rotated password stops future access but these checks show whether the old credential was used.

  • The Redis service's deploy logs include auth failures. Use the log filter to search for WRONGPASS and for unfamiliar client addresses.
  • Inside Redis, compare DBSIZE, INFO keyspace, and INFO stats against what you expect. Unexpected key counts, a flush, or a spike in command volume point to misuse.
  • If sessions or tokens live in Redis, invalidate them. Flush the session database or rotate the signing secret in your application, because an attacker could have read them.
  • If the service has a volume with persistence enabled, a backup from before the exposure window helps you diff what changed.

If you have any other questions, contact Railway support at [email protected].

RB

منتشرشده در

Railway Blog

خواندن در منبع

ادامه مطالعه