All Downloads are FREE. Search and download functionalities are using the official Maven repository.

generic-remediation-reports.sql-injection.description.md Maven / Gradle / Ivy

There is a newer version: 0.97.9
Show newest version
This change refactors SQL statements to be parameterized, rather than built by hand.

Without parameterization, developers must remember to escape inputs using the rules for that database. It's usually buggy, at the least -- and sometimes vulnerable.

Our changes look something like this:

```diff
- Statement stmt = connection.createStatement();
- ResultSet rs = stmt.executeQuery("SELECT * FROM users WHERE name = '" + user + "'");
+ PreparedStatement stmt = connection.prepareStatement("SELECT * FROM users WHERE name = ?");
+ stmt.setString(1, user);
+ ResultSet rs = stmt.executeQuery();
```




© 2015 - 2024 Weber Informatics LLC | Privacy Policy