Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

The SecOps Group CAP Exam - Topic 25 Question 99 Discussion

Posted by Reiko on Aug 16, 2025 at 12:06 PM

Which of the following directives in a Content-Security-Policy HTTP response header, can be used to prevent a Clickjacking attack?

Suggested Answer: C

Clickjacking is an attack where a malicious site overlays a transparent iframe containing a legitimate site, tricking users into interacting with it unintentionally (e.g., clicking a button). The Content-Security-Policy (CSP) HTTP response header is used to mitigate various client-side attacks, including clickjacking, through specific directives. The frame-ancestors directive is the correct choice for preventing clickjacking. This directive specifies which origins are allowed to embed the webpage in an iframe, <frame>, or <object>. For example, setting frame-ancestors 'self' restricts framing to the same origin, effectively blocking external sites from embedding the page. This is a standard defense mechanism recommended by OWASP and other security frameworks.

Option A ('script-src') controls the sources from which scripts can be loaded, addressing XSS (Cross-Site Scripting) vulnerabilities but not clickjacking. Option B ('object-src') restricts the sources of plugins or embedded objects (e.g., Flash), which is unrelated to iframe-based clickjacking. Option D ('base-uri') defines the base URL for relative URLs in the document, offering no protection against framing attacks. The use of CSP with the frame-ancestors directive is a critical topic in the CAP syllabus under 'Security Headers' and 'OWASP Top 10' (UI Redressing).


Get Premium CAP Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
25 comments · newest first
TE
Terrilyn 9 months ago
I thought base-uri was for something else, right?
GI
Gilbert 9 months ago
Definitely C, no doubt about it!
JO
Joesph 10 months ago
Wait, are we sure object-src doesn't help too?
BA
Bambi 10 months ago
C is the right one, frame-ancestors blocks it.
JO
Joesph 10 months ago
Totally agree, frame-ancestors is key for Clickjacking!
CR
Crista 11 months ago
I’m a bit confused; I thought script-src could also help with security, but now I’m leaning towards C as well.
LO
Loren 11 months ago
I feel like I’ve seen a question like this before, and frame-ancestors definitely stood out as the right choice for preventing Clickjacking.
SU
Susy 11 months ago
I'm not entirely sure, but I remember something about object-src being related to media types, not really for Clickjacking.
ST
Starr 11 months ago
I think the answer might be C, frame-ancestors, because it controls which sites can embed your content in frames.
GE
Gearldine 12 months ago
C, frame-ancestors, is the correct answer. This directive allows you to specify which domains are allowed to embed your page, which is the primary defense against Clickjacking attacks.
SE
Serina 12 months ago
I'm a bit confused on this one. I know the Content-Security-Policy header is important for security, but I'm not sure which specific directive is used to prevent Clickjacking. I'll have to review my notes on this topic before answering.
NE
Nenita 12 months ago
The frame-ancestors directive sounds like the right answer to me. It allows you to specify which domains are allowed to embed your page, which is the key to preventing Clickjacking attacks.
EL
Elmer 1 year ago
Hmm, I'm a bit unsure about this one. I know the Content-Security-Policy header is used to prevent various web security threats, but I can't quite remember which directive is specifically for Clickjacking. I'll have to think this through carefully.
TE
Teresita 1 year ago
I'm pretty sure the answer is C. The frame-ancestors directive is used to prevent Clickjacking attacks by restricting which domains can embed the current page.
RO
Ronny 1 year ago
Definitely C) frame-ancestors. I remember learning about that in my web security course.
FA
Fabiola 9 months ago
↳ replying to Ronny
Definitely a must-know for web developers!
MI
Micaela 9 months ago
↳ replying to Ronny
I learned that too! Super important for security.
LE
Leonor 10 months ago
↳ replying to Ronny
I agree, C) frame-ancestors is the right choice!
ED
Edmond 10 months ago
↳ replying to Ronny
Yes, it blocks the site from being framed.
KE
Kenda 1 year ago
I agree with Cordelia, frame-ancestors is used to prevent Clickjacking attacks.
LO
Lonna 1 year ago
I think the answer is C) frame-ancestors. That directive is specifically used to prevent Clickjacking attacks.
AL
Aleta 1 year ago
↳ replying to Lonna
Actually, it's C) frame-ancestors, that's the one specifically designed for Clickjacking protection.
LE
Lelia 1 year ago
↳ replying to Lonna
I think it's D) base-uri, that directive can also help prevent Clickjacking.
PA
Paola 1 year ago
↳ replying to Lonna
I agree, C) frame-ancestors is the correct answer to prevent Clickjacking attacks.
CO
Cordelia 1 year ago
I think the directive that can prevent Clickjacking is C) frame-ancestors.
0/2000 characters

Save Cancel