---
title: "CWE-1022: Use of Web Link to Untrusted Target with window.opener Access"
url: https://radicalnotion.ai/cwe/cwe-1022
type: cwe
description: "The web application produces links to untrusted external sites outside of its sphere of control, but it does not properly prevent the external site from modifying security-critical properties of the window.opener object, such as the location property."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-1022: Use of Web Link to Untrusted Target with window.opener Access

- **Abstraction:** Variant
- **Structure:** Simple
- **Status:** Incomplete
- **Likelihood of exploit:** Medium
- **CVEs with this as primary weakness:** 14
- **Of those, in CISA KEV:** 0
- **New in 2026:** 2
- **CWE catalog version:** 4.21

## Description

The web application produces links to untrusted external sites outside of its sphere of control, but it does not properly prevent the external site from modifying security-critical properties of the window.opener object, such as the location property.

## Background

When a user clicks a link to an external site ("target"), the target="\_blank" attribute causes the target site's contents to be opened in a new window or tab, which runs in the same process as the original page. The window.opener object records information about the original page that offered the link.

## Alternate terms

- tabnabbing

## Modes of introduction

| Phase | Note |
| --- | --- |
| Architecture and Design | This weakness is introduced during the design of an application when the architect does not specify that a linked external document should not be able to alter the location of the calling page. |
| Implementation | This weakness is introduced during the coding of an application when the developer does not include the noopener and/or noreferrer value for the rel attribute. |

## Applicable platforms

**Languages:** JavaScript (Often)

**Technologies:** Web Based (Often), Web Server (Undetermined)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Confidentiality | Alter Execution Logic | If an attacker can run script on the target page, then they could read or modify certain properties of the window.opener object, including the location property - even if the original and target site are not the same origin. An attacker can modify the location property to automatically redirect the user to an untrusted page that contains undesired content or malicious script code, e.g. as part of a phishing attack. Since this redirect happens in the original window/tab - which is not necessarily visible, since the browser is focusing the display on the new target page - the user might not notice any suspicious redirection. |

## Potential mitigations

### Architecture and Design

Specify in the design that any linked external document must not be granted access to the location object of the calling page.

### Implementation

When creating a link to an external document using the \<a\> tag with a defined target, for example "\_blank" or a named frame, provide the rel attribute with a value "noopener noreferrer".

If opening the external document in a new window via javascript, then reset the opener by setting it equal to null.

### Implementation

Do not use "\_blank" targets. However, this can affect the usability of the application.

## 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

## Demonstrative examples

### Example 1

In this example, the application opens a link in a named window/tab without taking precautions to prevent the called page from tampering with the calling page's location in the browser.

Bad code:

```html
<a href="http://attacker-site.example.com/useful-page.html" target="_blank">
```

Attack code:

```javascript
window.opener.location = 'http://phishing.example.org/popular-bank-page';
```

Good code:

```html
<a href="http://attacker-site.example.com/useful-page.html" target="_blank" rel="noopener noreferrer">
```

Bad code:

```javascript
var newWindow = window.open("http://attacker-site.example.com/useful-page.html", "_blank");
```

Good code:

```javascript
var newWindow = window.open("http://attacker-site.example.com/useful-page.html", "_blank");
newWindow.opener = null;
```

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2022-4927 | Library software does not use rel: "noopener noreferrer" setting, allowing tabnabbing attacks to redirect to a malicious page |

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

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2024-39727 | IBM Engineering Lifecycle Optimization - Engineering Insights tabnabbing | critical | 9.8 | - | No | 2024-12-25 |
| CVE-2022-1583 | External Links in New Window / New Tab \< 1.43 - Tabnabbing | medium | 6.5 | - | No | 2022-05-30 |
| CVE-2020-36624 | ahorner text-helpers translation.rb reverse tabnabbing | medium | 6.3 | - | No | 2022-12-22 |
| CVE-2025-27902 | IBM Db2 Recovery Expert for Linux, Unix and Windows Information Disclosure | medium | 6.1 | - | No | 2026-10-12 |
| CVE-2025-33014 | IBM Sterling B2B Integrator and IBM Sterling File Gateway link injection | medium | 6.1 | - | No | 2025-07-18 |
| CVE-2022-4927 | ualbertalib NEOSDiscovery \_refworks.html.erb reverse tabnabbing | medium | 6.1 | - | No | 2023-03-05 |
| CVE-2018-25058 | Twitter-Post-Fetcher Link Target twitterFetcher.js reverse tabnabbing | medium | 6.1 | - | No | 2022-12-29 |
| CVE-2021-33697 | - | medium | 6.1 | - | No | 2021-09-15 |
| CVE-2022-2600 | Auto-hyperlink URLs \<= 5.4.1 - Tab Nabbing | medium | 5.4 | - | No | 2022-08-22 |
| CVE-2018-25089 | glb Meetup Tag Extension Link Attribute reverse tabnabbing | medium | 5.3 | - | No | 2023-08-28 |
| CVE-2021-39112 | - | medium | 4.8 | - | No | 2021-08-25 |
| CVE-2026-71555 | PILOS: Reverse tabnabbing in room description | medium | 4.1 | - | No | 2026-08-06 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-266](https://radicalnotion.ai/cwe/cwe-266) | Incorrect Privilege Assignment |

## Frequently asked questions

### What is CWE-1022?

The web application produces links to untrusted external sites outside of its sphere of control, but it does not properly prevent the external site from modifying security-critical properties of the window.opener object, such as the location property.

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

14 recorded CVEs are attributed to CWE-1022, including CVE-2024-39727, CVE-2022-1583 and CVE-2020-36624.

### How do you prevent CWE-1022?

Specify in the design that any linked external document must not be granted access to the location object of the calling page.

### How is CWE-1022 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-1022?

Exploiting CWE-1022 can lead to: Alter Execution Logic.

### Is CWE-1022 actively exploited?

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

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

---

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