nerdexam
CompTIA

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.

Attacks and exploits

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)
  • A
    7% (2)
  • B
    90% (26)
  • C
    3% (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.

ACommand injection attack

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.

BClickjacking attackCorrect

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.

CDirectory traversal 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.

DRemote file inclusion attack

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

#Content Security Policy#clickjacking#web security headers#missing security controls

Community Discussion

No community discussion yet for this question.

Full PT0-001 Practice