Potential fix for code scanning alert no. 55: Server-side request forgery

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
Sergio Garcia
2025-08-01 19:29:47 +08:00
committed by GitHub
parent 19a735aafe
commit 9d33ff104a
+7
View File
@@ -278,6 +278,13 @@ export const getComplianceCsv = async (
scanId: string,
complianceId: string,
) => {
// Only allow alphanumeric, dash, and underscore for IDs
const idPattern = /^[a-zA-Z0-9_-]+$/;
if (!idPattern.test(scanId) || !idPattern.test(complianceId)) {
return {
error: "Invalid scan or compliance ID format.",
};
}
const headers = await getAuthHeaders({ contentType: false });
const url = new URL(