Clickjacking (Missing Frame Protection)
The application's pages can be loaded in a frame on another site, so an attacker can disguise them and trick users into clicking on them.
| Severity | Low |
| CVSS 3.1 | 3.1 CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:N Open in the calculator |
| CVSS 4.0 | 2.1 CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N Open in the calculator |
| CWE | CWE-1021: Improper Restriction of Rendered UI Layers or Frames |
| OWASP Top 10 | A06:2025 Insecure Design |
| Category | Security Misconfiguration |
Description
The application does not tell browsers to refuse to display its pages inside a frame on another site, which is done with the Content Security Policy frame-ancestors directive or the older X-Frame-Options header. An attacker can therefore load a page from the application in an invisible or disguised frame on a site they control, positioned so that a victim who clicks an apparently harmless element is actually clicking a button in the application. The technique is known as clickjacking or UI redressing.
In this way an attacker can trick users into performing actions in the application with their own privileges, such as changing settings, granting permissions, deleting data or confirming a transaction. Each attack needs the victim to visit the attacker's page and click as directed, so exploitation needs an action that can be completed with a few clicks: actions that need several steps or typed input are hard to achieve, and the risk rises where a sensitive action is completed in a single click.
For actions that need a login, the browser must also send the session cookie to the framed page. Cookies marked SameSite=Lax or Strict are withheld from cross-site frames, and current browsers restrict cookies without the attribute in that situation, so on most applications exploitation now needs a session cookie set with SameSite=None, a page on a sibling subdomain, or an action that works without logging in.
The weakness typically shows itself on a test when HTML responses lack both headers and a page loads in a frame on a test page. Burp Suite reports it as a frameable response and OWASP ZAP as a missing anti-clickjacking header.
Remediation
Tell browsers which sites may frame the application:
- Send the Content Security Policy directive
frame-ancestors 'none'on all HTML responses, or'self'or a list of specific trusted origins where the application must be framed. Add it to the existing policy where one is already set. - Also send
X-Frame-Options: DENYorSAMEORIGINfor older browsers. TheALLOW-FROMvalue is obsolete and ignored by current browsers. - Set
SameSite=LaxorStricton session cookies. - Require a confirmation that cannot be completed with a single click, such as re-entering a password, for the most sensitive actions.
Confirm the fix by checking the headers on all HTML responses and attempting to load the pages in a frame on another origin.
References
- cheatsheetseries.owasp.org/cheatsheets/Clickjacking_Defense_Cheat_Sheet.html
- developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/frame-ancestors
- developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Frame-Options
- developer.mozilla.org/en-US/docs/Web/Security/Attacks/Clickjacking
Add This Finding to Your Library
In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.
Free trialYour trial starts when your portal goes live, not when you sign up, so the time you spend setting up does not count. · No card required
Only need the reporting? Our reporting tool is free and open source, with the same library.