/

CVE-2026-43977

Severity:

HIGH RISK

(7.5)

Broken Access Control (CWE-639) in Wger Routine Logs

CVE-2026-43977

Deferred

Vulnerability type

Category:

Broken Access Control

CWE:

CWE-639, CWE-863

Impact:

Unauthorized Access to Sensitive Data

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Wger contains a broken access control issue that lets any authenticated user read another user's private workout logs and training statistics via the /logs/ and /stats/ routine actions.

When routines are marked as templates, permission checks mistakenly allow cross-user data disclosure, exposing sensitive fitness history to unauthorized accounts.

Affected context

This vulnerability arises in Wger's API layer, specifically within the RoutineViewSet where the custom /logs/ and /stats/ actions are exposed.

It affects deployments where routines can be marked is_template=True, and any authenticated user can invoke these actions against routines they do not own.

In this context, the view returns workout history tied to the routine's owner rather than the requesting user, causing unintended data exposure.

Exploit preconditions

  • Attack surface: Wger web/API interface, particularly the /logs/ and /stats/ endpoints on routine resources.
  • Required access: Any authenticated Wger account; no special roles or ownership of the target routine are needed.
  • Trigger point: Calling the /logs/ or /stats/ actions on a routine object the attacker does not own, especially where is_template=True is set.
  • Why exploitation is possible: The object-level permission logic (RoutinePermission.has_object_permission) grants read access based solely on the template flag and does not correctly bind logs and stats responses to the requesting user's own data.

Why this happens

The issue is rooted in broken object-level access control logic that misinterprets template routines as universally readable for all data associated with them.

Under CWE-639: Authorization Bypass Through User-Controlled Key, the API allows attackers to reference a routine identifier they do not own and still retrieve data, because the permission check does not validate ownership for the /logs/ and /stats/ actions.

It also reflects CWE-863: Incorrect Authorization, where the system checks only a coarse-grained condition (is_template=True) instead of enforcing that sensitive derived data (workout logs and stats) is limited to the requesting principal.

Abstractly, this pattern occurs when resource-level flags (like "template") are reused for user-facing permissions without differentiating between public structure and private, user-specific content.

Potential impact

  • An attacker may view another user's private workout session notes.
  • An attacker could read detailed exercise history and training statistics for arbitrary users.
  • User privacy can be compromised by exposing sensitive health and fitness-related information.
  • Attackers may correlate activity patterns or infer personal habits and schedules from training logs.

General mitigation guidance

Effective mitigation focuses on enforcing strict, user-bound authorization for all actions that return user-specific data.

Common defensive patterns include:

  • Separating permissions for template metadata from permissions for user-owned content derived from those templates.
  • Implementing object-level access checks that confirm both routine access and that the returned logs or stats belong to the requesting user.
  • Designing API actions so that user-specific queries are keyed by the authenticated principal rather than by arbitrary resource identifiers supplied by the client.
  • Applying least-privilege principles so that authenticated users can only read data explicitly scoped to their own account unless a clear "public" designation exists.
  • Centralizing authorization logic for sensitive views to avoid duplicated or inconsistent permission checks.

How teams detect issues like this

Detection often involves a combination of code-centric and behavioral analysis:

  • Static analysis or manual review focused on object-level permission classes and custom view actions, checking that ownership and user scoping are enforced consistently.
  • Looking for API endpoints where user-specific data is returned based on resource IDs without cross-checking the authenticated user, especially when flags like is_template or "public" are used.
  • Adding security-focused tests that simulate requests from non-owners to routines, ensuring /logs/ and /stats/-style endpoints do not leak other users' data.
  • Monitoring access logs for patterns where many different routine IDs are queried by a single account, indicating possible enumeration for data harvesting.
  • Utilizing automated security testing tools that can crawl the API and attempt ID-based access control bypasses against user-scoped resources.

Sources

SourceLink
github.comgithub.com/wger-project/wger/security/advisories/GHSA-cj9g-27ph-4cgv

Frequently asked

questions

It is broadly exploitable by any authenticated user of the Wger application. No elevated privileges are required; an attacker only needs an account and knowledge or discovery of routine identifiers to access other users' workout history.

The attacker needs standard authenticated access to Wger. Once logged in, they can call the /logs/ and /stats/ actions on routines they do not own, particularly those marked as templates, to retrieve private data belonging to other users.

The safest pattern is to enforce strict object-level authorization that ties all user-specific data to the authenticated principal. For endpoints like /logs/ and /stats/, the system should verify both routine accessibility and that any logs or statistics returned are filtered to the requesting user, regardless of template or public flags.

Future designs can reduce risk by consistently modeling permissions around the data owner, centralizing authorization checks, and treating "template" or "public" states as limited to structural metadata. Incorporating security requirements into API design reviews, adding automated tests for cross-user data access, and using policy-based access control frameworks can help prevent comparable authorization flaws.

Find out what's already
exploitable in your codebase.