/

CVE-2026-43976

Severity:

HIGH RISK

(7.1)

Authorization Bypass (CWE-863) in wger Gym Management

CVE-2026-43976

Deferred

Vulnerability type

Category:

Authorization Bypass

CWE:

CWE-863

Impact:

Unauthorized access and sensitive data disclosure

Severity:

HIGH RISK

(7.1)

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

A flawed gym-scope authorization check in wger allows certain trainers without an assigned gym to access sensitive records belonging to unrelated users. An attacker with the required trainer and admin-note permissions may retrieve private notes, uploaded documents, contracts, user configuration, and permission data by supplying another user's identifier.

A flawed gym-scope authorization check in wger allows certain trainers without an assigned gym to access sensitive records belonging to unrelated users. An attacker with the required trainer and admin-note permissions may retrieve private notes, uploaded documents, contracts, user configuration, and permission data by supplying another user's identifier.

Affected context

The issue occurs in wger gym management views when a deployment uses the affected authorization logic and a trainer account has gym.gym_trainer and gym.add_adminusernote permissions but no gym assignment. The vulnerable views rely on a gym comparison that does not reject two None values, while subsequent querysets use the supplied member_id without applying an independent gym-scope restriction.

The issue occurs in wger gym management views when a deployment uses the affected authorization logic and a trainer account has gym.gym_trainer and gym.add_adminusernote permissions but no gym assignment. The vulnerable views rely on a gym comparison that does not reject two None values, while subsequent querysets use the supplied member_id without applying an independent gym-scope restriction.

Exploit preconditions

  • Attack surface: Authenticated gym management web views
  • Required access: A trainer account with gym.gym_trainer and gym.add_adminusernote permissions
  • Account condition: The attacker must not be assigned to a gym
  • Trigger point: A request to one of the affected views using another user's identifier
  • Why exploitation is possible: The guard treats two missing gym assignments as equivalent and permits processing, while downstream queries do not independently verify that the target user belongs to an authorized gym
  • Attack surface: Authenticated gym management web views
  • Required access: A trainer account with gym.gym_trainer and gym.add_adminusernote permissions
  • Account condition: The attacker must not be assigned to a gym
  • Trigger point: A request to one of the affected views using another user's identifier
  • Why exploitation is possible: The guard treats two missing gym assignments as equivalent and permits processing, while downstream queries do not independently verify that the target user belongs to an authorized gym

Why this happens

The underlying bug is an incomplete authorization boundary. The gym-scope guard compares two nullable values and allows the request when both are None, treating the absence of a gym relationship as if it were a valid matching scope. The later data queries trust the attacker-supplied member identifier without enforcing the same authorization relationship, which maps to CWE-863: Incorrect Authorization.

The underlying bug is an incomplete authorization boundary. The gym-scope guard compares two nullable values and allows the request when both are None, treating the absence of a gym relationship as if it were a valid matching scope. The later data queries trust the attacker-supplied member identifier without enforcing the same authorization relationship, which maps to CWE-863: Incorrect Authorization.

Potential impact

  • Attackers may read private administrator notes
  • Attackers could access uploaded user documents and gym contracts
  • User configuration data may be disclosed
  • User permission information can be exposed
  • The confidentiality of unrelated users on the instance may be compromised
  • Attackers may read private administrator notes
  • Attackers could access uploaded user documents and gym contracts
  • User configuration data may be disclosed
  • User permission information can be exposed
  • The confidentiality of unrelated users on the instance may be compromised

General mitigation guidance

Mitigation generally focuses on enforcing authorization at every data-access boundary rather than relying on a single preliminary guard.

Common defensive patterns include:

  • Treating missing scope values as unauthorized unless an explicit policy permits access
  • Requiring an authenticated user's gym relationship to match the target record
  • Applying gym-scope predicates directly to every sensitive queryset
  • Deriving the target user from trusted server-side relationships where possible instead of trusting a client-supplied identifier
  • Using deny-by-default authorization and least-privilege permission assignments
  • Centralizing and reusing authorization checks across related management views

Mitigation generally focuses on enforcing authorization at every data-access boundary rather than relying on a single preliminary guard.

Common defensive patterns include:

  • Treating missing scope values as unauthorized unless an explicit policy permits access
  • Requiring an authenticated user's gym relationship to match the target record
  • Applying gym-scope predicates directly to every sensitive queryset
  • Deriving the target user from trusted server-side relationships where possible instead of trusting a client-supplied identifier
  • Using deny-by-default authorization and least-privilege permission assignments
  • Centralizing and reusing authorization checks across related management views

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis and code review checks for authorization comparisons involving nullable scope fields
  • Review signals where a client-supplied identifier is used without a corresponding ownership or tenant predicate
  • Tests covering unassigned users, mismatched gyms, and cross-tenant record access
  • Policy checks requiring authorization filters on queries that return notes, documents, contracts, configuration, or permissions
  • Integration tests that verify every sensitive view denies access when the requester and target user have no valid gym relationship

Automated security review tools may help identify missing authorization checks, but application-specific tenant and membership rules still require manual validation.

Organizations can look for this class of issue through:

  • Static analysis and code review checks for authorization comparisons involving nullable scope fields
  • Review signals where a client-supplied identifier is used without a corresponding ownership or tenant predicate
  • Tests covering unassigned users, mismatched gyms, and cross-tenant record access
  • Policy checks requiring authorization filters on queries that return notes, documents, contracts, configuration, or permissions
  • Integration tests that verify every sensitive view denies access when the requester and target user have no valid gym relationship

Automated security review tools may help identify missing authorization checks, but application-specific tenant and membership rules still require manual validation.

Sources

SourceLink
github.comgithub.com/wger-project/wger/releases/tag/2.6
github.comgithub.com/wger-project/wger/security/advisories/GHSA-c72h-82w6-rqfp

Frequently asked

questions

Yes, where the affected gym management views are exposed through the application and the attacker has a qualifying authenticated account. It does not require access to the server filesystem.

The attacker needs a trainer account with the specified permissions and no gym assignment, along with the ability to submit requests to the affected views.

Enforce an explicit, deny-by-default gym relationship for the requester and target record, and apply that scope directly to every sensitive queryset.

Test authorization across missing, mismatched, and valid scopes; avoid treating two absent values as proof of authorization; and require consistent tenant or gym filters at the data-access layer.

Yes, where the affected gym management views are exposed through the application and the attacker has a qualifying authenticated account. It does not require access to the server filesystem.

The attacker needs a trainer account with the specified permissions and no gym assignment, along with the ability to submit requests to the affected views.

Enforce an explicit, deny-by-default gym relationship for the requester and target record, and apply that scope directly to every sensitive queryset.

Test authorization across missing, mismatched, and valid scopes; avoid treating two absent values as proof of authorization; and require consistent tenant or gym filters at the data-access layer.

Find out what's already
exploitable in your codebase.