JSON Web Token (JWT) Does Not Expire Properly, Allowing Extended Unauthorized Access

XMLWordPrintable

    • Type: Bug
    • Resolution: Done
    • Priority: Highest
    • 3.6.1
    • Affects Version/s: 3.4.0
    • AMRIT Sprint 48, AMRIT Sprint 49, AMRIT Sprint 50, AMRIT Sprint 51, AMRIT Sprint 52, AMRIT Sprint 53, Sprint 54
    • Platform
    • UAT

      The application issues JSON Web Tokens (JWTs) that do not expire correctly or have an excessively long expiration time. This can allow an attacker to reuse stolen or leaked tokens for unauthorized access long after they should have expired.

      Vulnerability Name Vulnerable Point, Port or Parameter CVE/CWE CVSS Score Overall Risk
      (Severity)
      Mapping with OWASP Testing Checklist Observation / Description Impact Recommendation Reference Steps to reproduce
      Improper JWT Expiration https://uatamrit.piramalswasthya.org/common-api/cti/getloginkey CWE-613 5.3 Medium OWASP Session Management Testing This means that if an attacker compromises a JWT token—for example via XSS, interception, or leakage—they can reuse it for over 8 hours without interruption. If the user forgets to log out or the token is stolen by malware or a network attacker, the attacker gets persistent access to user data and actions for an extended period, increasing the risk of session hijacking, unauthorized activity, and privilege misuse. JWT tokens valid for 8+ hours severely increase the attack window for replay attacks, session hijacking, and data breaches.
       
      Automated credential and token theft tools can exploit long-validity tokens to maintain unauthorized access throughout a work shift or overnight, bypassing reauthentication controls.
      Reduce access token lifetimes to 15–30 minutes for critical APIs; use refresh token flow for seamless user experience.
       
      Enforce automatic token renewal, idle timeouts, and mandatory logout after risk events (e.g., IP change, privilege escalation).
      https://owasp.org/www-project-web-security-testing-guide/latest/4-Web_Application_Security_Testing/06-Session_Management_Testing/10-Testing_JSON_Web_Tokens Step 1:
      During the security assessment, a random API request was captured and its JWT token was analyzed using JWT tool extensions in Burp Suite. It was found that the token’s expiration (exp) time was set for longer than 8 hours.

        1. image-2025-12-05-11-13-03-710.png
          image-2025-12-05-11-13-03-710.png
          48 kB
        2. image-2025-12-10-10-27-45-039.png
          image-2025-12-10-10-27-45-039.png
          86 kB
        3. image-2025-12-10-10-28-02-252.png
          image-2025-12-10-10-28-02-252.png
          41 kB
        4. image-2025-12-15-21-03-21-207.png
          image-2025-12-15-21-03-21-207.png
          56 kB
        5. image-2025-12-15-21-03-50-111.png
          image-2025-12-15-21-03-50-111.png
          63 kB
        6. image-2025-12-15-21-04-23-630.png
          image-2025-12-15-21-04-23-630.png
          58 kB
        7. image-2026-02-03-15-34-53-304.png
          image-2026-02-03-15-34-53-304.png
          74 kB
        8. image-2026-02-03-15-35-42-591.png
          image-2026-02-03-15-35-42-591.png
          74 kB
        9. image-2026-02-05-11-33-37-712.png
          image-2026-02-05-11-33-37-712.png
          39 kB
        10. image-2026-02-05-11-34-03-496.png
          image-2026-02-05-11-34-03-496.png
          42 kB
        11. inventory-ui.webm
          640 kB
        12. jwt expiry for hwc.webm
          6.26 MB
        13. jwt expiry for hwc-1.webm
          6.26 MB
        14. JWT Token.docx
          457 kB
        15. JWT Token2.docx
          435 kB
        16. JWT Token2-1.docx
          435 kB
        17. Screenshot from 2025-11-12 12-41-01.png
          Screenshot from 2025-11-12 12-41-01.png
          71 kB
        18. Screenshot from 2026-01-13 11-05-20.png
          Screenshot from 2026-01-13 11-05-20.png
          39 kB

              Assignee:
              Deep Shikha
              Reporter:
              Shashank Kharkwal
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: