-
-
Save amcgregor/39f6477fa66a392c7bfe3efb6df3bc99 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Helper: | |
encoding = 'utf-8' | |
def __init__(self, udid, it_pro): | |
self.udid = udid | |
self.itpro = it_pro | |
def employee_id(self): | |
sql = "select emplid from emplid_to_alphaname where alphaname = (%s);", (self.udid, ) | |
print(sql) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Helper: | |
encoding = 'utf-8' | |
def __init__(self, udid, it_pro): | |
self.udid = udid | |
self.itpro = it_pro | |
def employee_id(self): | |
sql = "select emplid from emplid_to_alphaname where alphaname = (%s);" % (self.udid, ) | |
print(sql) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [12]: Helper("False); DROP TABLE users; -- You've been pwned. --", 42).employee_id() | |
select emplid from emplid_to_alphaname where alphaname = (False); DROP TABLE users; -- You've been pwned. --); | |
And all of your user data is now deleted. This is a demonstration of how NOT to perform variable expansion in SQL. | |
USE PREPARED STATEMENTS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment