mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-23 04:18:45 +00:00
fix(validation): enhance isValidSearch function to restrict allowed characters
- Updated the regex in the isValidSearch function to limit valid characters, improving input validation and security against potential injection attacks.
This commit is contained in:
@@ -41,7 +41,9 @@ export const isValidSince = (since: string): boolean => {
|
|||||||
* Max length 500.
|
* Max length 500.
|
||||||
*/
|
*/
|
||||||
export const isValidSearch = (search: string): boolean => {
|
export const isValidSearch = (search: string): boolean => {
|
||||||
return /^[\x20-\x7E]{0,500}$/.test(search);
|
return /^[\x20-\x21\x23-\x25\x27-\x28\x2A-\x3A\x3D\x3F-\x5B\x5D-\x7B\x7D-\x7E]{0,500}$/.test(
|
||||||
|
search,
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user