MantisBT 1.2.19 - Host Header Attack Vulnerability

ID: 59213
CVE: None
Download vulnerable application: Download
# Exploit Title: MantisBT 1.2.19 - Host header attack vulnerability
# Date: 07-09-2015
# Exploit Author: Pier-Luc Maltais
				  Centre opérationnel de sécurité informatique gouvernemental (COSIG)
# Vendor Homepage:
# Software Link:
# Version: 1.2.19
# Contact:

Vulnerability Description:

MantisBT 1.2.19 is vulnerable to an Host header attack that can
be exploited by an unauthenticated user to hijack another user account.
Technical Details:

This exploit use the Host header attack to poison the link in the
password reset mail. You need to know the victim username and 
e-mail. You also need a remote host that you control to catch the 
verification hash needed for password reset.

1.  Access the password reset feature and fill the form with the
    victim username and e-mail.


2.  Using an intercepting proxy like Burp, change the Host header 
    with your evil host.

    Original request :
    POST /mantisbt/lost_pwd_page.php HTTP/1.1
    Modified request : 
    POST /mantisbt/lost_pwd_page.php HTTP/1.1
    Host :
3.  When the user receive the e-mail, the link is poisoned with 
    the evil host.

    visit the following URL to change your password: 
4.  Now, when the victim click on the link to reset his password,
    his verification hash will be sent to our evil host. All we 
    have to do is access the verify.php page with his hash, so
    we can change his password and hijack his account.

$_SERVER['SERVER_NAME'] (server controlled) 
instead of 
$_SERVER['HTTP_HOST'] (client controlled)
Disclosure Timeline:

16/02/2015 - Found the vulnerability
17/02/2015 - Wrote this advisory
17/02/2015 - Contacted developers on MantisBT forum
18/02/2015 - Opened an issue in the bug tracker
01/09/2015 - Still not patched, releasing this advisory.

1-4-2 (www01)