Urgent: Patch Redis CVE-2025-32023 HyperLogLog Vulnerability Now

  • Thread Author
Redis users should treat this as urgent: a newly disclosed vulnerability in HyperLogLog handling can be triggered by an authenticated client to cause stack or heap out-of-bounds writes — and those memory corruptions can be turned into remote code execution or persistent service loss if left unpatched.

Red warning triangle above the Redis logo, highlighting CVE-2025-32023 vulnerability.Background​

Redis is ubiquitous across modern stacks as a fast in-memory store, cache, and message broker. For years developers have relied on HyperLogLog (HLL) commands — PFADD, PFCOUNT and PFMERGE — to maintain approximate cardinality statistics with tiny memory footprints. On July 2025 a serious flaw in the way Redis parses and merges sparse HyperLogLog encodings was disclosed and assigned CVE-2025-32023. The vulnerability stems from an integer overflow in HLL processing logic that can lead to out-of-bounds writes, producing memory corruption on either the stack or the heap. The corruption path depends on which HLL internal routine is exercised.
Redis maintainers released fixes in a coordinated set of stable branches: the vulnerability is addressed in Redis versions 8.0.3, 7.4.5, 7.2.10, and 6.2.19. Where patching is impractical immediately, operators can mitigate risk by disabling HLL commands via Redis ACLs. Public proof-of-concept code and exploit repositories have appeared since disclosure, raising the exploitation risk for poorly defended or internet-exposed instances.

What exactly is wrong? Technical overview​

Root cause: integer overflow to buffer overflow​

At its core this is a classic integer overflow leading to a buffer overflow. When Redis iterates over a malformed sparse HyperLogLog blob, an internal length counter can overflow. That negative or otherwise incorrect length value is used in subsequent memory operations that write past a stack or heap buffer boundary.
Two code paths are relevant:
  • hllMerge (merge logic) — operates in contexts that use stack-allocated temporary structures. A corrupt length counter here can overwrite stack memory.
  • hllSparseToDense (sparse-to-dense conversion) — uses heap allocations, so a malformed input can trigger a heap out-of-bounds write during conversion.
Both outcomes are dangerous. Stack overwrites are commonly exploitable for control-flow hijack on platforms without full mitigations, while heap corruption can be exploited to overwrite function pointers, control allocation metadata, or corrupt program state in ways that enable code execution or persistent instability.

Affected commands and data paths​

The vulnerability is reachable through HyperLogLog operations. The primary Redis commands that manipulate HLL data are:
  • PFADD — add elements to an HLL
  • PFCOUNT — return approximate cardinality
  • PFMERGE — merge multiple HLL values
Any operation that causes Redis to process a crafted sparse HLL encoding may trigger the bug. Because HLL structures are created or updated via PFADD and manipulated by PFMERGE/PFCOUNT internally, those are the commands of concern.

Privileges and attack vector​

Crucially, exploitation requires the ability to send Redis commands — in other words, an authenticated client or an instance where clients can connect without authentication. Public exposure is common: misconfigured instances left bound to public interfaces or protected only by weak/no credentials are the highest-risk scenario.
Security advisories and scoring canvases differ slightly on the attack vector, reflecting different environmental assumptions. The vulnerability therefore dimensions into two key attacker profiles:
  • Local/authenticated attacker: When Redis uses authentication or runs in a protected network, an attacker who already has credentials (or shell access to a host with a local client) can exploit the flaw.
  • Remote attacker through public access: If the Redis instance is reachable from the internet with no authentication or weak controls, an attacker can reach the vulnerable command handlers over the network.
Because both scenarios exist in real-world deployments, defenders need to assess exposure and privilege paths carefully.

Scope: which versions are vulnerable and where it was fixed​

Redis fixed the issue in released versions corresponding to maintained branches. The patched releases are:
  • Redis 8.0.3 (and later 8.x)
  • Redis 7.4.5 (and later 7.4.x)
  • Redis 7.2.10 (and later 7.2.x)
  • Redis 6.2.19 (and later 6.2.x)
The vulnerability dates back to implementations added long ago; sources indicate code present in Redis since version 2.8 may be affected. That means any deployment running a version earlier than the patched releases — across mainstream distribution packages, containers, or vendor forks — should be treated as potentially vulnerable.
Multiple operating system and distribution advisories were issued after the disclosure and list the same patched version numbers. Vendor packages for major Linux distributions have been updated, and cloud provider-managed offerings issued guidance for remediation. However, because package managers and cloud maintenance windows vary, many instances — especially self-managed or legacy ones — will remain unpatched unless operators act.

Exploit availability and real-world risk​

Public proof-of-concept (PoC) code appeared shortly after disclosure. Several proof-of-concept and exploit repositories are publicly accessible, and security scanning services reported PoC artifacts reaching the wild within days to weeks of the advisory.
What this means in practice:
  • The presence of public PoCs increases exploitation risk. Once a working exploit is public, opportunistic attackers and commodity attack tools can be updated quickly to target vulnerable deployments.
  • The ability to turn an out-of-bounds write into reliable remote code execution depends on many variables: target OS, compiler mitigations (DEP, ASLR, stack canaries, hardened malloc), whether Redis runs with elevated system privileges, and process memory layout. In some environments exploitation will be trivially reliable; in others it will be more complex.
  • Even if RCE is not guaranteed across every platform, memory corruption itself can produce severe availability impacts. Crashes, repeated reboots, data corruption or persistent denial-of-service (e.g., refusing new connections) are all plausible outcomes.
At the time of review, there were reports indicating public PoCs exist and at least some exploit code circulating, but there was no broad, confirmed mass exploitation campaign reported. That window is critical: PoCs mean attackers can try, and defenders should assume this is an active threat against exposed instances.

Impact scenarios: why this matters to enterprises and service operators​

Redis is a foundational component in many architectures — caching layers, session stores, leaderboards, queue backends and more. The consequences of successful exploitation are severe:
  • Full system compromise: If an attacker can achieve RCE in the redis-server process running under a privileged account, they may gain local code execution on the host.
  • Data integrity and theft: Redis often holds ephemeral but sensitive data (session tokens, rate-limiting counters, ephemeral credentials). An attacker could read or modify these values to escalate access or maintain persistence.
  • Denial-of-service (availability loss): Memory corruption may lead to reproducible crashes. An attacker can mount persistent denial-of-service by repeatedly triggering the bug or corrupting state so the service doesn't recover correctly.
  • Lateral movement: Compromised hosts can serve as beachheads to reach application servers, databases or cloud metadata endpoints, especially when Redis runs on shared systems or with network privileges.
  • Multi-tenant risk: SaaS providers or shared-hosting environments using Redis in multi-tenant setups face higher risk because one tenant with command access could impact others.
Operational practices that exacerbate risk:
  • Redis instances exposed to public networks or weakly protected by IP allowlisting.
  • Running redis-server under root or with excessive system privileges.
  • Lack of ACL usage (many older deployments rely on default, unauthenticated access).
  • Containers and images using older Redis versions lingering in registries.

Practical mitigation: immediate actions and longer-term remediation​

If you manage Redis instances, treat this as a high-priority patch-and-mitigate situation. The following is an actionable playbook you can adopt now.

Immediate actions (0–24 hours)​

  • Inventory and identify affected instances.
  • Query hosts and containers for Redis versions. Example command:
  • Connect to host/instance and run: redis-cli INFO server
  • Check the “redis_version” field.
  • Search configuration management and image registries for redis-server package versions.
  • If any instance runs a vulnerable version and cannot be patched immediately, block HLL commands using ACLs.
  • Two effective ACL approaches:
  • Disable the entire HLL category for the relevant user(s):
  • ACL SETUSER <username> -@hyperloglog
  • Or explicitly remove the HLL commands:
  • ACL SETUSER <username> -PFADD -PFCOUNT -PFMERGE
  • For the default user, use caution (don’t lock legitimate processes out); prefer to create dedicated restricted users for untrusted clients and restrict them there.
  • Ensure network-level protections:
  • Block Redis ports (default TCP 6379) from public internet access using firewalls, security groups, and network ACLs.
  • Limit access to trusted application subnets only, and implement IP allowlisting where possible.
  • Verify authentication is enabled and strong credentials are in place.
  • If your instance lacks authentication and is internet reachable, assume compromise and isolate.

Short-term actions (24–72 hours)​

  • Schedule patching to the fixed Redis release for each affected branch used in your environment.
  • Upgrade to the version that corresponds to your current major branch (e.g., 6.2 -> 6.2.19).
  • For containerized deployments, update images and redeploy after smoke testing.
  • For managed cloud offerings (Elasticache, Azure Cache, Memorystore), consult provider notices and apply service updates or maintenance windows. If the provider applies patches automatically, confirm completion in your account.
  • Rotate any credentials or secrets that may have been readable by Redis and that you cannot fully validate as uncompromised.

Longer-term hardening​

  • Run Redis with a least-privilege system user; do not run as root.
  • Use ACLs proactively: define service accounts with narrow command sets and keyspace access.
  • Avoid exposing Redis to the internet; place behind private networks and gateway proxies.
  • Enable auditing and command logging where practical; configure centralized logging for suspicious commands and unusual PFADD/PFMERGE activity.
  • Build patching into your CI/CD pipeline for container images and configuration management.

Detection and incident response guidance​

If you suspect exploitation or want to hunt proactively, these steps are recommended.

Indicators of compromise and hunting signals​

  • Unexpected PFADD/PFMERGE/PFCOUNT commands originating from untrusted accounts or IPs.
  • Redis process crashes or recurring restarts correlated to HLL operations.
  • Unexpected child processes spawned by the process user that previously did not occur.
  • New or modified system accounts, SSH keys, or scheduled tasks on the host running Redis.
  • Network connections from the Redis host to unknown external command-and-control endpoints.
Use Redis monitoring facilities and your infrastructure logs:
  • Monitor command stream: redis-cli MONITOR can be used in short bursts on a safe environment to capture live commands; long-term monitoring should be done with agent-based collection to avoid performance impact.
  • Host-level forensic collection: preserve memory snapshots, core dumps, and disk images if compromise is suspected. Capture process lists and open sockets before restarting services.
  • If you find evidence of unauthorized commands or payloads, isolate the host, preserve artifacts, and escalate to incident response.

Incident steps if you confirm compromise​

  • Isolate the compromised instance from the network.
  • Take forensic snapshots (memory, disk) and collect logs to preserve chain-of-evidence.
  • Rotate credentials and secrets exposed to the compromised instance.
  • Rebuild the host from known-good images and patched binaries; do not attempt to “patch in-place” a host you believe to be compromised.
  • Review surrounding infrastructure for lateral movement indicators.
  • Notify stakeholders and comply with any regulatory reporting obligations.

Why ACLs are an effective short-term mitigation​

Redis ACLs let operators restrict command categories or individual commands per user. An ACL rule that removes hyperloglog commands from the set of permitted commands for untrusted users effectively prevents exploitation from those accounts without restarting the redis-server binary. That makes ACLs a cheap and immediate stopgap while you schedule binary upgrades.
Example safe mitigation commands:
  • Remove hyperloglog category for a user:
  • ACL SETUSER limited_user -@hyperloglog
  • Explicitly remove HLL commands for default user (apply with caution):
  • ACL SETUSER default -PFADD -PFCOUNT -PFMERGE
Note: ACL changes are effective immediately and persist across restarts if the ACL configuration is saved.

Reconciling scoring differences and uncertainty​

Different security trackers computed varying CVSS scores and attack vectors for this CVE. Some vendors emphasize a local/authenticated attack vector (requiring credentials or local access), while others present it as network exploitable for publicly accessible instances. The variance stems from environmental assumptions:
  • If an attacker can reach a Redis instance over the network without authentication, the practical attack vector is network.
  • If the instance uses authentication and is not public-facing, exploitation may be achievable only by an authenticated or local actor.
Because real world deployments span both configurations — and because many Redis instances historically have been misconfigured — defenders must assume the worst-case scenario: accessible instances with weak or no authentication are directly exploitable.
Also note that reliable remote code execution exploitability depends on platform-specific mitigations; in some contexts the vulnerability may produce denial-of-service rather than deterministic code execution. Treat both outcomes as severe: RCE compromises confidentiality and integrity; DoS affects availability and may disrupt critical services.

Prioritization framework for remediation​

Use this risk-based triage to prioritize patching and mitigation:
  • Highest priority
  • Redis instances bound to public networks or with weak/no authentication.
  • Multi-tenant or shared services where one tenant can submit commands.
  • Instances running with elevated system privileges.
  • High priority
  • Internal Redis used for critical sessions, identity, or payment flows.
  • Instances used by DevOps, management planes, or orchestration systems.
  • Medium priority
  • Redis caches that are isolated on internal networks and rely on authentication.
  • Non-production environments if production is not vulnerable.
  • Lower priority
  • Instances already protected by ACLs that disallow HLL commands for untrusted users.
  • Instances that have been replaced with patched managed services.
Even lower-priority systems should still be scheduled for patching as part of routine maintenance; the availability of PoCs makes eventual exploitation likely if left unattended.

Final assessment and recommendations​

CVE-2025-32023 is a textbook example of how a subtle parsing error in a specialized data structure can create a systemic risk. The problem is not a minor memory leak: it’s an integer overflow that enables out-of-bounds writes, and those memory corruptions have historically been a reliable route to both remote code execution and denial-of-service.
Action items for operators right now:
  • Immediately inventory environments and identify Redis versions in use.
  • For vulnerable versions, apply vendor patches to 8.0.3, 7.4.5, 7.2.10, or 6.2.19 (or later).
  • If you cannot patch within hours, use ACLs to remove hyperloglog commands from untrusted users and block network access to Redis from untrusted networks.
  • Harden Redis configuration: strong authentication, least-privilege users, private network placement, and run redis-server with minimal system privileges.
  • Treat PoC code as an operational reality: assume active scanning and targeted exploitation will occur against internet-exposed or poorly protected instances.
  • If compromise is suspected, follow incident response best practices: isolate, preserve evidence, rebuild from patched images, and rotate secrets.
Redis remains a powerful and valuable technology, but this vulnerability underscores that even mature, widely used components can harbor dangerous bugs. Rapid identification, mitigation and patching — combined with practical hardening like ACLs and network isolation — will blunt the threat and protect the availability and integrity of critical services.

Source: MSRC Security Update Guide - Microsoft Security Response Center
 

Back
Top