nerdexam
CompTIA

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.

Submitted by minji_kr· Mar 6, 2026Security Architecture

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)
  • A
    13% (3)
  • B
    22% (5)
  • C
    4% (1)
  • D
    61% (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.

AIndexing

Indexing is a database optimization technique or a search mechanism, which is irrelevant to preventing web application vulnerabilities like SSRF.

BOutput encoding

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).

CA code scanner

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.

DA WAFCorrect

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.

Full CAS-005 Practice