We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9eabc33 commit 182643cCopy full SHA for 182643c
camel/toolkits/hybrid_browser_toolkit/ts/websocket-server.js
@@ -86,6 +86,12 @@ class WebSocketBrowserServer {
86
// Extract base URL and port for validation
87
const baseUrl = cdpUrl.includes('/devtools/') ? cdpUrl.split('/devtools/')[0] : cdpUrl;
88
89
+ // Validate CDP URL to prevent SSRF - only allow localhost
90
+ const parsed = new URL(baseUrl);
91
+ if (!['localhost', '127.0.0.1'].includes(parsed.hostname)) {
92
+ throw new Error('CDP URL must use localhost or 127.0.0.1');
93
+ }
94
+
95
try {
96
// Test if Chrome debug port is accessible and get page URL
97
const response = await fetch(`${baseUrl}/json`);
0 commit comments