#DeveloperFail
Funny, the page asks for your name, and if you have ' like Irish names, it marks the name in Red (invalid) and doesn't let you move forward with finding out the books.
I tested it with the following names.
James O'Keefe
Mullah O'Mar
Funny, the page asks for your name, and if you have ' like Irish names, it marks the name in Red (invalid) and doesn't let you move forward with finding out the books.
I tested it with the following names.
James O'Keefe
Mullah O'Mar
This is a great opportunity to mentor one's juniors. An injection attack is trivial to demonstrate in the local dev environment, and the result strongly motivates anyone worth working with to learn how not to do that again.
stmt = driver.prepare("insert into names
(firstname, lastname) values (?, ?)");
stmt.execute("Flannery", "O'Connor");
Syntax varies among database interfaces but this ensures that any odd strings are properly stored by the driver and the application does not need to worry about them. There is also no risk of someone rewriting the SQL statement. name: [person's name]
No minimum lengths (other than != 0) and a reasonably large maximum length for your db (only to protect against DoS attacks). Accept all input (into properly prepared SQL statements).