CVE-2026-43948: wger Cross-tenant Password Reset And Plaintext Vulnerability

CRITICAL
Advisory Identifier: GHSA-mhc8-p3jx-84mm
CVSS 9.9
CWE-863
Published
Advisory Summary

CVE-2026-43948 is a CRITICAL (CVSS 9.9) cross-tenant password reset and plaintext vulnerability (CWE-863: Incorrect Authorization) affecting wger libraries in the PyPI ecosystem. The issue involves cross-tenant password reset and plaintext disclosure via gym=none bypass. Remediation is available by upgrading affected packages to version 2.6.

CVE-2026-43948 at a Glance

CVE Identifier CVE-2026-43948
GHSA Identifier GHSA-mhc8-p3jx-84mm
Severity CRITICAL
CVSS v3.1 Base Score 9.9
CWE Classification CWE-863: Incorrect Authorization
Affected Product wger
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 9.9

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-43948

To remediate this vulnerability, upgrade all affected wger dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

wger fixed: 2.6
pip install wger>=2.6
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show wger

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-43948, inspect your installed packages using pip:

pip show wger

Analyze the terminal output to locate any version of wger in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.6), your application is affected.

Note: The pip show wger command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-863: Incorrect Authorization, where the product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. In wger, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary The `reset_user_password` and `gym_permissions_user_edit` views in wger perform a gym-scope authorization check using Python object comparison (`!=`) that evaluates `None != None` as `False`, silently bypassing the guard when both the attacker and victim have no gym assignment (`gym=None`). A user with `gym.manage_gym` permission and `gym=None` can reset the password of **any other `gym=None` user**; the new plaintext password is returned verbatim in the HTML response body, enabling one-shot full account takeover. The victim's original password is invalidated, locking them out permanently. ### Details **File**: `wger/gym/views/user.py` The authorization guard in `reset_user_password` (and the parallel check in `gym_permissions_user_edit`) uses Django ORM object comparison: ```python # VULNERABLE - wger/gym/views/user.py if request.user.userprofile.gym != user.userprofile.gym: return HttpResponseForbidden() ``` When both `request.user.userprofile.gym` and `user.userprofile.gym` are `None` (representing users with no gym assignment - the default for newly registered users before gym linking), Python evaluates `None != None` as `False`. The guard therefore passes without raising `HttpResponseForbidden`, and execution continues unconditionally to: ```python password = password_generator() user.set_password(password) user.save() return render(request, 'user/trainer_login.html', {'password': password, ...}) ``` The generated password is rendered verbatim in the response body. **Affected endpoints**: - `GET /en/gym/user/<user_pk>/reset-user-password` -> `wger.gym.views.user.reset_user_password` - `GET /en/gym/user/<user_pk>/edit` -> `wger.gym.views.user.gym_permissions_user_edit` **Suggested patch**: ```diff --- a/wger/gym/views/user.py +++ b/wger/gym/views/user.py - if request.user.userprofile.gym != user.userprofile.gym: - return HttpResponseForbidden() + trainer_gym_id = request.user.userprofile.gym_id # raw FK int + member_gym_id = user.userprofile.gym_id + + if trainer_gym_id is None or trainer_gym_id != member_gym_id: + return HttpResponseForbidden() ``` The `_id` suffix accesses the raw integer foreign key, bypassing Python's object identity semantics. The explicit `is None` guard rejects unaffiliated trainers immediately, regardless of the victim's gym status. Apply the same `same_gym()` helper pattern to all five views sharing this check: `reset_user_password`, `gym_permissions_user_edit`, `admin_notes_list`, `documents_list`, `contracts_list`. ### PoC Tested on `wger/server:latest` Docker image (runtime: Django 5.2.13). Two test users: `trainer1` (`gym.manage_gym` permission, `userprofile.gym=None`) and `alice` (regular user, `userprofile.gym=None`). **Step 1** - Authenticate as trainer with `manage_gym` permission and `gym=None`: ``` POST /en/user/login HTTP/1.1 Host: target Content-Type: application/x-www-form-urlencoded username=trainer1&password=[REDACTED]&csrfmiddlewaretoken=[REDACTED] -> 302 Found; Set-Cookie: sessionid=[trainer1_session] ``` **Step 2** - Trigger cross-tenant password reset: ``` GET /en/gym/user/2/reset-user-password HTTP/1.1 Host: target Cookie: sessionid=[trainer1_session] -> 200 OK <tr><th>Password</th><td>[GENERATED_PLAINTEXT_PASSWORD]</td></tr> ``` **Step 3** - Authenticate as victim (alice) using leaked password: ``` POST /en/user/login HTTP/1.1 Host: target username=alice&password=[GENERATED_PLAINTEXT_PASSWORD]&csrfmiddlewaretoken=[...] -> 302 Found; authenticated as alice (alice's ORIGINAL password is now invalid - permanent lockout) ``` **RBAC Disproof Protocol** (three-scenario test): - Scenario A (admin, same-gym) -> HTTP 200 (expected - documented feature) - Scenario B (trainer1 gym=None -> alice gym=None) -> **HTTP 200 with plaintext password in body** (expected HTTP 403) - Scenario C (trainer1 gym=1 -> alice gym=2) -> HTTP 403 (expected - guard works when gyms differ, confirms bypass is `None`-specific) Reproducibility: 2/2 runs after clean-baseline database reset. ### Impact An attacker with `gym.manage_gym` permission and `gym=None` can: 1. Reset the password of any other `gym=None` user on the wger instance. 2. Receive the new plaintext password in the HTTP response body. 3. Log in as the victim immediately. 4. Permanently lock the victim out (original password invalidated). **Affected deployments**: every wger instance where `gym.manage_gym` permission is delegated to non-admin users AND any other users exist with `gym=None`. The `gym=None` state is the **default for newly registered users** before manual gym assignment, so every public-registration wger instance is affected. **Severity**: Critical (CVSS 9.9). Network-reachable, low complexity, requires only low privilege (delegated trainer), scope change (impersonation of other tenant), complete confidentiality/integrity/availability loss for all unaffiliated accounts. This is the same structural bug class as the sibling finding affecting `trainer_login` (submitted separately). The root cause - Django ORM object-`!=` returning `False` when both sides are `None` - appears across five views and warrants a shared `same_gym()` helper.

CVE-2026-43948 Affected wger Versions

1 component(s)
Fixed Versions:
2.6
Product / Package Ecosystem Affected Versions Fixed Version
wger
PyPI
< 2.6
2.6

References

Frequently Asked Questions

What is CVE-2026-43948?
CVE-2026-43948 is a security vulnerability in wger involving cross-tenant password reset and plaintext disclosure via gym=None bypass under CWE-863: Incorrect Authorization.
Which wger versions are affected?
Affected versions include releases prior to 2.6 across affected packages: wger.
What version fixes CVE-2026-43948?
Upgrading to 2.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is wger affected?
Yes, wger is affected in releases prior to 2.6. Upgrade your dependency to 2.6 or later.
What is the CVSS score of CVE-2026-43948?
CVE-2026-43948 has a CVSS v3.1 base score of 9.9 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2026-43948?
CVE-2026-43948 is classified under CWE-863: Incorrect Authorization (The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.).
How can I check PyPI dependencies for CVE-2026-43948?
Run the dependency tree command: 'pip show wger'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-mhc8-p3jx-84mm",
  "modified" : "2026-05-13T16:31:51Z",
  "published" : "2026-05-06T19:50:31Z",
  "aliases" : [ "CVE-2026-43948" ],
  "summary" : "wger: cross-tenant password reset and plaintext disclosure via gym=None bypass",
  "details" : "### Summary\n\nThe `reset_user_password` and `gym_permissions_user_edit` views in wger perform a gym-scope authorization check using Python object comparison (`!=`) that evaluates `None != None` as `False`, silently bypassing the guard when both the attacker and victim have no gym assignment (`gym=None`). A user with `gym.manage_gym` permission and `gym=None` can reset the password of **any other `gym=None` user**; the new plaintext password is returned verbatim in the HTML response body, enabling one-shot full account takeover. The victim's original password is invalidated, locking them out permanently.\n\n### Details\n\n**File**: `wger/gym/views/user.py`\n\nThe authorization guard in `reset_user_password` (and the parallel check in `gym_permissions_user_edit`) uses Django ORM object comparison:\n\n```python\n# VULNERABLE - wger/gym/views/user.py\nif request.user.userprofile.gym != user.userprofile.gym:\n    return HttpResponseForbidden()\n```\n\nWhen both `request.user.userprofile.gym` and `user.userprofile.gym` are `None` (representing users with no gym assignment - the default for newly registered users before gym linking), Python evaluates `None != None` as `False`. The guard therefore passes without raising `HttpResponseForbidden`, and execution continues unconditionally to:\n\n```python\npassword = password_generator()\nuser.set_password(password)\nuser.save()\nreturn render(request, 'user/trainer_login.html', {'password': password, ...})\n```\n\nThe generated password is rendered verbatim in the response body.\n\n**Affected endpoints**:\n- `GET /en/gym/user/<user_pk>/reset-user-password` -> `wger.gym.views.user.reset_user_password`\n- `GET /en/gym/user/<user_pk>/edit` -> `wger.gym.views.user.gym_permissions_user_edit`\n\n**Suggested patch**:\n\n```diff\n--- a/wger/gym/views/user.py\n+++ b/wger/gym/views/user.py\n-    if request.user.userprofile.gym != user.userprofile.gym:\n-        return HttpResponseForbidden()\n+    trainer_gym_id = request.user.userprofile.gym_id   # raw FK int\n+    member_gym_id  = user.userprofile.gym_id\n+\n+    if trainer_gym_id is None or trainer_gym_id != member_gym_id:\n+        return HttpResponseForbidden()\n```\n\nThe `_id` suffix accesses the raw integer foreign key, bypassing Python's object identity semantics. The explicit `is None` guard rejects unaffiliated trainers immediately, regardless of the victim's gym status. Apply the same `same_gym()` helper pattern to all five views sharing this check: `reset_user_password`, `gym_permissions_user_edit`, `admin_notes_list`, `documents_list`, `contracts_list`.\n\n### PoC\n\nTested on `wger/server:latest` Docker image (runtime: Django 5.2.13). Two test users: `trainer1` (`gym.manage_gym` permission, `userprofile.gym=None`) and `alice` (regular user, `userprofile.gym=None`).\n\n**Step 1** - Authenticate as trainer with `manage_gym` permission and `gym=None`:\n\n```\nPOST /en/user/login HTTP/1.1\nHost: target\nContent-Type: application/x-www-form-urlencoded\n\nusername=trainer1&password=[REDACTED]&csrfmiddlewaretoken=[REDACTED]\n\n-> 302 Found; Set-Cookie: sessionid=[trainer1_session]\n```\n\n**Step 2** - Trigger cross-tenant password reset:\n\n```\nGET /en/gym/user/2/reset-user-password HTTP/1.1\nHost: target\nCookie: sessionid=[trainer1_session]\n\n-> 200 OK\n<tr><th>Password</th><td>[GENERATED_PLAINTEXT_PASSWORD]</td></tr>\n```\n\n**Step 3** - Authenticate as victim (alice) using leaked password:\n\n```\nPOST /en/user/login HTTP/1.1\nHost: target\n\nusername=alice&password=[GENERATED_PLAINTEXT_PASSWORD]&csrfmiddlewaretoken=[...]\n\n-> 302 Found; authenticated as alice\n(alice's ORIGINAL password is now invalid - permanent lockout)\n```\n\n**RBAC Disproof Protocol** (three-scenario test):\n- Scenario A (admin, same-gym) -> HTTP 200 (expected - documented feature)\n- Scenario B (trainer1 gym=None -> alice gym=None) -> **HTTP 200 with plaintext password in body** (expected HTTP 403)\n- Scenario C (trainer1 gym=1 -> alice gym=2) -> HTTP 403 (expected - guard works when gyms differ, confirms bypass is `None`-specific)\n\nReproducibility: 2/2 runs after clean-baseline database reset.\n\n### Impact\n\nAn attacker with `gym.manage_gym` permission and `gym=None` can:\n\n1. Reset the password of any other `gym=None` user on the wger instance.\n2. Receive the new plaintext password in the HTTP response body.\n3. Log in as the victim immediately.\n4. Permanently lock the victim out (original password invalidated).\n\n**Affected deployments**: every wger instance where `gym.manage_gym` permission is delegated to non-admin users AND any other users exist with `gym=None`. The `gym=None` state is the **default for newly registered users** before manual gym assignment, so every public-registration wger instance is affected.\n\n**Severity**: Critical (CVSS 9.9). Network-reachable, low complexity, requires only low privilege (delegated trainer), scope change (impersonation of other tenant), complete confidentiality/integrity/availability loss for all unaffiliated accounts.\n\nThis is the same structural bug class as the sibling finding affecting `trainer_login` (submitted separately). The root cause - Django ORM object-`!=` returning `False` when both sides are `None` - appears across five views and warrants a shared `same_gym()` helper.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "wger"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.6"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.5"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/wger-project/wger/security/advisories/GHSA-mhc8-p3jx-84mm"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-43948"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/wger-project/wger"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-863" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-06T19:50:31Z",
    "nvd_published_at" : "2026-05-12T22:16:35Z"
  }
}