wger Trainer Login Privilege Escalation Vulnerability
A gym trainer in wger (<= 2.5) can escalate privileges to a gym manager by chaining calls to the trainer-login endpoint due to a flawed permission check, as tracked by CVE-2026-43978.
A privilege escalation vulnerability exists in wger versions 2.5 and earlier, identified as CVE-2026-43978. This flaw allows a gym trainer to escalate their session to a gym manager or general manager account by chaining two calls to the trainer-login endpoint. The vulnerability stems from an insufficient permission check in wger/core/views/user.py, where the trainer.identity session flag bypasses permission checks on subsequent calls to the trainer-login endpoint. This allows the trainer to escalate privileges without proper authorization. The issue was reported on May 14, 2026 and impacts instances of wger version 2.5 and prior.
Attack Chain
- An attacker logs in to the wger application as a gym trainer with limited privileges.
- The trainer initiates a legitimate switch to a lower-privileged user account using the
/en/user/<user_id>/trainer-loginendpoint. - Upon successful switch, the application sets the
trainer.identityflag in the user’s session, identifying the original trainer. - The attacker, now operating under the context of the lower-privileged user, makes another call to
/en/user/<manager_id>/trainer-login, this time targeting a gym manager account. - Due to the presence of the
trainer.identityflag, the permission check atwger/core/views/user.py:169is bypassed, allowing the trainer-login to proceed without validating if the current user hasgym_trainerpermissions. - Because the user is no longer a trainer, the check on line 173 in
wger/core/views/user.pyis not reached, which would normally block escalation tomanage_gymormanage_gymspermissions. - The attacker’s session is now elevated to that of the gym manager, granting them full administrative privileges.
- The attacker can now access sensitive data, modify gym settings, and perform other actions as a gym manager.
Impact
Successful exploitation of this vulnerability (CVE-2026-43978) allows a malicious gym trainer to gain unauthorized access to sensitive information and administrative functions within the wger application. This includes the ability to view member data, modify contracts, manage gym configurations, and access other trainers’ and managers’ personal information. The attacker can effectively take over the gym manager’s account, potentially impacting all gym operations and member data.
Recommendation
- Apply the patch provided in the advisory to
wger/core/views/user.pyto fix the permission check logic (see the “How to fix” section in the advisory). - Upgrade wger to a version greater than 2.5 to remediate CVE-2026-43978.
- Deploy the Sigma rule “Detect wger Trainer Login Privilege Escalation Attempt” to your SIEM to detect exploitation attempts.
- Monitor web server logs for unusual activity related to the
/en/user/<user_id>/trainer-loginendpoint, which may indicate attempts to exploit this vulnerability.
Detection coverage 2
Detect wger Trainer Login Privilege Escalation Attempt
highDetects CVE-2026-43978 exploitation — An attacker attempts to exploit the privilege escalation vulnerability by calling the trainer-login endpoint
Detect Multiple Trainer Login Attempts from Same IP
mediumDetects multiple trainer login attempts from the same IP address in a short period, potentially indicating exploitation of CVE-2026-43978.
Detection queries are available on the platform. Get full rules →