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

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

                Created:
                Updated:
                Resolved: