mirror of
https://github.com/zadam/trilium.git
synced 2025-11-08 15:39:02 +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:
parent
5b8bb8587d
commit
82e5de2261
@ -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;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user