Server-Side Request Forgery (SSRF) is a vulnerability that allows an attacker to send unauthorized requests from a vulnerable server, often to internal or private network resources. When it occurs in APIs, SSRF can lead to a range of security issues, including exposure of sensitive internal data, unauthorized access to internal systems, and potential for further exploitation.
Accessing Internal Services
GET /api/resource?url=http://internal-service.local/admin
If the API endpoint processes the url parameter without proper validation, it may allow access to internal services.
Accessing Cloud Metadata
GET /api/fetchData?url=http://169.254.169.254/latest/meta-data/
Exploiting an API to access cloud instance metadata services that are typically accessible only from within the cloud provider's network.
Exfiltrating Data
POST /api/submit
Content-Type: application/json
{
"url": "<http://internal-db.local/data>"
}
Using the API to retrieve sensitive data from internal databases.
To begin with, we authenticate by sending a POST request to the /api/v1/authentication/suppliers/sign-in endpoint using valid credentials to obtain a JSON Web Token (JWT).
Request:
curl -X POST \\\\
'<http://94.237.59.199:30544/api/v1/authentication/suppliers/sign-in>' \\\\
-H 'accept: application/json' \\\\
-H 'Content-Type: application/json' \\\\
-d '{
"Email": "[email protected]",
"Password": "HTBPentester11"
}' | jq .