Skip to content

Commit f63d1c6

Browse files
waleedlatif1claude
andcommitted
fix(security): remove input length cap from regex validation
The 10k character cap would block legitimate guardrail checks on long LLM outputs. Input length doesn't affect ReDoS risk — the safe-regex2 pattern check already prevents catastrophic backtracking. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8d03be3 commit f63d1c6

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

apps/sim/lib/guardrails/validate_regex.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import safe from 'safe-regex2'
22

3-
const MAX_INPUT_LENGTH = 10_000
4-
53
/**
64
* Validate if input matches regex pattern
75
*/
@@ -25,13 +23,6 @@ export function validateRegex(inputStr: string, pattern: string): ValidationResu
2523
}
2624
}
2725

28-
if (inputStr.length > MAX_INPUT_LENGTH) {
29-
return {
30-
passed: false,
31-
error: `Input exceeds maximum length of ${MAX_INPUT_LENGTH} characters`,
32-
}
33-
}
34-
3526
const match = regex.test(inputStr)
3627
if (match) {
3728
return { passed: true }

0 commit comments

Comments
 (0)