User-controlled input is being used to construct URLs, which may lead to unauthorized requests to internal resources.
1require 'net/http'
2
3def server_side_request_forgery_noncompliant
4 url = params[:url]
5 # Noncompliant: url is passing through `HTTP.get()`.
6 Net::HTTP.get(url, "/index.html")
7end1def server_side_request_forgery_compliant
2 url = params[:url]
3 # Compliant: url is not passing through `HTTP.get()`.
4 Net::HTTP.get("example.com", "/index.html")
5end