🛡️ Sentinel: [HIGH] Escape backticks in sanitizeInput #57
@@ -13,6 +13,10 @@ describe('Security Utils', () => {
|
|||||||
expect(sanitizeInput('>')).toBe('>');
|
expect(sanitizeInput('>')).toBe('>');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('escapes backticks', () => {
|
||||||
|
expect(sanitizeInput('`exec`')).toBe('`exec`');
|
||||||
|
});
|
||||||
|
|
||||||
it('returns non-string input as is', () => {
|
it('returns non-string input as is', () => {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
expect(sanitizeInput(123)).toBe(123);
|
expect(sanitizeInput(123)).toBe(123);
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ export function sanitizeInput(input: string): string {
|
|||||||
.replace(/</g, "<")
|
.replace(/</g, "<")
|
||||||
.replace(/>/g, ">")
|
.replace(/>/g, ">")
|
||||||
.replace(/"/g, """)
|
.replace(/"/g, """)
|
||||||
.replace(/'/g, "'");
|
.replace(/'/g, "'")
|
||||||
|
.replace(/`/g, "`");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Common disposable email providers and invalid domains
|
// Common disposable email providers and invalid domains
|
||||||
|
|||||||
Reference in New Issue
Block a user