☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]

CVE-2025-46818

CVE-2025-46818 is a high-severity vulnerability in Redis, an open-source in-memory database, affecting all versions with Lua scripting support up to and including 8.
📅 PUBLISHED: 2025-10-03 18:38 UTC 🔄 UPDATED: 2026-09-23 20:28 UTC
[ OFFICIAL PATCH DEPLOYED ↓ ] FIX: CONFIRMED — 3+ independent sources confirm fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.73%
👁️
0.73% probability
18.2× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
Country: United States License: Open Source
Patch available — upgrade to latest release
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
6.0
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2025-46818 is a high-severity vulnerability in Redis, an open-source in-memory database, affecting all versions with Lua scripting support up to and including 8.2.1. An authenticated attacker can craft a malicious Lua script that escapes the Lua sandbox, allowing arbitrary code execution in the context of another user. This cross-user escape can lead to data theft, privilege escalation, and full system compromise. The vulnerability is fixed in Redis 8.2.2. A workaround involves using ACLs to block the EVAL and FUNCTION command families.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

Redis is widely distributed as a standalone package, container image, and through package managers (e.g., apt, yum, brew). Organizations using Redis in their supply chain must ensure they are not pulling vulnerable versions. The official Docker image redis should be updated to tag 8.2.2 or later. Package managers should be configured to pull the patched version. The vulnerability does not directly affect NPM, PyPI, Go, or Ruby packages, but any application that depends on a vulnerable Redis instance is at risk.

CVSS Breakdown & Threat Level

  • CVSS Score: 6.0 (Medium)
  • Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
  • Attack Vector (AV): Network – The attack can be launched remotely.
  • Attack Complexity (AC): Low – No special conditions are required.
  • Privileges Required (PR): Low – The attacker needs valid credentials to authenticate to Redis.
  • User Interaction (UI): None – No user action is required.
  • Scope (S): Unchanged – The vulnerability does not affect other components.
  • Confidentiality (C): High – Full data access is possible.
  • Integrity (I): High – Data can be modified or deleted.
  • Availability (A): None – The vulnerability does not directly impact availability.

Threat Level: High. While the CVSS score is 6.0, the potential for full system compromise and data breach elevates the real-world risk. The availability of a public PoC and the widespread use of Redis make this a critical target for attackers.

Deep Dive & Mechanics

The vulnerability resides in the Lua scripting engine embedded within Redis. Redis uses a sandboxed Lua environment to execute user-provided scripts via the EVAL and EVALSHA commands, as well as Lua functions. The sandbox is intended to prevent scripts from accessing the host system or interfering with other users' data.

Root Cause: A flaw in the Lua sandbox implementation allows an authenticated user to manipulate Lua objects (e.g., tables, metatables, or the global environment) in a way that bypasses the sandbox restrictions. By crafting a specially crafted Lua script, the attacker can:

  1. Access internal Redis data structures.
  2. Execute arbitrary Lua code outside the sandbox.
  3. Run code in the context of another authenticated user, potentially with higher privileges.

Attack Flow:

  1. Authentication: The attacker must have valid Redis credentials (e.g., via AUTH command or default credentials).
  2. Script Injection: The attacker sends a malicious Lua script using the EVAL command.
  3. Sandbox Escape: The script exploits the vulnerability to break out of the sandbox.
  4. Code Execution: The attacker executes arbitrary code, such as reading other users' keys, modifying data, or executing system commands (if the Redis process has sufficient permissions).

Affected Components:

  • Redis server versions 8.2.1 and below.
  • All versions with Lua scripting enabled (default).

Vulnerable vs. Patched Code

Vulnerable Code (Pre-8.2.2): The vulnerable code likely involves improper validation of Lua object types or metatable manipulations. A simplified example of a vulnerable sandbox might look like:

-- Vulnerable sandbox (conceptual)
local sandbox_env = {
  print = print,
  redis = redis,
  -- ... other safe functions
}
local script = loadstring(user_script, "user_script")
setfenv(script, sandbox_env)
local status, result = pcall(script)

An attacker could exploit this by manipulating the redis object or using metatable tricks to access the global environment.

Patched Code (8.2.2+): The patch likely adds stricter checks on Lua object types, prevents metatable manipulation, and restricts access to internal functions. A conceptual fix might involve:

-- Patched sandbox (conceptual)
local sandbox_env = {}
-- Only allow specific safe functions
sandbox_env.redis = {
  call = function(cmd, ...)
    -- Validate command and arguments
    if not is_safe_command(cmd) then
      error("Command not allowed")
    end
    return redis.call(cmd, ...)
  end
}
-- Freeze the environment to prevent modification
setmetatable(sandbox_env, {__index = nil, __newindex = function() error("Read-only") end})
local script = loadstring(user_script, "user_script")
setfenv(script, sandbox_env)
local status, result = pcall(script)

Exploitation & Lab Setup

Red Team

Lab Setup:

  1. Environment: Docker container running Redis 8.2.1.
    docker run -d --name vulnerable-redis -p 6379:6379 redis:8.2.1
    
  2. Authentication: Set a password for the default user.
    docker exec -it vulnerable-redis redis-cli CONFIG SET requirepass "P@ssw0rd"
    
  3. Exploit Script: Use the following Lua script to test for sandbox escape (conceptual):
    -- Exploit script (conceptual)
    local mt = getmetatable(redis)
    if mt then
      mt.__gc = mt.__gc or function() end
      -- Attempt to access global environment
      local env = mt.__gc
      -- Execute arbitrary code
      env.os.execute("id")
    end
    
  4. Execution:
    redis-cli -a P@ssw0rd EVAL "$(cat exploit.lua)" 0
    

Expected Outcome: The script should execute the id command on the host, demonstrating sandbox escape.

Blue Team

Detection & Response:

  1. Monitor Redis Logs: Enable and monitor Redis logs for unusual Lua script execution.
    docker exec -it vulnerable-redis redis-cli CONFIG SET loglevel verbose
    
  2. Network Monitoring: Look for connections to Redis port 6379 from unexpected sources.
  3. ACL Enforcement: Immediately restrict EVAL and FUNCTION commands using ACLs.
    redis-cli -a P@ssw0rd ACL SETUSER attacker -@EVAL -@FUNCTION
    
  4. Upgrade: Patch to Redis 8.2.2 as soon as possible.

Indicators of Compromise (IOCs)

  • Network:
    • Unusual Lua script payloads in Redis traffic (e.g., containing os.execute, io.popen, or metatable manipulation).
    • Connections to Redis from IPs not in the allowed list.
  • Host:
    • Unexpected processes spawned by the Redis user (e.g., id, whoami, reverse shells).
    • Modified Redis data or keys that should not be accessible.
    • Redis logs containing errors like Lua sandbox violation or attempt to index a nil value.
  • File System:
    • Suspicious files created in the Redis working directory (e.g., /data).
    • Modified Redis configuration files.

Detection Engineering

YARA Rule

rule CVE_2025_46818_Redis_Lua_Sandbox_Escape {
  meta:
    description = "Detects Lua scripts attempting to exploit CVE-2025-46818 in Redis"
    author = "Valters IT"
    date = "2025-04-10"
    reference = "https://nvd.nist.gov/vuln/detail/CVE-2025-46818"
    severity = "high"

  strings:
    $s1 = "os.execute" ascii wide nocase
    $s2 = "io.popen" ascii wide nocase
    $s3 = "getmetatable" ascii wide nocase
    $s4 = "setmetatable" ascii wide nocase
    $s5 = "__gc" ascii wide nocase
    $s6 = "__index" ascii wide nocase
    $s7 = "debug" ascii wide nocase

  condition:
    any of ($s1, $s2) or (any of ($s3, $s4, $s5, $s6, $s7) and #s3 + #s4 + #s5 + #s6 + #s7 > 2)
}

Sigma Rule

title: Redis Lua Sandbox Escape Attempt
id: 8a4b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects attempts to exploit CVE-2025-46818 by monitoring Redis logs for Lua sandbox violations.
author: Valters IT
date: 2025-04-10
references:
  - https://nvd.nist.gov/vuln/detail/CVE-2025-46818
logsource:
  product: redis
  service: server
detection:
  selection:
    - message: "*Lua sandbox violation*"
    - message: "*attempt to index a nil value*"
    - message: "*EVAL*os.execute*"
    - message: "*EVAL*io.popen*"
  condition: selection
falsepositives:
  - Legitimate use of Lua scripting with similar patterns (rare)
level: high

Suricata Rule

alert tcp $EXTERNAL_NET any -> $HOME_NET 6379 (msg:"CVE-2025-46818 Redis Lua Sandbox Escape Attempt"; flow:to_server,established; content:"EVAL"; nocase; content:"os.execute"; within:100; distance:0; sid:1000001; rev:1;)

Nuclei Template

id: CVE-2025-46818

info:
  name: Redis Lua Sandbox < 8.2.2 - Cross-User Escape
  author: pussycat0x
  severity: high
  description: |
    Redis is an open source, in-memory database that persists on disk. Versions 8.2.1 and below allow an authenticated user to use a specially crafted Lua script to manipulate different LUA objects and potentially run their own code in the context of another user. The problem exists in all versions of Redis with LUA scripting. This issue is fixed in version 8.2.2. A workaround to mitigate the problem without patching the redis-server executable is to prevent users from executing LUA scripts. This can be done using ACL to block a script by restricting both the EVAL and FUNCTION command families.
  impact: |
    Authenticated users can execute arbitrary code in the context of other users, potentially leading to full system compromise.
  remediation: |
    Upgrade to version 8.2.2 or later.
  reference:
    - https://github.com/dwisiswant0/CVE-2025-46818
  metadata:
    verified: true
    max-request: 1
    shodan-query: product:"redis"
  tags: cve,cve2025,js,redis,network,passive,authenticated,vuln

flow: javascript(1) && javascript(2)

javascript:
  - pre-condition: |
      isPortOpen(Host,Port);

    code: |
      const redis = require('nuclei/redis');
      const info = redis.GetServerInfo(Host,Port);
      Export(info);

    args:
      Host: "{{Host}}"
      Port: "6379"

    matchers:
      - type: dsl
        dsl:
          - success == true
          - compare_versions(version, ' < 8.2.2')
        condition: and

    extractors:
      - type: regex
        name: version
        part: response
        group: 1
        regex:
          - redis_version:(\d+\.\d+\.\d+)

  - code: |
      const redis = require('nuclei/redis');
      const info = redis.RunLuaScript(Host,Port,Password,Payload);
      Export(info);

    args:
      Host: "{{Host}}"
      Port: "6379"
      Password: "{{passwords}}"
      Payload: 'return "lua enabled"'

    payloads:
      passwords:
        - ""

    matchers:
      - type: dsl
        dsl:
          - success == true
          - contains(response, 'lua enabled')
        condition: and
        internal: true
# digest: 4a0a00473045022010a8b21af4351c8b04a18a997e16bd08568a4899057328a81f47dce5a6eb79d2022100acbae21d3075ee7e9279ae83b0d57646b508bc4dbed2c6969d8d3ba7d98d3357:922c64590222798bb761d5b6d8e72950

Remediation & Mitigation

Immediate Actions:

  1. Upgrade: Upgrade Redis to version 8.2.2 or later.
    docker pull redis:8.2.2
    docker stop vulnerable-redis
    docker run -d --name patched-redis -p 6379:6379 redis:8.2.2
    
  2. Workaround: If upgrading is not immediately possible, restrict Lua scripting using ACLs.
    redis-cli -a P@ssw0rd ACL SETUSER default -@EVAL -@FUNCTION
    
  3. Network Segmentation: Ensure Redis is not exposed to the internet. Use firewalls to restrict access to trusted IPs only.
  4. Authentication: Enforce strong passwords for all Redis users.
  5. Monitoring: Enable detailed logging and monitor for suspicious Lua script execution.

Long-Term Measures:

  • Regularly update Redis to the latest stable version.
  • Implement a vulnerability management program to track and patch CVEs.
  • Use a Web Application Firewall (WAF) or intrusion detection system (IDS) to detect exploitation attempts.
  • Conduct regular security audits and penetration testing.

Valters IT
Securing Your Digital Frontier

{/* [Security Hash: 84ECF20C06C09B7097CE3703] */}

🔍 NUCLEI DETECTION TEMPLATE PROJECTDISCOVERY NUCLEI ↗

Nuclei is an open-source vulnerability scanner by ProjectDiscovery. This YAML template automates detection of this CVE against a target. Run with: nuclei -t template.yaml -u <target>

id: CVE-2025-46818

info:
  name: Redis Lua Sandbox < 8.2.2 - Cross-User Escape
  author: pussycat0x
  severity: high
  description: |
    Redis is an open source, in-memory database that persists on disk. Versions 8.2.1 and below allow an authenticated user to use a specially crafted Lua script to manipulate different LUA objects and potentially run their own code in the context of another user. The problem exists in all versions of Redis with LUA scripting. This issue is fixed in version 8.2.2. A workaround to mitigate the problem without patching the redis-server executable is to prevent users from executing LUA scripts. This can be done using ACL to block a script by restricting both the EVAL and FUNCTION command families.
  impact: |
    Authenticated users can execute arbitrary code in the context of other users, potentially leading to full system compromise.
  remediation: |
    Upgrade to version 8.2.2 or later.
  reference:
    - https://github.com/dwisiswant0/CVE-2025-46818
  metadata:
    verified: true
    max-request: 1
    shodan-query: product:"redis"
  tags: cve,cve2025,js,redis,network,passive,authenticated,vuln

flow: javascript(1) && javascript(2)

javascript:
  - pre-condition: |
      isPortOpen(Host,Port);

    code: |
      const redis = require('nuclei/redis');
      const info = redis.GetServerInfo(Host,Port);
      Export(info);

    args:
      Host: "{{Host}}"
      Port: "6379"

    matchers:
      - type: dsl
        dsl:
          - success == true
          - compare_versions(version, ' < 8.2.2')
        condition: and

    extractors:
      - type: regex
        name: version
        part: response
        group: 1
        regex:
          - redis_version:(\d+\.\d+\.\d+)

  - code: |
      const redis = require('nuclei/redis');
      const info = redis.RunLuaScript(Host,Port,Password,Payload);
      Export(info);

    args:
      Host: "{{Host}}"
      Port: "6379"
      Password: "{{passwords}}"
      Payload: 'return "lua enabled"'

    payloads:
      passwords:
        - ""

    matchers:
      - type: dsl
        dsl:
          - success == true
          - contains(response, 'lua enabled')
        condition: and
        internal: true
# digest: 4a0a00473045022010a8b21af4351c8b04a18a997e16bd08568a4899057328a81f47dce5a6eb79d2022100acbae21d3075ee7e9279ae83b0d57646b508bc4dbed2c6969d8d3ba7d98d3357:922c64590222798bb761d5b6d8e72950
◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2025-46818/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.