I'm reviewing a PHP library that interacts with an Informix database.
Since I'm following the library structure I cannot use pdo. Is it there a guideline on how to properly protect an Informix query from SQL injection?
I'm reviewing a PHP library that interacts with an Informix database.
Since I'm following the library structure I cannot use pdo. Is it there a guideline on how to properly protect an Informix query from SQL injection?
In terms of protecting against SQL injections, Informix isn't fundamentally different from other fully-featured SQL database systems like PostgreSQL, MySQL, MSSQL or whatnot. So you can pick any generic guide (like the SQL Injection Prevention Cheat Sheet from OWASP), learn how the prevention mechanism work on a conceptual level and then look up how exactly they're are implemented in Informix and the specific PHP/Informix API you're using. As you do a code review, I assume you're comfortable reading manuals.
Dealing with dynamic input in SQL queries is context-dependent.
prepare, bind and execute (some or all of those steps might be combined into a single call).LIMIT clause. If you cannot use prepared statements for this, fall back to validation.