From 636053fb6da8a61681ab2290ef25e32d9e3f4916 Mon Sep 17 00:00:00 2001
From: yangzheli <43645580+yangzheli@users.noreply.github.com>
Date: Thu, 2 Apr 2026 17:32:52 +0800
Subject: [PATCH] fix(frontend): add missing rel="noopener noreferrer" to
target="_blank" links (#1741)
* fix(frontend): add missing rel="noopener noreferrer" to target="_blank" links
Prevent tabnabbing attacks and referrer leakage by ensuring all
external links with target="_blank" include both noopener and
noreferrer in the rel attribute.
Made-with: Cursor
* style: fix code formatting
---
frontend/src/components/ai-elements/open-in-chat.tsx | 12 ++++++------
frontend/src/components/ai-elements/sources.tsx | 2 +-
frontend/src/components/landing/header.tsx | 12 ++++++++++--
.../landing/sections/case-study-section.tsx | 1 +
.../landing/sections/community-section.tsx | 6 +++++-
.../workspace/artifacts/artifact-file-detail.tsx | 7 ++++++-
.../workspace/artifacts/artifact-file-list.tsx | 1 +
.../components/workspace/messages/message-group.tsx | 6 +++---
8 files changed, 33 insertions(+), 14 deletions(-)
diff --git a/frontend/src/components/ai-elements/open-in-chat.tsx b/frontend/src/components/ai-elements/open-in-chat.tsx
index 0c62a6ac4..b86e93db5 100644
--- a/frontend/src/components/ai-elements/open-in-chat.tsx
+++ b/frontend/src/components/ai-elements/open-in-chat.tsx
@@ -253,7 +253,7 @@ export const OpenInChatGPT = (props: OpenInChatGPTProps) => {
{providers.chatgpt.icon}
@@ -273,7 +273,7 @@ export const OpenInClaude = (props: OpenInClaudeProps) => {
{providers.claude.icon}
@@ -293,7 +293,7 @@ export const OpenInT3 = (props: OpenInT3Props) => {
{providers.t3.icon}
@@ -313,7 +313,7 @@ export const OpenInScira = (props: OpenInSciraProps) => {
{providers.scira.icon}
@@ -333,7 +333,7 @@ export const OpenInv0 = (props: OpenInv0Props) => {
{providers.v0.icon}
@@ -353,7 +353,7 @@ export const OpenInCursor = (props: OpenInCursorProps) => {
{providers.cursor.icon}
diff --git a/frontend/src/components/ai-elements/sources.tsx b/frontend/src/components/ai-elements/sources.tsx
index f3570f9b2..dd0aa623c 100644
--- a/frontend/src/components/ai-elements/sources.tsx
+++ b/frontend/src/components/ai-elements/sources.tsx
@@ -63,7 +63,7 @@ export const Source = ({ href, title, children, ...props }: SourceProps) => (
diff --git a/frontend/src/components/landing/header.tsx b/frontend/src/components/landing/header.tsx
index 7e4afa435..39e40d106 100644
--- a/frontend/src/components/landing/header.tsx
+++ b/frontend/src/components/landing/header.tsx
@@ -8,7 +8,11 @@ export function Header() {
return (