---
title: "CWE-1021: Improper Restriction of Rendered UI Layers or Frames"
url: https://radicalnotion.ai/cwe/cwe-1021
type: cwe
description: "The web application does not restrict or incorrectly restricts frame objects or UI layers that belong to another application or domain."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-1021: Improper Restriction of Rendered UI Layers or Frames

- **Abstraction:** Base
- **Structure:** Simple
- **Status:** Incomplete
- **CVEs with this as primary weakness:** 436
- **Of those, in CISA KEV:** 0
- **New in 2026:** 74
- **CWE catalog version:** 4.21

## Description

The web application does not restrict or incorrectly restricts frame objects or UI layers that belong to another application or domain.

## Alternate terms

- Clickjacking
- UI Redress Attack
- **Tapjacking:** "Tapjacking" is similar to clickjacking, except it is used for mobile applications in which the user "taps" the application instead of performing a mouse click.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | - |

## Applicable platforms

**Technologies:** Web Based (Undetermined)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Access Control | Gain Privileges or Assume Identity, Bypass Protection Mechanism, Read Application Data, Modify Application Data | An attacker can trick a user into performing actions that are masked and hidden from the user's view. The impact varies widely, depending on the functionality of the underlying application. For example, in a social media application, clickjacking could be used to trick the user into changing privacy settings. |

## Potential mitigations

### Implementation

Use the "frame-ancestors" directive in the Content Security Policy, which is intended to define restrictions when it comes to allowing embedded content \[REF-1544\].

Effectiveness: High. While this option had not been standardized in early years after the discovery of clickjacking, it was standardized by W3C in late 2016 \[REF-1546\] and reached widespread browser use afterward.

### Implementation

The use of X-Frame-Options (now partially obsolete as of September 2026 \[REF-1545\]) allows developers of web content to restrict the usage of their application within the form of overlays, frames, or iFrames. The developer can indicate from which domains can frame the content.

The concept of X-Frame-Options is well documented, but implementation of this protection mechanism is in development to cover gaps; often, there is a need for allowing frames from multiple domains.

### Implementation

Use a "frame-breaker" script in each page that should not be framed. This is very helpful for legacy browsers that do not support the X-Frame-Options security feature previously mentioned (which is now partially obsolete).

### Implementation

In addition to frames or iframes as previously mentioned, the web application is expected to place restrictions on whether it is allowed to be rendered within objects, embed, or applet elements.

## Detection methods

### Automated Static Analysis

Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

Effectiveness: High

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2017-7440 | E-mail preview feature in a desktop application allows clickjacking attacks via a crafted e-mail message |
| CVE-2017-5697 | Hardware/firmware product has insufficient clickjacking protection in its web user interface |
| CVE-2017-4015 | Clickjacking in data-loss prevention product via HTTP response header. |
| CVE-2016-2496 | Tapjacking in permission dialog for mobile OS allows access of private storage using a partially-overlapping window. |
| CVE-2015-1241 | Tapjacking in web browser related to page navigation and touch/gesture events. |
| CVE-2017-0492 | System UI in mobile OS allows a malicious application to create a UI overlay of the entire screen to gain privileges. |

## Real CVEs with this weakness (sample of 12 of 436)

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2026-84139 | Clickjacking issue in the DOM: Events component | critical | 9.8 | - | No | 2026-09-01 |
| CVE-2021-43048 | TIBCO PartnerExpress Click-Jacking vulnerability | critical | 9.8 | - | No | 2021-11-16 |
| CVE-2021-23274 | TIBCO API Exchange Gateway Clickjack Vulnerability | critical | 9.8 | - | No | 2021-03-23 |
| CVE-2016-2496 | Elevation of Privilege Vulnerability in Framework UI | critical | 9.8 | - | No | 2016-06-13 |
| CVE-2023-41897 | Lack of XFO header allows clickjacking in Home Assistant Core | critical | 9.6 | - | No | 2023-10-19 |
| CVE-2021-21132 | Inappropriate implementation in DevTools | critical | 9.6 | - | No | 2021-02-09 |
| CVE-2021-21111 | Insufficient policy enforcement in WebUI | critical | 9.6 | - | No | 2021-01-08 |
| CVE-2022-3167 | Improper Restriction of Rendered UI Layers or Frames in ikus060/rdiffweb | critical | 9.3 | - | No | 2022-09-08 |
| CVE-2026-84388 | - | critical | 9.1 | - | No | 2026-09-22 |
| CVE-2024-10004 | - | critical | 9.1 | - | No | 2024-10-15 |
| CVE-2026-113063 | Clickjacking in Chromoting | high | 8.8 | - | No | 2026-10-20 |
| CVE-2023-6208 | Mozilla: Using Selection API would copy contents into X11 primary selection. | high | 8.8 | - | No | 2023-11-21 |

## Related attack patterns (CAPEC)

- [CAPEC-103](https://radicalnotion.ai/capec/capec-103): Clickjacking
- [CAPEC-181](https://radicalnotion.ai/capec/capec-181): Flash File Overlay
- [CAPEC-222](https://radicalnotion.ai/capec/capec-222): iFrame Overlay
- [CAPEC-504](https://radicalnotion.ai/capec/capec-504): Task Impersonation
- [CAPEC-506](https://radicalnotion.ai/capec/capec-506): Tapjacking
- [CAPEC-587](https://radicalnotion.ai/capec/capec-587): Cross Frame Scripting (XFS)
- [CAPEC-654](https://radicalnotion.ai/capec/capec-654): Credential Prompt Impersonation

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-441](https://radicalnotion.ai/cwe/cwe-441) | Unintended Proxy or Intermediary |
| Parent | [CWE-451](https://radicalnotion.ai/cwe/cwe-451) | User Interface (UI) Misrepresentation of Critical Information |
| Parent | [CWE-610](https://radicalnotion.ai/cwe/cwe-610) | Externally Controlled Reference to a Resource in Another Sphere |

## Frequently asked questions

### What is CWE-1021?

The web application does not restrict or incorrectly restricts frame objects or UI layers that belong to another application or domain.

### What CVEs are caused by CWE-1021?

436 recorded CVEs are attributed to CWE-1021, including CVE-2026-84139, CVE-2021-43048 and CVE-2021-23274.

### How do you prevent CWE-1021?

Use the "frame-ancestors" directive in the Content Security Policy, which is intended to define restrictions when it comes to allowing embedded content.

### How is CWE-1021 detected?

Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

### What are the consequences of CWE-1021?

Exploiting CWE-1021 can lead to: Gain Privileges or Assume Identity, Bypass Protection Mechanism, Read Application Data, Modify Application Data.

### Is CWE-1021 actively exploited?

436 recorded CVEs are caused by CWE-1021; none are currently in CISA's KEV catalog of actively exploited flaws.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/1021.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-1021). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
