news.volyx.in

Google results for PHP tutorials contain SQL injection vulnerabilities (waritschlager.de)

556 points by phil294 · 1887 days ago · 324 comments on HN

Article summary

A search for PHP MySQL tutorials on Google yielded many results with SQL injection vulnerabilities. The author found that 16 out of 30 results contained flawed database statements. This highlights the poor quality of many online tutorials and the potential risks of using them. The issue is not with Google itself, but with the tutorials and code snippets that it indexes.

Main themes

  • SQL injection vulnerabilities
  • PHP security issues
  • database interactions
  • online tutorials
  • programming best practices
  • frameworks and libraries

What commenters say

  • Using PHP's standard libraries to interact with databases is awkward and verbose, leading to security issues.
  • The problem of SQL injection is not specific to PHP, but rather a general issue with database interactions.
  • Higher-level libraries and frameworks can abstract away the problems of SQL injection and provide safer alternatives.
  • The official PHP documentation has historically included insecure examples, contributing to the prevalence of SQL injection vulnerabilities.
  • PDO, PHP's built-in database library, does not support binding multiple values to a single parameter in the IN() clause, requiring developers to implement their own solutions.
  • The use of frameworks and libraries can help mitigate the risks of SQL injection, but some argue that this is not a substitute for proper coding practices.
  • The lack of a built-in way to pass an array of values to a parameterized query in PHP is a significant security issue.
  • Some developers argue that the language itself is not the problem, but rather the ecosystem and the examples that are available online.