fix(frontend): add rel=noopener noreferrer to target=_blank links#2505
Conversation
External links opened with target="_blank" but no rel exposed reverse-tabnabbing (window.opener) and referrer leakage. Add rel="noopener noreferrer" to the custom Link/UILink/router-link sites that biome's noBlankTarget rule (native <a> only) can't reach. Vendor redpanda-ui components left untouched (audit SECURITY-03). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@claude review |
|
Claude finished @malinskibeniamin's task in 1m 59s —— View job Review:
|
biome's formatter wraps the Link/UILink tags that exceeded line width after the rel="noopener noreferrer" addition. No semantic change (CI 'bun run lint' output). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Thanks for the review. No code change needed here:
The "0 unprotected |
…dpanda-data#2505) * fix(frontend): add rel=noopener noreferrer to target=_blank links External links opened with target="_blank" but no rel exposed reverse-tabnabbing (window.opener) and referrer leakage. Add rel="noopener noreferrer" to the custom Link/UILink/router-link sites that biome's noBlankTarget rule (native <a> only) can't reach. Vendor redpanda-ui components left untouched (audit SECURITY-03). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * style(frontend): wrap long external-link tags to satisfy formatter biome's formatter wraps the Link/UILink tags that exceeded line width after the rel="noopener noreferrer" addition. No semantic change (CI 'bun run lint' output). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
What & why
Audit finding SECURITY-03. Links opened with
target="_blank"but norelexpose reverse-tabnabbing (the opened page can drive
window.openerto aphishing URL) and referrer leakage. Practical risk is low here (destinations are
the trusted
docs.redpanda.comdomain and modern browsers implynoopener), butit's a latent footgun the moment a
target="_blank"href becomes dynamic.Change
Added
rel="noopener noreferrer"to the 16 external-link sites (customLink/UILink/ router-link components) across 8 files that were missing it.Native
<a target="_blank">are already covered by biome's recommendednoBlankTargetrule — but that rule only inspects native anchors, so the registryLink/UILinkconsumers needed explicitrel. The vendor registry component(
redpanda-ui/.../auto-form/field-wrapper.tsx) was left untouched (it already hadrelanyway).Verification
bun run type:check✅bun run lint:check✅target="_blank"elements remain without arel(excluding vendor/generated).Follow-up (not in this PR)
Biome's
noBlankTargetcan't enforcerelon custom components. A small custom lintrule (or defaulting
relin the upstream registryLink) would prevent regressions —tracked separately.
🤖 Generated with Claude Code