Skip to content

Security: Untrusted link opening can enable reverse-tabnabbing and script-scheme execution#2738

Open
tomaioo wants to merge 1 commit into
emberjs:mainfrom
tomaioo:fix/security/untrusted-link-opening-can-enable-revers
Open

Security: Untrusted link opening can enable reverse-tabnabbing and script-scheme execution#2738
tomaioo wants to merge 1 commit into
emberjs:mainfrom
tomaioo:fix/security/untrusted-link-opening-can-enable-revers

Conversation

@tomaioo
Copy link
Copy Markdown

@tomaioo tomaioo commented Apr 11, 2026

Summary

Security: Untrusted link opening can enable reverse-tabnabbing and script-scheme execution

Problem

Severity: Medium | File: app/components/ui/open-links-in-new-window.js:L5

The click handler opens any anchor href via window.open(e.target.href) without noopener/noreferrer protections and without validating URL schemes. If a malicious link is rendered (e.g., javascript: or attacker-controlled external URL), this can lead to opener manipulation (reverse tabnabbing) or unsafe navigation behavior.

Solution

Validate the URL before opening (allow only http:/https: as needed), and open with noopener,noreferrer (e.g., window.open(url, '_blank', 'noopener,noreferrer')). Also consider resolving the nearest <a> via closest('a') and rejecting missing/invalid hrefs.

Changes

  • app/components/ui/open-links-in-new-window.js (modified)

The click handler opens any anchor `href` via `window.open(e.target.href)` without `noopener/noreferrer` protections and without validating URL schemes. If a malicious link is rendered (e.g., `javascript:` or attacker-controlled external URL), this can lead to opener manipulation (reverse tabnabbing) or unsafe navigation behavior.

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant