Dark Mode
Capec-664 Detail
Server Side Request Forgery
Standard Software Likelihood: High Typical Severity: High
Parents: 115
Tools: 18
An adversary exploits improper input validation by submitting maliciously crafted input to a target application running on a server, with the goal of forcing the server to make a request either to itself, to web services running in the server’s internal network, or to external third parties. If successful, the adversary’s request will be made with the server’s privilege level, bypassing its authentication controls. This ultimately allows the adversary to access sensitive data, execute commands on the server’s network, and make external requests with the stolen identity of the server. Server Side Request Forgery attacks differ from Cross Site Request Forgery attacks in that they target the server itself, whereas CSRF attacks exploit an insecure user authentication mechanism to perform unauthorized actions on the user's behalf.
Not present
| External ID | Source | Link | Description |
|---|---|---|---|
| CAPEC-664 | capec | https://capec.mitre.org/data/definitions/664.html | |
| CWE-918 | cwe | http://cwe.mitre.org/data/definitions/918.html | |
| CWE-20 | cwe | http://cwe.mitre.org/data/definitions/20.html | |
| REF-644 | reference_from_CAPEC | https://cheatsheetseries.owasp.org/assets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet_SSRF_Bible.pdf | OWASP SSRF Bible, 2017--01---26, OWASP |
| REF-645 | reference_from_CAPEC | https://portswigger.net/web-security/ssrf | Server Side Request Forgery, PortSwigger |
| REF-646 | reference_from_CAPEC | https://github.com/yunuscadirci/CallStranger | CallStranger Vulnerability, 2020--06---08, Yunus Cadirici |
Explore
-
Find target application: Find target web application that accepts a user input and retrieves data from the server
Experiment
-
Examine existing application requests: Examine HTTP/GET requests to view the URL query format. Adversaries test to see if this type of attack is possible through weaknesses in an application's protection to Server Side Request Forgery
| Techniques |
|---|
| Attempt manipulating the URL to retrieve an error response/code from the server to determine if URL/request validation is done. |
| Use a list of XSS probe strings to specify as parameters to known URLs. If possible, use probe strings with unique identifiers. |
| Create a GET request with a common server file path such as /etc/passwd as a parameter and examine output. |
Exploit
-
Malicious request: Adversary crafts a malicious URL request that assumes the privilege level of the server to query internal or external network services and sends the request to the application
- Server must be running a web application that processes HTTP requests.
- [None] No specialized resources are required to execute this type of attack.
| High | Medium |
|---|---|
| The adversary will be required to access internal resources, extract information, or leverage the services running on the server to perform unauthorized actions such as traversing the local network or routing a reflected TCP DDoS through them. | |
| The adversary will have to detect the vulnerability through an intermediary service or specify maliciously crafted URLs and analyze the server response. |
| Integrity | Availability | Confidentiality |
|---|---|---|
| Modify Data | Modify Data | Modify Data |
| Resource Consumption | Read Data |
- An e-commerce website allows a customer to filter results by specific categories. When the customer selects the category of choice, the web shop queries a back-end service to retrieve the requested products. The request may look something like: POST /product/category HTTP/1.0 Content-Type: application/x-www-form-urlencoded Content-Length: 200 vulnerableService=http://vulnerableshop.net:8080/product/category/check%3FcategoryName%3DsomeCategory A malicious user can modify the request URL to look like this instead: POST /product/category HTTP/1.0 Content-Type: application/x-www-form-urlencoded Content-Length: 200 vulnerableService=http://localhost/server-status or vulnerableService = file:///etc/passwd or vulnerableService=dict://localhost:12345/info If the exploit is successful, the server may return the data requested by the adversary root:!:0:0::/:/usr/bin/ksh daemon:!:1:1::/etc: bin:!:2:2::/bin: sys:!:3:3::/usr/sys: adm:!:4:4::/var/adm: uucp:!:5:5::/usr/lib/uucp: guest:!:100:100::/home/guest: nobody:!:4294967294:4294967294::/: lpd:!:9:4294967294::/: lp::11:11::/var/spool/lp:/bin/false invscout::200:1::/var/adm/invscout:/usr/bin/ksh nuucp::6:5:uucp login user:/var/spool/uucppublic:/usr/sbin/uucp/uucico paul:!:201:1::/home/paul:/usr/bin/ksh jdoe::202:1:My name:/home/myname:/usr/bin/ksh
- The CallStranger attack is an observed example of SSRF. It specifically targets the UPnP (Universal Plug and Play) protocol used by various network devices and gaming consoles. To execute the attack, an adversary performs a scan of the LAN to discover UPnP enabled devices, and subsequently a list of UPnP services they use. Once the UPnP service endpoints are listed, a vulnerability in the UPnP protocol is used to send these endpoints as encrypted to a verification server via the UPnP Callback method. Because the encryption is done on the client side, the server returns an encrypted list of services which is decrypted on the client side. The adversary then has a list of services running the vulnerable UPnP protocol, which the adversary can leverage to make spoofed requests. [REF-646]