Skip to content

Session Fixation on mailcow web panel

High
FreddleSpl0it published GHSA-23c8-4wwr-g3c6 Jan 28, 2025

Package

No package listed

Affected versions

<= 2024-11b

Patched versions

<= 2025-01

Description

Summary

The login page does not invalidate existing session identifiers, instead, it accepts and validates any session identifier stored in the browser. After the user logs in, they are authenticated, and the session identifier becomes valid. A remote attacker can then use the same session identifier to access the victim's web panel. In this case, this vulnerability allows remote attackers to set a session identifier when HSTS is disabled in the victim's browser.

Details

Without invalidating any existing session identifier on login page, it will validate existing session identifier in browser, and it could give an attacker the opportunity when HSTS is not set. Just you need to set your PHPSESSID on browser before login, it'll validate session identifier. This testing strategy is targeted at network attackers; hence it only needs to be applied to sites without full HSTS adoption.

PoC

While you are in login page on mailcow web panel, just change PHPSESSID to a every random string that you want and submit your username and password. you will see that it won't invalidated existing PHPSESSID and your string will be validated, it only needs to be applied to sites without full HSTS adoption.

POST / HTTP/1.1
Host: demo.mailcow.email
Cookie: PHPSESSID= EVERY RANDOM STRING YOU WANT
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Referer: https://demo.mailcow.email/
Content-Type: application/x-www-form-urlencoded
Content-Length: 110
Origin: https://demo.mailcow.email
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1
Priority: u=0, i
Te: trailers
Connection: keep-alive

login_user=admin&pass_user=whoohoo

Then you can see your random string in PHPSESSID is validated.

Impact

  • A web application authenticates a user without first invalidating the existing session, thereby continuing to use the session already associated with the user.
  • An attacker is able to force a known session identifier on a user so that, once the user authenticates, the attacker has access to the authenticated session.

Useful links:

For more information:

@MortazaviM

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Adjacent
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
Low

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:A/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:L

CVE ID

CVE-2024-56529

Weaknesses

Credits