Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions src/modules/networks/resources/ResourcesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import NoResults from "@components/ui/NoResults";
import { IconCirclePlus } from "@tabler/icons-react";
import { ColumnDef, SortingState } from "@tanstack/react-table";
import { removeAllSpaces } from "@utils/helpers";
import { ArrowUpRightIcon, Layers3Icon } from "lucide-react";
import { ArrowUpRightIcon, ExternalLinkIcon, Layers3Icon } from "lucide-react";
import InlineLink from "@components/InlineLink";
import { useRouter, useSearchParams } from "next/navigation";
import * as React from "react";
import { useState } from "react";
Expand Down Expand Up @@ -210,10 +211,24 @@ export default function ResourcesTable({
}
>
{(table) => (
<DataTableRowsPerPage
table={table}
disabled={!resources || resources?.length == 0}
/>
<>
<DataTableRowsPerPage
table={table}
disabled={!resources || resources?.length == 0}
/>
{!isGroupPage && (
<InlineLink
href={
"https://docs.netbird.io/manage/networks#manage-access-to-routing-peer"
}
target={"_blank"}
className={"text-xs whitespace-nowrap"}
>
Trying to access resources on the routing peer?
<ExternalLinkIcon size={12} />
</InlineLink>
Comment on lines +220 to +229
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add rel="noopener noreferrer" for external link security hardening.

The InlineLink component does not automatically inject rel attributes. When using target="_blank" with external URLs, explicitly adding rel="noopener noreferrer" is recommended to prevent the opened page from accessing window.opener and to avoid referrer leakage.

🛡️ Proposed fix
           <InlineLink
             href={
               "https://docs.netbird.io/manage/networks#manage-access-to-routing-peer"
             }
             target={"_blank"}
+            rel={"noopener noreferrer"}
             className={"text-xs whitespace-nowrap"}
           >
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<InlineLink
href={
"https://docs.netbird.io/manage/networks#manage-access-to-routing-peer"
}
target={"_blank"}
className={"text-xs whitespace-nowrap"}
>
Trying to access resources on the routing peer?
<ExternalLinkIcon size={12} />
</InlineLink>
<InlineLink
href={
"https://docs.netbird.io/manage/networks#manage-access-to-routing-peer"
}
target={"_blank"}
rel={"noopener noreferrer"}
className={"text-xs whitespace-nowrap"}
>
Trying to access resources on the routing peer?
<ExternalLinkIcon size={12} />
</InlineLink>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/modules/networks/resources/ResourcesTable.tsx` around lines 220 - 229,
The InlineLink that opens an external URL using target="_blank" should include
rel="noopener noreferrer" to prevent window.opener access and referrer leakage;
update the InlineLink instance in ResourcesTable (the InlineLink wrapping
"Trying to access resources on the routing peer?" and containing
ExternalLinkIcon) to add rel="noopener noreferrer" whenever target="_blank" is
used.

)}
</>
)}
</DataTable>
);
Expand Down
Loading