Commit 0ff6d94
committed
feat: add timezone validation to prevent SQL injection
Add isValidTimeZone() utility function to validate timezone strings
before using them in SQL queries. The function ensures only safe
characters are allowed in timezone names.
Security improvements:
- Validate timezone strings against safe character regex
- Reject strings with SQL injection patterns
- Support all valid IANA timezone formats
- Length limits and empty string checks
This prevents potential SQL injection in the SET TIME ZONE command
while maintaining compatibility with all legitimate timezone values.1 parent f991ef8 commit 0ff6d94
1 file changed
+12
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
0 commit comments