Conversation
|
🟡 3 security issues detected below the blocking threshold. Reviewed everything up to f4f9209. The following issues were found:
Evidence: Line 44: const addresses = await dns.lookup(parsedUrl.hostname, { all: true }); - resolves DNS for validation. Line 54: const resp = await axios.get(url); - axios resolves the hostname AGAIN independently. The resolved addresses from line 44 are not passed to the axios call. The comment on lines 42-43 states this is to 'prevent DNS rebinding' but the implementation doesn't actually prevent it.
Evidence: The
Evidence: Line 57: res.status(500).send(e.message); - The raw error message from a failed axios request is sent directly to the attacker. Error messages can include connection refused details, DNS resolution failures revealing internal hostnames, TLS errors revealing service details, etc.
Security Overview
Detected Code Changes
|
| const resp = await axios.get(url); | ||
| res.send(resp.data); |
There was a problem hiding this comment.
SSRF: /fetch endpoint does not validate redirect targets (Severity: MEDIUM)
Server-side request forgery (SSRF) can occur because the /fetch endpoint does not validate redirect targets, allowing attackers to access internal services. While the initial URL is checked, an attacker can host a server that redirects to internal resources, such as http://127.0.0.1:6379. This bypasses SSRF protections because axios on line 54 follows redirects by default, resulting in sensitive data from internal services being returned to the attacker via res.send(resp.data) on line 55.
View details in ZeroPath
| const resp = await axios.get(url); | |
| res.send(resp.data); | |
| const resp = await axios.get(url, { maxRedirects: 0 }); | |
| res.send(resp.data); |
💬 Reply @zeropath-ai false-positive because … or @zeropath-ai accepted-risk because … to triage this finding, or ask it any question.
|
@zeropath-ai rescan force |
|
Failed to trigger rescan due to an internal error. |
1 similar comment
|
Failed to trigger rescan due to an internal error. |
|
Rescan started for this PR. |
|
@zeropath-ai-staging rescan force |
|
Rescan started for this PR. |
No description provided.