08 Week8 10 Web Security B
08 Week8 10 Web Security B
Injection Attack
Dr. Cong Wang
CS Department
City University of Hong Kong
Slides partially adapted from lecture notes by M. Goodrich&R. Tamassia,
W. Stallings&L. Brown, Dan Boneh, and Dawn Song.
CS4293 Topics Cybersecurity 1
Web Security:
Vulnerabilities and Attacks
preg_match(regex, string):
Designing a general enough whitelisting with good validation purposes can be challenging.
• More info. on
– http://www.w3schools.com/sql/
– http://en.wikipedia.org/wiki/SQL
URI:http://www.example.net/login.php?user=admin'--&pwd=f
preg_match(regex, string):
Designing a general enough whitelisting with good validation purposes can be challenging.
CS4293 Topics Cybersecurity 27
Input Validation for SQL
• Given the input validation against username in our web
application, which of the following URI would still allow you to
login as admin?
1=1 is true everywhere. This returns all the rows in the table, and thus number of
results is greater than zero.
CS4293 Topics Cybersecurity 30
Input Escaping