๐Ÿฏ ๐—•๐—ฟ๐—ผ๐—ธ๐—ฒ๐—ป ๐—”๐˜‚๐˜๐—ต ๐—ฃ๐—ฎ๐˜๐˜๐—ฒ๐—ฟ๐—ป๐˜€ ๐—–๐˜‚๐—ฟ๐˜€๐—ผ๐—ฟ ๐—ช๐—ฟ๐—ถ๐˜๐—ฒ๐˜€ ๐—œ๐—ป๐˜๐—ผ ๐—ฌ๐—ผ๐˜‚๐—ฟ ๐—”๐—ฃ๐—œ

AI tools write bad code. I saw a project using jwt.decode instead of jwt.verify. The developer used Cursor. This is a common pattern.

jwt.decode does not check the signature. It does not check expiration. Your API accepts any token. An attacker changes their user ID to admin. Your app lets them in.

AI tools make other mistakes too:

This happens when you ask the AI to stop errors. The AI removes security to make the code run.

Fix your auth:

Catch these errors early. Use tools like SafeWeave, semgrep, or gitleaks.

Source: https://dev.to/chandan_karn_fb750e731394/3-broken-auth-patterns-cursor-keeps-writing-into-your-api-119o