Bug 789638 (CVE-2012-1037) - CVE-2012-1037 glpi 0.80.6 sub_type parameter local and remote file include and execution
Summary: CVE-2012-1037 glpi 0.80.6 sub_type parameter local and remote file include an...
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2012-1037
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 789649
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-11 23:22 UTC by Kurt Seifried
Modified: 2019-09-29 12:50 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-07-13 09:36:11 UTC


Attachments (Terms of Use)

Description Kurt Seifried 2012-02-11 23:22:22 UTC
From full disclosure Emilien Girault reports:

http://permalink.gmane.org/gmane.comp.security.full-disclosure/84497

CVE-2012-1037: GLPI <= 0.80.61 LFI/RFI

Severity: Important

Vendor: GLPI - http://www.glpi-project.org

Versions Affected
=================

All versions between 0.78 and 0.80.61

Description
===========

GLPI fails to properly sanitize the GET 'sub_type' parameter in the front/popup.php file:

  [...]
  checkLoginUser();

  if (isset($_GET["popup"])) {
     $_SESSION["glpipopup"]["name"] = $_GET["popup"];
  }

  if (isset($_SESSION["glpipopup"]["name"])) {
    switch ($_SESSION["glpipopup"]["name"]) {
  [...]
    case "add_ruleparameter" :
           popHeader($LANG['ldap'][35], $_SERVER['PHP_SELF']);
           include strtolower($_GET['sub_type']."Parameter.php");   // <======= 
           break;
  [...]

To be triggered, the attacker needs to be authenticated. However, GLPI provides default accounts that
often aren't changed or disabled:

    glpi/glpi
    tech/tech
    normal/normal
    post-only/postonly

Impact
======

Since there is a suffix, the vulnerability can be used as a RFI (requires allow_url_include = On).

For LFI, the target file has to end up with "parameter.php". GLPI automatically escapes all GET and POST
parameters with addslashes(), so the null byte technique is not usable. I have not tested exploitation
using path truncation technique but it might be possible.

Mitigation
==========

Upgrade to GLPI 0.80.7.

Exploit
=======

http://<server>/front/popup.php?popup=add_ruleparameter&sub_type=<file>

Timeline
========

08 feb 2012 - Found the bug.
09 feb 2012 - Contacted the GLPI Team.
09 feb 2012 - Bug fixed & new version available.

Thanks to the GLPI team for being responsive!

References
==========

http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-1037
https://forge.indepnet.net/projects/glpi/versions/685
https://forge.indepnet.net/projects/glpi/repository/revisions/17457/diff/branches/0.80-bugfixes/front/popup.php

Comment 1 Kurt Seifried 2012-02-11 23:34:54 UTC
Created glpi tracking bugs for this issue

Affects: fedora-all [bug 789649]

Comment 2 Remi Collet 2012-02-12 10:52:44 UTC
glpi-0.80.7 and glpi-0.78.5 + svn patch are already in the updates.

Comment 3 Fedora Update System 2012-02-19 01:56:22 UTC
glpi-0.78.5-3.svn17464.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 4 Fedora Update System 2012-02-19 01:57:16 UTC
glpi-0.80.7-1.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 5 Fedora Update System 2012-02-25 20:01:57 UTC
glpi-0.80.7-1.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 6 Fedora Update System 2012-02-27 03:27:26 UTC
glpi-0.78.5-4.svn17464.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Jan Lieskovsky 2012-07-13 09:36:11 UTC
This issue has been corrected in the following products:
1) via glpi-0.78.5-4.svn17464.el5 for Fedora EPEL 5,
2) via glpi-0.80.7-1.el6 for Fedora EPEL 6,
3) via glpi-0.80.7-1.fc16 for Fedora 16,
4) via glpi-0.80.7-1.fc17 (superseded by glpi-0.83.1-1.fc17) for Fedora 17.

Closing this bug.


Note You need to log in before you can comment on or make changes to this bug.