Skip to content

SQL injection with SET-NAMES #1047

Closed
Closed
@orthagh

Description

@orthagh

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)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions