Skip to content

Commit b696ae9

Browse files
Potential fix for code scanning alert no. 646: Server-side request forgery (#7758)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 61e91bd commit b696ae9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

apps/space/app/issues/[anchor]/layout.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ export async function generateMetadata({ params }: Props) {
1313
const { anchor } = params;
1414
const DEFAULT_TITLE = "Plane";
1515
const DEFAULT_DESCRIPTION = "Made with Plane, an AI-powered work management platform with publishing capabilities.";
16+
// Validate anchor before using in request (only allow alphanumeric, -, _)
17+
const ANCHOR_REGEX = /^[a-zA-Z0-9_-]+$/;
18+
if (!ANCHOR_REGEX.test(anchor)) {
19+
return { title: DEFAULT_TITLE, description: DEFAULT_DESCRIPTION };
20+
}
1621
try {
1722
const response = await fetch(`${process.env.NEXT_PUBLIC_API_BASE_URL}/api/public/anchor/${anchor}/meta/`);
1823
const data = await response.json();

0 commit comments

Comments
 (0)