Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL injection with SET-NAMES #1047

Closed
orthagh opened this issue Sep 23, 2016 · 1 comment
Closed

SQL injection with SET-NAMES #1047

orthagh opened this issue Sep 23, 2016 · 1 comment
Assignees
Labels
Milestone

Comments

@orthagh
Copy link
Contributor

orthagh commented Sep 23, 2016

CVE-2016-7508
Thanks to Eric Carter (CS)

[Attack Vectors]
Prerequisite: the administrator of GLPI must have defined the variable
$dbenc='big5' in ./config/config_db.php to support asian encoding. It
will then be possible to do SQL injection in almost all the forms of
the application. For the proof-of-concept, the attacker targeted the
"Surname" form input in the User profile by adding the characters [ELIDED]
before the SQL code (the request must be sent using Unicode encoding)
:[ELIDED]', password=61529519452809720693702583126814 -- x

Once received by the
server, the request will be sanitized, giving :[ELIDED]',
password=61529519452809720693702583126814 -- x

The value will then be sent to the database with a BIG5 encoding.
Here is the critical point, as BIG5 will see the string [ELIDED]\ as a single asian character encoded on
two bytes. As the single quote isn't escaped anymore, the SQL code will
be executed and will set the password of every account to the value
61529519452809720693702583126814 (=MD5 hash of "ximaz" string)

@orthagh orthagh added this to the 9.1 milestone Sep 23, 2016
@orthagh orthagh self-assigned this Sep 23, 2016
@orthagh
Copy link
Contributor Author

orthagh commented Sep 23, 2016

See ac25773 and 06a1bce

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant