Exploit databaseDownload repository ZIP
GH-f6e3fe8a663244c73feafdc71f91b743
davidoberst/cve-2025-50579-cors-misconfiguration-exploit
Sources for CVE-2025-50579
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files2
davidoberst/cve-2025-50579-cors-misconfiguration-exploitRevision 61bfa75aa36e
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
CVE-2025-50579.py
Python · 1,894 bytesimport sys
import requests
print("""
======================================================================
CVE-2025-50579 - CORS Misconfiguration
======================================================================
The application reflects an arbitrary Origin in
Access-Control-Allow-Origin while also setting
Access-Control-Allow-Credentials: true. This allows a malicious
website to make authenticated cross-origin requests and read the
responses, leading to sensitive data exposure.
----------------------------------------------------------------------
""")
if len(sys.argv) > 1:
target = sys.argv[1]
else:
target = input(" Paste your target here : ")
evil_origin = "https://attacker.example"
try:
response = requests.get(
target,
headers={"Origin": evil_origin},
timeout=10,
)
except requests.RequestException as e:
print(f"\n [!] Request failed: {e}")
sys.exit(1)
acao = response.headers.get("Access-Control-Allow-Origin", "")
acac = response.headers.get("Access-Control-Allow-Credentials", "")
print(" CORS headers returned:")
print(f" Access-Control-Allow-Origin : {acao or '(none)'}")
print(f" Access-Control-Allow-Credentials : {acac or '(none)'}")
print("-" * 70)
reflects_origin = acao == evil_origin or acao == "*"
allows_credentials = acac.lower() == "true"
if reflects_origin and allows_credentials:
print(f" [VULNERABLE] {target}")
print(" The server reflects an arbitrary Origin AND allows credentials.")
elif acao == "*" :
print(f" [INFO] {target}")
print(" Wildcard ACAO present, but credentials are not allowed (lower risk).")
elif reflects_origin:
print(f" [INFO] {target}")
print(" Origin is reflected but credentials are not allowed (lower risk).")
else:
print(f" [NOT VULNERABLE] {target}")
print(" The server did not reflect the test Origin.")