Your question is Detecting SQL Injection. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Arch Capital is reviewing user-supplied text before it reaches a security filter. Write a function that detects whether an input string contains likely SQL injection patterns.
Given a string text, return True if it contains a suspicious SQL injection pattern, otherwise return False.
A string is considered suspicious if, after lowercasing it, it contains any of the following:
--, /*, or */;or 1=1 or or '1'='1'union select, drop table, or insert intoTreat repeated spaces, tabs, and newlines as whitespace. Matching should be case-insensitive.
def detect_sql_injection(text):