mirror of
https://github.com/zadam/trilium.git
synced 2025-11-17 10:40:41 +01:00
Add input validation for prefix to address security concerns
Co-authored-by: eliandoran <21236836+eliandoran@users.noreply.github.com>
This commit is contained in:
@@ -277,6 +277,11 @@ function setPrefixBatch(req: Request) {
|
||||
throw new ValidationError("branchIds must be an array");
|
||||
}
|
||||
|
||||
// Validate that prefix is a string or null/undefined to prevent prototype pollution
|
||||
if (prefix !== null && prefix !== undefined && typeof prefix !== 'string') {
|
||||
throw new ValidationError("prefix must be a string or null");
|
||||
}
|
||||
|
||||
const normalizedPrefix = utils.isEmptyOrWhitespace(prefix) ? null : prefix;
|
||||
let updatedCount = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user