CVE-2025-27151
NoneCVSS
—
EPSS
1.1%
Published
May 29, 2025
CISA due date
—
Cloudanix analysis
A flaw in a Redis maintenance tool lets someone who can run it with a specially crafted input take over the computer it runs on.
- Exploitation
- Local Privilege
- Attacker needs
- Local User
- Complexity
- Moderate
- Impact
- Privilege Gain
- Component
- Application
- Class
- Buffer Overflow
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Stack-based buffer overflow in redis-check-aof caused by memcpy using strlen on a user-controlled filepath copied into a fixed-size stack buffer, enabling stack corruption and potential code execution.
Why it matters to the business
Attackers with the ability to invoke the affected utility on untrusted input can gain code execution on Redis infrastructure, leading to data theft, service disruption, or lateral movement; high downstream dependency count increases exposure surface across many deployments.
How an attack unfolds
An attacker supplies an excessively long file path argument to redis-check-aof; the utility performs an unbounded copy into a stack buffer, overflows the stack, and can hijack control flow to execute attacker-supplied code without requiring network access or authentication beyond local execution privileges.
How to fix it
Upgrade redis/redis to the fixed commit 994bc96bb1744cb153392fc96bdba43eae56e17f or release 8.0.2; apply the corresponding fixed icu package versions on Ubuntu 14.04 LTS systems; verify all instances of the redis-check-aof binary are replaced.
How to confirm the fix worked
Confirm the redis-check-aof binary reports version 8.0.2 or later; run the utility against a known long path in a test environment and verify absence of crashes or memory corruption indicators; scan package manifests to ensure no pre-8.0.2 binaries remain.
Typical attack path
- Obtain local or command execution access on a system running an affected Redis version
- Invoke redis-check-aof with a crafted file path argument exceeding the stack buffer size
- Trigger the memcpy operation that copies the oversized path
- Overwrite return addresses or control data on the stack
- Achieve arbitrary code execution and establish persistence or exfiltrate data
How to detect it
Search process execution logs and command history for redis-check-aof invocations containing unusually long path arguments; inspect core dumps or crash reports referencing buffer overflows in the aof checker binary; review authentication and sudo logs for unexpected use of the utility.
- redis-check-aof
- memcpy.*strlen.*filepath
What your security team should do
- Immediately upgrade all Redis installations to 8.0.2 or the listed fixed commit
- Restrict execution of redis-check-aof to trusted users and audited scripts only
- Monitor package update channels for downstream dependents and rebuild affected containers
- Add redis-check-aof invocation logging to SIEM for anomaly detection
The record
Redis is an open source, in-memory database that persists on disk. In versions starting from 7.0.0 to before 8.0.2, a stack-based buffer overflow exists in redis-check-aof due to the use of memcpy with strlen(filepath) when copying a user-supplied file path into a fixed-size stack buffer. This allows an attacker to overflow the stack and potentially achieve code execution. This issue has been patched in version 8.0.2.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| AlmaLinux:10 | valkey | 0 | 8.0.4-1.el10_0 |
| AlmaLinux:10 | valkey-devel | 0 | 8.0.4-1.el10_0 |
| AlmaLinux:9 | redis | 0 | 7.2.10-1.module_el9.6.0+173+efaf9205 |
| AlmaLinux:9 | redis-devel | 0 | 7.2.10-1.module_el9.6.0+173+efaf9205 |
| AlmaLinux:9 | redis-doc | 0 | 7.2.10-1.module_el9.6.0+173+efaf9205 |
| Alpine:v3.18 | redis | 0 | 7.0.15-r4 |
| Alpine:v3.19 | redis | 0 | 7.2.9-r0 |
| Alpine:v3.20 | valkey | 0 | 7.2.9-r1 |
| Alpine:v3.21 | valkey | 0 | 7.2.9-r1 |
| Alpine:v3.22 | valkey | 0 | 8.1.1-r1 |
| Bitnami | keydb | 7.0.0 | No fix |
| Bitnami | redis | 7.0.0 | 7.2.9 |
| Bitnami | redis | 7.0.0 | 8.0.2 |
| Bitnami | valkey | 0 | 7.2.10 |
| Bitnami | valkey | 7.0.0 | 8.0.2 |
| Chainguard | py3-redis | 0 | 0 |
| Chainguard | py3.10-redis | 0 | 0 |
| Chainguard | py3.11-redis | 0 | 0 |
| Chainguard | py3.12-redis | 0 | 0 |
| Chainguard | py3.13-redis | 0 | 0 |
| Chainguard | redis-7.2 | 0 | 7.2.9-r1 |
| Chainguard | redis-7.2-bitnami-compat | 0 | 7.4.4-r1 |
| Chainguard | redis-7.2-iamguarded-compat | 0 | 7.2.12-r2 |
| Chainguard | redis-7.4 | 0 | 7.4.4-r1 |
| Chainguard | redis-7.4-bitnami-compat | 0 | 7.4.4-r1 |
| Chainguard | redis-7.4-iamguarded-compat | 0 | 7.4.4-r1 |
| Chainguard | redis-benchmark-7.2 | 0 | 7.2.12-r2 |
| Chainguard | redis-benchmark-7.4 | 0 | 7.4.4-r1 |
| Chainguard | redis-cli-7.2 | 0 | 7.4.4-r1 |
| Chainguard | redis-cli-7.4 | 0 | 7.4.4-r1 |
| Chainguard | redis-cluster-7.2-bitnami-compat | 0 | 7.4.4-r1 |
| Chainguard | redis-cluster-7.2-iamguarded-compat | 0 | 7.2.12-r2 |
| Chainguard | redis-cluster-7.4-bitnami-compat | 0 | 7.4.4-r1 |
| Chainguard | redis-cluster-7.4-iamguarded-compat | 0 | 7.4.4-r1 |
| Chainguard | redis-sentinel-7.2-bitnami-compat | 0 | 7.4.4-r1 |
| Chainguard | redis-sentinel-7.2-iamguarded-compat | 0 | 7.2.12-r2 |
| Chainguard | redis-sentinel-7.4-bitnami-compat | 0 | 7.4.4-r1 |
| Chainguard | redis-sentinel-7.4-iamguarded-compat | 0 | 7.4.4-r1 |
| Debian:12 | redis | 0 | No fix |
| Debian:13 | redis | 0 | No fix |
| Debian:13 | valkey | 0 | No fix |
| Debian:14 | redict | 0 | 7.3.5+ds-1 |
| Debian:14 | redis | 0 | 5:8.0.2-2 |
| Debian:14 | valkey | 0 | 8.1.1+dfsg1-1.1 |
| Mageia:9 | redis | 0 | 7.2.10-1.mga9 |
| SUSE:Linux Enterprise Module for Server Applications 15 SP6 | redis | 0 | 7.2.4-150600.3.12.1 |
| SUSE:Linux Enterprise Module for Server Applications 15 SP6 | redis7 | 0 | 7.0.8-150600.8.16.1 |
| SUSE:Linux Enterprise Module for Server Applications 15 SP6 | valkey | 0 | 8.0.2-150600.13.11.1 |
| Wolfi | redis-7.2 | 0 | 7.2.9-r1 |
| Wolfi | redis-7.2-bitnami-compat | 0 | 7.4.4-r1 |
| Wolfi | redis-7.4 | 0 | 7.4.4-r1 |
| Wolfi | redis-benchmark-7.2 | 0 | 7.2.12-r2 |
| Wolfi | redis-cli-7.2 | 0 | 7.4.4-r1 |
| Wolfi | redis-cluster-7.2-bitnami-compat | 0 | 7.4.4-r1 |
| Wolfi | redis-sentinel-7.2-bitnami-compat | 0 | 7.4.4-r1 |
| openSUSE:Leap 15.6 | redis | 0 | 7.2.4-150600.3.12.1 |
| openSUSE:Leap 15.6 | redis7 | 0 | 7.0.8-150600.8.16.1 |
| openSUSE:Leap 15.6 | valkey | 0 | 8.0.2-150600.13.11.1 |
| openSUSE:Tumbleweed | redis | 0 | 8.0.2-1.1 |
| openSUSE:Tumbleweed | valkey | 0 | 8.1.2-1.1 |
Related vulnerabilities
- CVE-2025-49844 Redis is an open source, in-memory database that persists on disk. Also affects valkey
- CVE-2025-46818 Redis is an open source, in-memory database that persists on disk. Also affects valkey
- CVE-2025-46819 Redis is an open source, in-memory database that persists on disk. Also affects valkey
- CVE-2025-46817 Redis is an open source, in-memory database that persists on disk. Also affects valkey
- CVE-2025-48367 Redis is an open source, in-memory database that persists on disk. Also affects valkey
- CVE-2025-32023 Redis is an open source, in-memory database that persists on disk. Also affects valkey
- CVE-2025-21605 Redis is an open source, in-memory database that persists on disk. Also affects valkey
- CVE-2024-46981 Redis is an open source, in-memory database that persists on disk. Also affects redis