Skip to content

Commit 82e5de2

Browse files
Copiloteliandoran
andcommitted
Add input validation for prefix to address security concerns
Co-authored-by: eliandoran <[email protected]>
1 parent 5b8bb85 commit 82e5de2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

apps/server/src/routes/api/branches.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,11 @@ function setPrefixBatch(req: Request) {
277277
throw new ValidationError("branchIds must be an array");
278278
}
279279

280+
// Validate that prefix is a string or null/undefined to prevent prototype pollution
281+
if (prefix !== null && prefix !== undefined && typeof prefix !== 'string') {
282+
throw new ValidationError("prefix must be a string or null");
283+
}
284+
280285
const normalizedPrefix = utils.isEmptyOrWhitespace(prefix) ? null : prefix;
281286
let updatedCount = 0;
282287

0 commit comments

Comments
 (0)