GLPI 0.85.5 RCE through file upload filter bypass
The application allows users to upgrade their own profile. The user has the possibility to add a new photo as attachment. The photo that he uploads will be stored into GLPI_ROOT/files/_pictures/. This file, for example named 'photo.jpeg', will be directly accessible through 'http://host/GLPI_ROOT/files/_pictures/XXXX.jpeg', where 'XXXX' is an ID automatically generated by the system and visible in the HTML source code. Besides, the server does not check the extension of the uploaded file, but only the first bytes within it, that indicates which kind of file is. Exploiting this flaw, an attacker may upload a tampered jpeg file that contains php code placed at the end of the file, so that, just changing the file extention to '.php', by default the php code will be interpreted!