CAS-005 · Question #155
A security engineer is reviewing the following piece of code for an internally developed web application that allows employees to manipulate documents from a number of internal servers. Users can…
The correct answer is D. A WAF. The web application directly uses a user-supplied URL parameter in a requests.get() call, which is highly vulnerable to Server-Side Request Forgery (SSRF) and other URL-based attacks.
Question
A security engineer is reviewing the following piece of code for an internally developed web application that allows employees to manipulate documents from a number of internal servers. Users can specify the document to be parsed by passing the document URL to the application as a parameter. The application then executes the following Python call: response = requests.get(url) The engineer wants to improve the security of the application before deployment. Which of the following is the best to implement?
Options
- AIndexing
- BOutput encoding
- CA code scanner
- DA WAF
How the community answered
(23 responses)- A13% (3)
- B22% (5)
- C4% (1)
- D61% (14)
Why each option
The web application directly uses a user-supplied URL parameter in a `requests.get()` call, which is highly vulnerable to Server-Side Request Forgery (SSRF) and other URL-based attacks.
Indexing is a database optimization technique or a search mechanism, which is irrelevant to preventing web application vulnerabilities like SSRF.
Output encoding protects against Cross-Site Scripting (XSS) by ensuring user-supplied data displayed on a web page is rendered as data, not executable code; it does not protect against vulnerabilities arising from processing user input on the server side (like SSRF).
A code scanner (SAST/DAST) helps identify vulnerabilities in code or applications, but it is a detection tool, not a direct implementation to *prevent* the attack in real-time or mitigate the vulnerability at runtime.
A Web Application Firewall (WAF) is designed to protect web applications from various attacks by filtering and monitoring HTTP traffic between a web application and the Internet. A WAF can inspect incoming requests, including URL parameters, and block malicious inputs that could lead to Server-Side Request Forgery (SSRF) or other URL-based vulnerabilities inherent in processing user-supplied URLs.
Concept tested: Web application firewall protection for SSRF
Source: https://learn.microsoft.com/en-us/azure/web-application-firewall/overview
Community Discussion
No community discussion yet for this question.