high · M3 · MASVS-AUTH-1 · PTKD-API-WEAK-JWT

    Weak JWT observed on the wire

    A JSON Web Token seen in traffic used alg=none (unsigned, trivially forgeable) or carried no expiry, weakening session security.

    How it is exploited

    A JSON Web Token seen in traffic used alg=none (unsigned) or carried no expiry. An unsigned token can be rewritten to impersonate any user; a token without exp stays valid forever once stolen.

    Why it matters

    Authentication bypass or indefinite session hijacking, depending on which weakness is present.

    How to fix it

    1. Reject alg=none server-side and sign tokens with a strong algorithm (for example, RS256 or ES256).
    2. Always set a short exp and validate signature and expiry on every request.

    Does your app have this?

    PTKD checks your build or your source project for PTKD-API-WEAK-JWT and every other check in this knowledge base.

    Scan your app

    References

    Related checks (M3)