Exploit databaseDownload repository ZIP
GH-3ca1b932c3ad16fd6b5ed90069e1bbe9
zombie-kaiser/cve-2026-108551-poc
Sources for CVE-2026-108551
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files2
zombie-kaiser/cve-2026-108551-pocRevision e163d0c26e22
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
scripts/version_check.py
Python · 3,064 bytes#!/usr/bin/env python3
"""Offline patch-status check for the CVE tracked in data/cve.json.
No network access and no exploit logic. Compares a version string against the
affected ranges recorded in the local dataset.
Usage:
python scripts/version_check.py 0.31.0
python scripts/version_check.py 0.32.0 --json
"""
from __future__ import annotations
import argparse
import json
import pathlib
import re
DATA_FILE = pathlib.Path(__file__).resolve().parent.parent / "data" / "cve.json"
def parse_version(text: str) -> tuple[int, ...]:
parts = [int(n) for n in re.findall(r"\d+", text)[:4]]
return tuple(parts) if parts else (0,)
def compare(a: tuple[int, ...], b: tuple[int, ...]) -> int:
width = max(len(a), len(b))
a = a + (0,) * (width - len(a))
b = b + (0,) * (width - len(b))
return (a > b) - (a < b)
def in_range(version: str, expression: str) -> bool:
current = parse_version(version)
for constraint in re.split(r"\s+(?=[<>])", expression.strip()):
constraint = constraint.strip().strip(",")
if not constraint:
continue
match = re.match(r"^(<=|>=|<|>|==)?\s*(\S+)$", constraint)
if not match:
return False
operator = match.group(1) or "=="
result = compare(current, parse_version(match.group(2)))
ok = {
"<": result < 0,
"<=": result <= 0,
">": result > 0,
">=": result >= 0,
"==": result == 0,
}[operator]
if not ok:
return False
return True
def main() -> int:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("version", help="Installed version to evaluate")
parser.add_argument("--json", action="store_true", help="Emit JSON")
parser.add_argument("--data", default=str(DATA_FILE), help="Path to cve.json")
args = parser.parse_args()
with open(args.data, encoding="utf-8") as handle:
cve = json.load(handle)["cve"]
affected = any(in_range(args.version, expr) for expr in cve["affected"])
result = {
"cve": cve["id"],
"version": args.version,
"status": "AFFECTED" if affected else "NOT AFFECTED",
"patch_status": cve["patch_status"],
"fixed": cve["fixed"],
"affected_ranges": cve["affected"],
"public_poc": cve["existing_public_poc"],
"guidance": cve["defensive_guidance"],
}
if args.json:
print(json.dumps(result, indent=2))
else:
print(f"{result['cve']} {result['status']} (version {args.version})")
print(f" affected : {', '.join(result['affected_ranges'])}")
print(f" fixed : {result['fixed'] or 'no official fix'}")
print(f" patch : {result['patch_status']}")
print(f" public PoC: {'yes' if result['public_poc'] else 'none confirmed'}")
if affected:
print(" action : upgrade or apply mitigation (see README)")
return 1 if affected else 0
if __name__ == "__main__":
raise SystemExit(main())