github-advanced-security[bot] commented on code in PR #62865:
URL: https://github.com/apache/airflow/pull/62865#discussion_r2920426198
##########
providers/mysql/src/airflow/providers/mysql/hooks/mysql.py:
##########
@@ -339,11 +343,31 @@
.. seealso:: https://dev.mysql.com/doc/refman/8.0/en/load-data.html
"""
+ _VALID_DUPLICATE_KEY_HANDLING = {"IGNORE", "REPLACE", ""}
+ if duplicate_key_handling not in _VALID_DUPLICATE_KEY_HANDLING:
+ raise ValueError(
+ f"Invalid duplicate_key_handling: {duplicate_key_handling!r}. "
+ f"Must be one of {_VALID_DUPLICATE_KEY_HANDLING}."
+ )
+
+ import re
+
+ if extra_options and not re.match(r"^[A-Z @=',;()\w\s.*/-]+$",
extra_options):
Review Comment:
## Overly permissive regular expression range
Suspicious character range that overlaps with \w in the same character class.
[Show more
details](https://github.com/apache/airflow/security/code-scanning/591)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]