Redis: CONFIG GET requirepass Returns Empty
Redis deployed without authentication is one of the most exploited misconfigurations on the internet. Attackers use CONFIG SET to write SSH keys, webshells, and cron jobs for persistent remote code execution. A penetration testing reference for Redis security hardening and incident response.
The default configuration
Redis binds to all interfaces (bind 0.0.0.0) and requires no password (requirepass is empty). If port 6379 is reachable, you have full access. There's no concept of users, roles, or permissions in default Redis.
What's in a Redis instance
Redis is used as a cache, session store, message broker, and rate limiter. A typical exposed instance contains:
- Session tokens. full session objects with user IDs, roles, and preferences
- API cache. cached API responses containing user data
- Rate limit counters. revealing internal rate limit thresholds
- Job queues. Sidekiq/Bull/Celery job payloads with function arguments
From cache access to server compromise
Redis supports the CONFIG SET command, which can change server configuration at runtime. The classic attack chain:
CONFIG SET dir /root/.sshCONFIG SET dbfilename authorized_keysSET payload "\nssh-rsa AAAA...your-key...\n"BGSAVE
This writes your SSH public key into the root user's authorized_keys file. You now have SSH root access to the server.
The same technique works with cron jobs (/var/spool/cron/root) and web shells (/var/www/html/shell.php).
How we detect this
Our scanner:
- Connects to port 6379 and sends
PING(expectsPONG) - Runs
INFO serverto get version, OS, and configuration - Runs
CONFIG GET requirepassto verify no password - Runs
DBSIZEandKEYS *(sampled) to assess data exposure
Defense
- Set a strong password:
requirepass your-strong-password-here - Bind to localhost only:
bind 127.0.0.1 - Disable dangerous commands:
rename-command CONFIG "" - Enable TLS (Redis 6+)
- Use ACLs (Redis 6+) for per-user permissions
Want us to check your Redis setup?
Our scanner detects this exact misconfiguration. plus dozens more across 38 platforms. Free website check available, no commitment required.
