SQL injection/fr

Résumé
SQL injection is a type of attack that uses vulnerabilities in an application's input validation or data typing for SQL queries.

Quand cela fonctionne, l'attaque permet à l'assaillant d'injecter des données dans une requête SQL existante. The attacker may then be able to fetch private data, cause a denial of service or cause other unintended responses. In the worst case, the injected code would allow the attacker to gain full control of the system by exploiting multiple vulnerabilities in the database server, system utilities and operating system.

For an overview of SQL injection attacks, review Wikipedia's SQL Injection page.

Exemple
The following code snippet would allow an attacker to execute their own SQL commands (and is a syntax error in Oracle).

La manière recommandée d'exécuter la requête ci-dessus est :

To exploit the vulnerability and fetch the email addresses of registered wiki users, the attacker would use a GET string of:



Injection de SQL et MediaWiki
MediaWiki has a custom SQL generation interface which has proven to be effective for eliminating SQL injection vulnerabilities. The SQL generation interface also provides DBMS abstraction and features such as table prefixes.

Pour protéger MediaWiki contre l'injection de SQL


 * avoid using direct SQL queries at all costs
 * review Manual:Database access and use the functions provided in Database.php
 * read the The Open Web Application Security Project's page on SQL injection (http://www.owasp.org/index.php/SQL_Injection)
 * The SQL Injection Wiki: http://www.sqlinjectionwiki.com/