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.

SeverityLow
CVSS 3.13.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.02.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
CWECWE-1021: Improper Restriction of Rendered UI Layers or Frames
OWASP Top 10A06:2025 Insecure Design
CategorySecurity 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: DENY or SAMEORIGIN for older browsers. The ALLOW-FROM value is obsolete and ignored by current browsers.
  • Set SameSite=Lax or Strict on session cookies.
  • Require a confirmation that cannot be completed with a single click, such as re-entering a password, for the most sensitive actions.
# nginx add_header Content-Security-Policy "frame-ancestors 'self'" always; add_header X-Frame-Options "SAMEORIGIN" always; # Apache (mod_headers) Header always set Content-Security-Policy "frame-ancestors 'self'" Header always set X-Frame-Options "SAMEORIGIN" <!-- IIS web.config, inside system.webServer --> <httpProtocol> <customHeaders> <add name="Content-Security-Policy" value="frame-ancestors 'self'" /> <add name="X-Frame-Options" value="SAMEORIGIN" /> </customHeaders> </httpProtocol>

Confirm the fix by checking the headers on all HTML responses and attempting to load the pages in a frame on another origin.

References


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 trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More Web Applications Findings

Every Web Applications finding