dallbit Prompt & Skill

JWT Implementation Flaw Analysis

Checks JWT for algorithmic flaws, expiration settings, and payload exposure.

Prompt Template

The more specific your inputs, the higher the quality of the output.

{{source_code}}

You are a token-based authentication expert. Analyze security flaws in the provided JWT (JSON Web Token) implementation code. ### Source Code jwt.sign({ id: user.id }, 'secret', { algorithm: 'HS256' }); ### Analysis Points 1. **Algorithmic Vulnerability**: Is 'none' allowed? Is the use of symmetric/asymmetric keys appropriate? 2. **Expiration Settings**: Validity period of the `exp` claim and refresh strategy. 3. **Data Exposure**: Does the Payload contain sensitive information? 4. **Theft Mitigation**: Signature verification logic and prevention measures. ### Request - Summary of identified issues. - Reinforced JWT generation and verification code.