SQL injection is too advanced for the kind of exploit that could happen there.
Imagine a table like this:
TABLE users,
user_id int,
full_name varchar,
password varchar,
display_name varchar,
email varchar,
status enum ('Administrator', 'Moderator', 'User', 'Banned')
Let's assume you have a well defined validation class for each column in the DB. And that you have a "settings" page where a user can change his or her password, etc.
Code:
<form action="script.php" method="post">
<input type="text" name="display_name">
<input type="text" name="email_name">
<input type="submit" value="save">
</form>
The exploit is injecting this:
Code:
<input type="text" value="Administrator" name="status">
Into the form with Firebug or by creating my own HTML file with a custom form.
In most web applications this wouldn't work because the business logic powering the form knows exactly what parameters to expect from a form or only updates specific columns, the downside is any new fields added to the form requires this business logic to be updated. But an ActiveRecord solution that AUTOMATICALLY picks up any new fields would take anything the user added and automatically update the database.
Not exactly brilliant.
Bookmarks