Skip to content

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.

Back to the lesson 1 to 30 of 30
  1. Use parameterised queries and prepared statements for all database access, including bound parameters for every piece of user input.

    Seen in 52 reports
  2. Fix parameter escaping in database libraries, including the WordPress DB class prepare method.

    Seen in 9 reports
  3. Parameterise or sanitise URL path values before they reach SQL queries.

    Seen in 3 reports
  4. Quote and validate aliases before they reach generated SQL.

    Seen in 3 reports
  5. Escape user input before building Solr queries.

    Seen in 2 reports
  6. Patch MOVEit Transfer against CVE-2023-36934.

    Seen in 2 reports
  7. Sanitise GraphQL parameters in the same way as ordinary input fields.

    Seen in 1 report
  8. Escape input at the SQL layer, not only at the XML layer.

    Seen in 1 report
  9. Enforce projection restrictions for every URI in a content provider.

    Seen in 1 report
  10. Require authentication on test API services and disable xp_cmdshell.

    Seen in 1 report
  11. Avoid loose comparisons before calling unserialize.

    Seen in 1 report
  12. Validate ordering parameters passed to ORM methods.

    Seen in 1 report
  13. Escape POST parameters before using them in SQL queries within plugins.

    Seen in 1 report
  14. Parameterise ORDER BY clauses in shortcode handlers.

    Seen in 1 report
  15. Require authentication on preview AJAX actions.

    Seen in 1 report
  16. Avoid raw @Query usage in Spring that allows N1QL injection.

    Seen in 1 report
  17. Patch the MySQL scientific notation bug that left WAF clients vulnerable.

    Seen in 1 report
  18. Parameterise request parameters and validate input before building SQL queries in ASP applications.

    Seen in 1 report
  19. Parameterise and escape search terms before inserting them into SQL queries in the CVE search feature.

    Seen in 1 report
  20. Sanitise and parameterise parameters passed to content provider SQL statements on mobile.

    Seen in 1 report
  21. Use parameterised queries and proper escaping for admin mimetype settings input.

    Seen in 1 report
  22. Validate and parameterise POST parameters before building SQL queries in the user group lookup.

    Seen in 1 report
  23. Do not interpolate raw SQL into EXPLAIN ANALYZE queries; sanitise and constrain what the analyzer accepts.

    Seen in 1 report
  24. Update bundled database abstraction libraries to versions without known injection issues.

    Seen in 1 report
  25. Upgrade Django to a version that fixes CVE-2022-34265.

    Seen in 1 report
  26. Patch ManageEngine privileged access management against CVE-2022-40300.

    Seen in 1 report
  27. Patch ZKSecurityBio against CVE-2022-36635.

    Seen in 1 report
  28. Patch Intel DCM against CVE-2022-21225.

    Seen in 1 report
  29. Do not assume ORMs and prepared statements cover every query path; review dynamic fragments.

    Seen in 1 report
  30. Sanitise query parameters so document database operators cannot be supplied.

    Seen in 1 report