Categories
CVE-2026-45161 medium CVSS 5.4

Cross-Site Request Forgery (CSRF) in wger (CVE-2026-45161)

Summary

Vulnerability in wger (CVE-2026-45161). Risk of unauthorized operations or information disclosure. Exploitable via GET /en/user/.

Original description

The description as published by the source.

Summary

The trainer_login view in wger accepts GET requests and executes django_login() without any CSRF protection, because Django's CsrfViewMiddleware only enforces tokens on unsafe methods (POST/PUT/PATCH/DELETE). An attacker can embed a single `` tag on a malicious page; when an authenticated trainer loads that page, their browser auto-issues the GET with the session cookie, forcibly rebinding the trainer's session to an arbitrary user account.

Details

File: wger/core/views/user.py, approximately lines 161-210

# VULNERABLE - no @require_POST, no request.method == 'POST' guard
# CsrfViewMiddleware is bypassed because CSRF enforcement only applies to
# unsafe HTTP methods (POST, PUT, PATCH, DELETE)
def trainer_login(request, user_pk):
    ...
    django_login(request, user, backend='django.contrib.auth.backends.ModelBackend')
    return HttpResponseRedirect(...)

Because the view handles GET, Django's CSRF middleware does not validate any token. An attacker can place `` on any web page. When an authenticated trainer's browser loads that page, it issues the GET request with the session cookie attached (SameSite=Lax does not block same-site top-level navigation and subresource hops triggered by same-origin redirects). The server executes django_login() and issues a new session cookie binding the trainer to the victim user.

Playwright-verified in Chromium 147: the SameSite bypass occurs via a ?next= redirect chain - the initial cross-…

Source: GitHub Security Advisories (Global) NVD GitHub Advisory

Auto-generated summary

Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.

A vulnerability tracked as CVE-2026-45161 has been found in wger.
Attackers can target a specific entry point like GET /en/user/ over the network to misuse the product.
Risk of unauthorized operations or information disclosure. CVSS score: 5.4/10.
What to do: apply the vendor's official patched release.
If unsure, ask your IT team or search "wger CVE-2026-45161" on the vendor's site.

CVE-2026-45161 (wger) — CWE-352 / CVSS v3 5.4
Attack vector: remote (network-reachable)
Attack surface: GET /en/user/ / GET /en/user/2/trainer-login / GET /api/v2/userprofile/ / trainer_login
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.

❓ What is the problem

CSRF (CWE-352) exists in wger. Attackers reach the vulnerable code path via GET /en/user/.

📍 Affected scope

Check the vendor advisory for the affected versions of wger. Attack surface: GET /en/user/ / GET /en/user/2/trainer-login / GET /api/v2/userprofile/ / trainer_login.

🔥 Severity

Severity: Medium (CVSS 5.4/10). Risk of unauthorized operations or information disclosure.

🔧 How to fix

Update to the patched release per vendor advisory.

🛡️ Workaround

Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.

🔍 Detection

Search webserver/proxy logs for unusual GET /en/user/ requests with malformed payloads or SQL meta-characters. Run grep -r 'wger' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.

Response actions

Concrete steps and command examples for SOC/SRE teams to execute in order

  1. 1
    Identify exposure identify
    grep -r 'wger' . | grep -v node_modules

    リポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で wger を grep し、稼働しているサービス・バージョンを把握する。

  2. 2
    Hunt for indicators of compromise detect
    grep 'GET /en/user/' /var/log/nginx/access.log | grep -E '(unusual_payload|sqli_pattern)'

    アクセスログで GET /en/user/ への異常なリクエスト (不正な認証ヘッダ・SQLメタ文字)を過去 30〜90日分捜索。WAF/SIEM があれば該当パスのアラート発火履歴を確認。

  3. 3
    Post-deployment verification verify
    Replay attack against GET /en/user/ on staging to confirm patch closes the vector

    パッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番では Step 2 と同じログクエリでアラート再発が無いか継続監視。

Affected packages

pip wger
[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}]
PyPI wger
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"2.1"}]}]

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details