Exploit databaseDownload repository ZIP
GH-ae5355800bcc907f9082e752ff9464f1
hackspeak/cve-2026-23479
Sources for CVE-2026-23479
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files2
hackspeak/cve-2026-23479Revision 9fd4aecd1309
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
v1c0mmrt-scanner/src/redis_cve_scanner.py
Python · 10,117 bytes#!/usr/bin/env python3
"""CVE-2026-23479 Scanner - Redis UAF Vulnerability Detector
For authorized security assessment only.
Author: AI Security Lab | License: MIT"""
import argparse, sys, json
from dataclasses import dataclass, field
from typing import Optional
try:
import redis as redis_lib
except ImportError:
redis_lib = None
AFFECTED = {"7.2": ("7.2.0", "7.2.13"), "7.4": ("7.4.0", "7.4.8"),
"8.2": ("8.2.0", "8.2.5"), "8.4": ("8.4.0", "8.4.2"),
"8.6": ("8.6.0", "8.6.2")}
FIXED = {"7.2": "7.2.14", "7.4": "7.4.9", "8.2": "8.2.6",
"8.4": "8.4.3", "8.6": "8.6.3"}
def parse_version(ver_str):
return tuple(int(p) for p in ver_str.strip().split("."))
def get_branch(version):
parts = version.split(".")
return f"{parts[0]}.{parts[1]}" if len(parts) >= 2 else None
def is_vulnerable(version):
branch = get_branch(version)
if branch not in AFFECTED:
return {"vulnerable": False, "reason": "branch_not_affected", "branch": branch}
min_ver, max_ver = AFFECTED[branch]
v = parse_version(version)
if v < parse_version(min_ver):
return {"vulnerable": False, "reason": "version_below_range", "branch": branch}
elif v <= parse_version(max_ver):
return {"vulnerable": True, "reason": "version_in_affected_range",
"branch": branch, "affected_range": f"{min_ver} - {max_ver}",
"fixed_version": FIXED.get(branch, "unknown")}
else:
return {"vulnerable": False, "reason": "already_patched", "branch": branch}
def check_auth(r):
try:
r.ping()
return {"auth_required": False, "risk": "critical",
"detail": "No authentication required"}
except redis_lib.AuthenticationError:
return {"auth_required": True, "risk": "info",
"detail": "Authentication enabled"}
except Exception as e:
return {"auth_required": None, "risk": "unknown", "detail": str(e)}
def check_acl(r):
results = {}
try:
whoami = r.execute_command("ACL WHOAMI")
results["user"] = whoami.decode() if isinstance(whoami, bytes) else whoami
acl_list = r.execute_command("ACL LIST")
for line in acl_list:
line = line.decode() if isinstance(line, bytes) else line
if f"user {results['user']}" in line:
results["acl_rule"] = line
if "+@all" in line or "~*" in line:
results["risk"] = "high"
results["detail"] = "Full permissions (exploit prerequisites met)"
else:
results["risk"] = "medium"
results["detail"] = "Limited permissions"
break
except Exception as e:
results["error"] = str(e)
return results
def check_exposure(r):
results = {}
try:
config = r.config_get()
results["bind"] = config.get("bind", "unknown")
bind = str(results["bind"])
if "0.0.0.0" in bind or bind == "::":
results["exposure_risk"] = "high"
results["exposure_detail"] = "Bound to all interfaces"
elif "127.0.0.1" in bind:
results["exposure_risk"] = "low"
results["exposure_detail"] = "Bound to localhost"
else:
results["exposure_risk"] = "medium"
results["exposure_detail"] = f"Bound to: {bind}"
except Exception as e:
results["error"] = str(e)
return results
def check_mitigations(r):
results = {}
try:
config = r.config_get()
ev = config.get("rename-command-EVAL", None)
results["lua_disabled"] = bool(ev and ev != "")
cf = config.get("rename-command-CONFIG", None)
results["config_restricted"] = bool(cf and cf != "")
except Exception as e:
results["error"] = str(e)
return results
@dataclass
class ScanResult:
target: str
port: int
version: Optional[str] = None
vulnerable: Optional[dict] = None
auth: Optional[dict] = None
commands: Optional[dict] = None
exposure: Optional[dict] = None
mitigations: Optional[dict] = None
error: Optional[str] = None
risk_level: str = "unknown"
recommendations: list = field(default_factory=list)
def scan_target(host, port=6379, password=None, username=None):
result = ScanResult(target=host, port=port)
if redis_lib is None:
result.error = "redis library not installed. Run: pip install redis"
return result
try:
r = redis_lib.Redis(host=host, port=port, password=password,
username=username, socket_timeout=5,
socket_connect_timeout=5, decode_responses=False)
info = r.info("server")
result.version = info.get("redis_version", "unknown")
result.vulnerable = is_vulnerable(result.version)
result.auth = check_auth(r)
result.commands = check_acl(r)
result.exposure = check_exposure(r)
result.mitigations = check_mitigations(r)
if result.vulnerable and result.vulnerable.get("vulnerable"):
if not result.auth.get("auth_required", True):
result.risk_level = "CRITICAL"
else:
result.risk_level = "HIGH"
recs = []
fixed = result.vulnerable.get("fixed_version", "unknown")
recs.append(f"[URGENT] Upgrade Redis to {fixed} or later")
if result.exposure.get("exposure_risk") == "high":
recs.append("Bind to specific interfaces, avoid 0.0.0.0")
if not result.auth.get("auth_required", True):
recs.append("Enable authentication (requirepass / ACL)")
if result.commands.get("risk") == "high":
recs.append("Restrict user permissions with ACL")
if not result.mitigations.get("lua_disabled", False):
recs.append("Consider disabling EVAL if not needed")
result.recommendations = recs
else:
result.risk_level = "LOW"
except redis_lib.ConnectionError:
result.error = "Connection refused"
result.risk_level = "error"
except redis_lib.AuthenticationError:
result.auth = {"auth_required": True}
result.risk_level = "info"
except Exception as e:
result.error = str(e)
result.risk_level = "error"
return result
def format_output(results, fmt="text"):
if fmt == "json":
out = []
for r in results:
out.append({"target": f"{r.target}:{r.port}", "version": r.version,
"vulnerable": r.vulnerable, "risk_level": r.risk_level,
"auth": r.auth, "exposure": r.exposure,
"mitigations": r.mitigations, "recommendations": r.recommendations,
"error": r.error})
return json.dumps(out, indent=2, ensure_ascii=False)
lines = []
for r in results:
lines.append("=" * 60)
lines.append(f"Target: {r.target}:{r.port}")
lines.append("-" * 60)
if r.error:
lines.append(f" [ERROR] {r.error}")
continue
if r.version:
lines.append(f" Redis Version: {r.version}")
if r.vulnerable:
st = "VULNERABLE" if r.vulnerable.get("vulnerable") else "NOT VULNERABLE"
lines.append(f" CVE-2026-23479: {st}")
if r.vulnerable.get("vulnerable"):
lines.append(f" Affected Range: {r.vulnerable.get('affected_range')}")
lines.append(f" Fixed Version: {r.vulnerable.get('fixed_version')}")
lines.append(f" Risk Level: {r.risk_level}")
if r.auth:
lines.append(f" Auth Required: {r.auth.get('auth_required', 'unknown')}")
if r.exposure:
lines.append(f" Bind: {r.exposure.get('bind', 'unknown')}")
lines.append(f" Exposure Risk: {r.exposure.get('exposure_risk', 'unknown')}")
if r.mitigations:
lines.append(f" Lua Mitigation: {'Yes' if r.mitigations.get('lua_disabled') else 'No'}")
lines.append(f" CONFIG Restricted: {'Yes' if r.mitigations.get('config_restricted') else 'No'}")
if r.recommendations:
lines.append(" Recommendations:")
for rec in r.recommendations:
lines.append(f" - {rec}")
lines.append("=" * 60)
return "\n".join(lines)
def main():
p = argparse.ArgumentParser(description="CVE-2026-23479 Redis UAF Scanner")
p.add_argument("targets", nargs="+", help="Target host(s)")
p.add_argument("-p", "--port", type=int, default=6379)
p.add_argument("-a", "--password", help="Redis password")
p.add_argument("-u", "--username", help="Redis username")
p.add_argument("-f", "--format", choices=["text", "json"], default="text")
p.add_argument("-o", "--output", help="Output file")
args = p.parse_args()
targets = []
for t in args.targets:
if t.startswith("@"):
with open(t[1:]) as fh:
for line in fh:
line = line.strip()
if line and not line.startswith("#"):
targets.append(line)
else:
targets.append(t)
results = []
for target in targets:
if ":" in target:
host, ps = target.rsplit(":", 1)
try:
port = int(ps)
except ValueError:
host, port = target, args.port
else:
host, port = target, args.port
print(f"Scanning {host}:{port}...", file=sys.stderr)
results.append(scan_target(host, port, args.password, args.username))
output = format_output(results, args.format)
if args.output:
with open(args.output, "w") as fh:
fh.write(output)
print(f"Saved to {args.output}", file=sys.stderr)
else:
print(output)
vuln = any(r.vulnerable and r.vulnerable.get("vulnerable") for r in results)
sys.exit(2 if vuln else 0)
if __name__ == "__main__":
main()