mirror of
https://github.com/whyour/qinglong.git
synced 2026-08-13 12:23:29 +08:00
Address code review feedback: improve validation patterns and escaping
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
This commit is contained in:
co-authored by
whyour
parent
0a2d7b1597
commit
d20e154f21
@@ -28,14 +28,14 @@ const validateShellSecurity = (value: any, helpers: any, fieldName: string): any
|
||||
// Background process spawning with suspicious names
|
||||
/nohup\s+["']?[^\s"']*\/\.\w+/,
|
||||
|
||||
// Redirect to dev null (hiding output) combined with background execution
|
||||
/>.*\/dev\/null.*&/,
|
||||
// Redirect to dev null combined with downloads (hiding malware output)
|
||||
/(curl|wget|fetch)[^;]*>.*\/dev\/null.*&/i,
|
||||
|
||||
// Base64 decode patterns (often used to obfuscate malicious code)
|
||||
/\b(base64|decode|eval)\s+/i,
|
||||
|
||||
// File execution from temp directory
|
||||
/\b\/tmp\/[^\s]+/,
|
||||
// Executable files in /tmp with chmod or execution
|
||||
/\/tmp\/[^\s]+\s*(&&|;)\s*(chmod|\.\/)/ ,
|
||||
];
|
||||
|
||||
for (const pattern of dangerousPatterns) {
|
||||
|
||||
Reference in New Issue
Block a user