Skip to content

SEC: JWT Tokens Not Invalidated on Logout — no revocation mechanism #187

Closed

Description

@vybe

Pentest Finding 3.3.4 — Low (CVSS 2.0)

Location: config.py, routers/auth.py

Impact

JWT tokens are valid for 7 days with no server-side revocation mechanism. If a session token is exfiltrated, it remains usable for the full 7-day period regardless of password changes or logout attempts. There is no logout endpoint in the API.

Root Cause

# config.py
ACCESS_TOKEN_EXPIRE_MINUTES = 10080  # 7 days (was 30 minutes)

No token blacklist, jti tracking, or refresh token pattern exists. grep for logout|blacklist|revoke|invalidate in routers/auth.py returns no results.

Remediation

  • Store token jti claims in Redis upon logout; verify against the blacklist on each request
  • Reduce ACCESS_TOKEN_EXPIRE_MINUTES to 60–480 minutes and implement refresh tokens
  • Add POST /api/auth/logout endpoint

References

Source: UnderDefense Web Pentest Report, March 2026

Activity

  1. added
    priority-p2
    security
    pentest
    severity-low
    on Mar 26, 2026
  2. added
    complexity-medium
    theme-security
    on Jun 3, 2026
  3. added
    status-ready
    on Jun 14, 2026
  4. removed
    status-ready
    on Jun 30, 2026
  5. dolho commented on Jun 30, 2026

    @dolho
    Contributor

    /claim

  6. added
    status-in-progress
    on Jun 30, 2026
  7. github-actions commented on Jun 30, 2026

    @github-actions

    Claimed by @dolho. Label status-in-progress added.

    Next steps:

    1. Create branch: feature/187-<short-slug>
    2. Implement the feature
    3. Open a PR with Fixes #187
  8. added a commit that references this issue on Jun 30, 2026
  9. added
    status-in-dev
    and removed
    status-in-progress
    on Jun 30, 2026
  10. removed
    status-in-dev
    on Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

complexity-mediumpentestpriority-p2securityseverity-lowtheme-securitytype-bug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions