PT0-001 · Question #38
A penetration tester observes that the content security policy header is missing during a web application penetration test. Which of the following techniques would the penetration tester MOST likely…
The correct answer is B. Clickjacking attack. A missing Content Security Policy header removes the frame-ancestors directive, leaving the application vulnerable to clickjacking by permitting it to be embedded in a malicious iframe.
Question
A penetration tester observes that the content security policy header is missing during a web application penetration test. Which of the following techniques would the penetration tester MOST likely perform?
Options
- ACommand injection attack
- BClickjacking attack
- CDirectory traversal attack
- DRemote file inclusion attack
How the community answered
(29 responses)- A7% (2)
- B90% (26)
- C3% (1)
Why each option
A missing Content Security Policy header removes the frame-ancestors directive, leaving the application vulnerable to clickjacking by permitting it to be embedded in a malicious iframe.
Command injection targets server-side input handling where user-supplied data is passed to OS commands and has no relationship to the presence or absence of client-side HTTP security headers like CSP.
The Content Security Policy header's frame-ancestors directive controls which origins are permitted to embed the page in an iframe or frame. When CSP is absent, there is no restriction on iframe embedding, allowing an attacker to load the legitimate authenticated page inside an invisible iframe on a malicious site and trick users into unknowingly performing actions such as fund transfers or account changes - a clickjacking attack.
Directory traversal exploits improper path normalization on the server to access files outside the web root, a server-side vulnerability entirely unrelated to client-side CSP headers.
Remote file inclusion exploits server-side script inclusion mechanisms that load external files due to unsafe input handling, which is a server-side flaw independent of CSP configuration.
Concept tested: Content Security Policy frame-ancestors and clickjacking prevention
Source: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors
Topics
Community Discussion
No community discussion yet for this question.