Skip to content

Code

Server fetches a URL chosen by the caller (SSRF)code.ssrf

The server makes a request to a URL that comes from the request. An attacker can point it at internal services or the cloud metadata endpoint (169.254.169.254) and read credentials your server can reach but the internet cannot.

  • In force Rule code.ssrf
  • 3 clauses

At a glance

code.ssrf
Severityhigh
CertaintyNeeds review — a heuristic; confirm before changing code
Looks atyour source code
When it runsRuns on every scan

How to fix it

Accept an id or a path, not a URL; or allow-list hosts and resolve + block private/link-local IPs before fetching.

Check your own app

Run npx scanlyfix scan in your project. Every finding gets an id; after fixing, npx scanlyfix verify <id> proves it is gone.

If it is a false positive in your project, silence that one line with // scanlyfix-ignore-next-line code.ssrf -- <why>.

All rules

Your code stays
on your machine

Only findings are uploaded, and only to your own dashboard.