In-depth lesson · SQL injection
Typical fixes
Every point the SQL injection reports back under this heading, best-backed first, each with the reports it is seen in.
-
Use parameterised queries and prepared statements for all database access, including bound parameters for every piece of user input.
Seen in 52 reports
-
Fix parameter escaping in database libraries, including the WordPress DB class prepare method.
Seen in 9 reports
-
Parameterise or sanitise URL path values before they reach SQL queries.
Seen in 3 reports
-
Quote and validate aliases before they reach generated SQL.
Seen in 3 reports
-
Escape user input before building Solr queries.
Seen in 2 reports
-
Patch MOVEit Transfer against CVE-2023-36934.
-
Sanitise GraphQL parameters in the same way as ordinary input fields.
Seen in 1 report
-
Escape input at the SQL layer, not only at the XML layer.
Seen in 1 report
-
Enforce projection restrictions for every URI in a content provider.
Seen in 1 report
-
Require authentication on test API services and disable xp_cmdshell.
Seen in 1 report
-
Avoid loose comparisons before calling unserialize.
Seen in 1 report
-
Validate ordering parameters passed to ORM methods.
Seen in 1 report
-
$2,000 Critical
-
-
Escape POST parameters before using them in SQL queries within plugins.
Seen in 1 report
-
Parameterise ORDER BY clauses in shortcode handlers.
Seen in 1 report
-
$4,500 High
-
-
Require authentication on preview AJAX actions.
Seen in 1 report
-
$4,500 High
-
-
Avoid raw @Query usage in Spring that allows N1QL injection.
Seen in 1 report
-
Patch the MySQL scientific notation bug that left WAF clients vulnerable.
-
Parameterise request parameters and validate input before building SQL queries in ASP applications.
Seen in 1 report
-
Parameterise and escape search terms before inserting them into SQL queries in the CVE search feature.
Seen in 1 report
-
Sanitise and parameterise parameters passed to content provider SQL statements on mobile.
Seen in 1 report
-
Use parameterised queries and proper escaping for admin mimetype settings input.
Seen in 1 report
-
Validate and parameterise POST parameters before building SQL queries in the user group lookup.
Seen in 1 report
-
Do not interpolate raw SQL into EXPLAIN ANALYZE queries; sanitise and constrain what the analyzer accepts.
-
Update bundled database abstraction libraries to versions without known injection issues.
Seen in 1 report
-
Upgrade Django to a version that fixes CVE-2022-34265.
Seen in 1 report
-
Patch ManageEngine privileged access management against CVE-2022-40300.
-
Patch ZKSecurityBio against CVE-2022-36635.
Seen in 1 report
-
Patch Intel DCM against CVE-2022-21225.
Seen in 1 report
-
Do not assume ORMs and prepared statements cover every query path; review dynamic fragments.
Seen in 1 report
-
Sanitise query parameters so document database operators cannot be supplied.
Seen in 1 report