SecurityContext

CVE-2025-46818: Redis Lua Sandbox < 8.2.2 - Cross-User Escape

  • Template: CVE-2025-46818
  • Name: Redis Lua Sandbox < 8.2.2 - Cross-User Escape
  • 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.
  • Severity: high
  • Authors: pussycat0x
  • Tags: cve, cve2025, js, redis, network, passive, authenticated, vuln
  • References: https://github.com/dwisiswant0/CVE-2025-46818
  • Cves: CVE-2025-46818
  • Verified: yes
  • Max requests: 1
  • Directory: javascript/cves
  • Path: javascript/cves/2025/CVE-2025-46818.yaml
  • Digest: 4a0a00473045022010a8b21af4351c8b04a18a997e16bd08568a4899057328a81f47dce5a6eb79d2022100acbae21d3075ee7e9279ae83b0d57646b508bc4dbed2c6969d8d3ba7d98d3357
  • Created at: 2025-10-11T15:15:48Z
  • Updated at: 2025-10-26T16:17:37Z
  • Age in days: 409
  • Template url: https://github.com/projectdiscovery/nuclei-templates/blob/main/javascript/cves/2025/CVE-2025-46818.yaml
  • Checked, none or zero: products

Classification

  • Checked, none or zero: cwe
  • Not known: cvss score, cvss vector, epss score, epss percentile, cpe

Metadata

  • Max-request: 1
  • Shodan-query: product:"redis"
  • Verified: yes

Labels

  • Name: Redis - Command Injection
  • 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.
  • Vulnerability type: command_injection
  • Vulnerability impact: remote_code_execution
  • Requirement type: logged_in
  • Requirements: Attacker must be authenticated
  • Labels source: projectdiscovery
  • From cve: CVE-2025-46818

```yaml

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

```