CVE-2020-14147

7.7 HIGH

📋 TL;DR

This CVE describes an integer overflow vulnerability in Redis's Lua sandbox that allows authenticated users with Lua execution permissions to trigger a stack-based buffer overflow. This can lead to denial of service (crash) or potentially bypass sandbox restrictions. Affects Redis instances where Lua scripting is enabled and users have execution permissions.

💻 Affected Systems

Products:
  • Redis
Versions: All versions before 6.0.3
Operating Systems: All platforms running vulnerable Redis versions
Default Config Vulnerable: ⚠️ Yes
Notes: Requires Lua scripting enabled (default) and user permissions to execute Lua scripts

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Memory corruption leading to arbitrary code execution, sandbox escape, and complete system compromise

🟠

Likely Case

Denial of service through Redis crash and potential data corruption

🟢

If Mitigated

No impact if Lua scripting is disabled or users lack execution permissions

🌐 Internet-Facing: MEDIUM - Requires authenticated Lua execution access, but Redis often exposed with default configurations
🏢 Internal Only: MEDIUM - Same requirements as internet-facing, but reduced attack surface

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires authenticated access with Lua execution permissions. The vulnerability is a regression of CVE-2015-8080.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Redis 6.0.3 and later

Vendor Advisory: https://github.com/redis/redis/releases/tag/6.0.3

Restart Required: Yes

Instructions:

1. Backup Redis data and configuration. 2. Stop Redis service. 3. Upgrade to Redis 6.0.3 or later. 4. Restart Redis service. 5. Verify functionality.

🔧 Temporary Workarounds

Disable Lua scripting

all

Prevents exploitation by disabling the vulnerable Lua execution functionality

redis-cli CONFIG SET lua-time-limit 0
redis-cli CONFIG SET user default on nopass ~* &* -@all +ping

Restrict Lua script permissions

all

Limit which users can execute Lua scripts to reduce attack surface

redis-cli ACL SETUSER <username> on ><password> ~* &* -@all +ping +eval

🧯 If You Can't Patch

  • Implement strict network access controls to limit Redis exposure
  • Disable Lua scripting entirely or restrict to trusted users only

🔍 How to Verify

Check if Vulnerable:

Check Redis version and compare against vulnerable range (< 6.0.3)

Check Version:

redis-cli --version

Verify Fix Applied:

Confirm Redis version is 6.0.3 or later and test Lua script execution

📡 Detection & Monitoring

Log Indicators:

  • Redis crash logs
  • Unexpected Lua script execution patterns
  • Memory corruption errors

Network Indicators:

  • Unusual Lua script execution requests
  • Multiple failed Lua execution attempts

SIEM Query:

source="redis" AND ("crash" OR "segmentation fault" OR "lua" AND "overflow")

🔗 References

📤 Share & Export