Go Ssrf Unvalidated Url
Description
Detects Server-Side Request Forgery (SSRF) vulnerabilities in Go applications where unvalidated user input is used to construct HTTP request URLs. This could allow attackers to make unauthorized HTTP requests to internal or external systems through the vulnerable application.
Detection Strategy
• Code imports the 'net/http' package from Go standard library
• HTTP client methods like Get(), Post(), NewRequest() are called with parameters
• The URL or request parameters originate from user-controlled input without proper validation
• The user input flows into the HTTP request method without sufficient sanitization or checks
Vulnerable code example
package main
import (
"net/http"
"io"
)
func handler(w http.ResponseWriter, r *http.Request) {...✅ Secure code example
package main
import (
"net/http"
"net/url"
"io"
)
...Search for vulnerabilities in your apps for free with Fluid Attacks' automated security testing! Start your 21-day free trial and discover the benefits of the Continuous Hacking Essential plan. If you prefer the Advanced plan, which includes the expertise of Fluid Attacks' hacking team, fill out this contact form.