fix(sanitize_fields): strengthen field check
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
parent
20ceaa20a0
commit
ab577751f2
1 changed files with 4 additions and 2 deletions
|
|
@ -499,9 +499,11 @@ from {tables}
|
|||
if isinstance(token, Function):
|
||||
if (name := (token.get_name())) and name.lower() in blacklisted_functions:
|
||||
_raise_exception()
|
||||
if token.ttype == tokens.Keyword:
|
||||
if token.value.lower() in blacklisted_keywords:
|
||||
|
||||
if token.ttype in (tokens.Keyword, tokens.Name):
|
||||
if any(re.search(rf"\b{kw}\b", token.value.lower()) for kw in blacklisted_keywords):
|
||||
_raise_exception()
|
||||
|
||||
if token.is_group:
|
||||
_check_sql_token(token)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue