312-50V12 · Question #263
An ethical hacker is testing a web application of a financial firm. During the test, a 'Contact Us' form's input field is found to lack proper user input validation, indicating a potential…
The correct answer is A. Utilize a script hosted on the application's domain to test the form. To confirm the XSS vulnerability while respecting the Content Security Policy (CSP), the hacker should utilize a script hosted on the application's own domain, as this is the only script source explicitly permitted by the CSP.
Question
Options
- AUtilize a script hosted on the application's domain to test the form
- BTry to disable the CSP to bypass script restrictions
- CInject a benign script inline to the form to see if it executes
- DLoad a script from an external domain to test the vulnerability
How the community answered
(41 responses)- A76% (31)
- B12% (5)
- C5% (2)
- D7% (3)
Why each option
To confirm the XSS vulnerability while respecting the Content Security Policy (CSP), the hacker should utilize a script hosted on the application's own domain, as this is the only script source explicitly permitted by the CSP.
The application's Content Security Policy (CSP) is configured to permit scripts originating from its own domain. By injecting a script tag that references a script hosted on the application's domain, the ethical hacker can bypass the CSP's restrictions against inline and external scripts and successfully confirm the XSS vulnerability if input validation is indeed lacking.
An ethical hacker cannot disable a server-configured Content Security Policy (CSP) through a client-side injection into an input field; CSP is a security header set by the server, enforced by the browser.
The Content Security Policy (CSP) explicitly disallows inline scripts, meaning any attempt to inject a script directly within the HTML markup would be blocked by the browser, preventing execution.
The Content Security Policy (CSP) explicitly disallows scripts loaded from external domains, meaning the browser would block any attempt to execute a script hosted outside the application's origin.
Concept tested: Content Security Policy (CSP) bypass techniques for XSS
Source: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
Topics
Community Discussion
No community discussion yet for this question.