Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Implements authentication, authorization, encryption, secrets management, CORS, rate limiting, and password hashing patterns.
59% 86%+27 ptsof test cases passed
Passed 19 of 22 test cases with the skill, and 13 of 22 without it.
In our blog service, an editor endpoint currently validates that req.user.role is editor and then executes db.post.update using req.body directly. Identify the authorization flaw and mass assignment vulnerability, and provide the corrected Express route code.
Validates request payload using schema parsing before updating database fields.
3 of 3 safety checks passed
Copy this checklist and track progress:
Security Implementation Progress:
- [ ] Step 1: Choose authentication strategy
- [ ] Step 2: Implement authorization model
- [ ] Step 3: Set up password hashing
- [ ] Step 4: Configure secrets management
- [ ] Step 5: Enable encryption (transit + rest)
- [ ] Step 6: Configure CORS
- [ ] Step 7: Add rate limiting
- [ ] Step 8: Validate against anti-patterns checklist
import jwt from "jsonwebtoken";
function generateTokens(user: User) {
const accessToken = jwt.sign(
{ sub: user.id, role: user.role },
process.env.JWT_SECRET!,
{ expiresIn: "15m", algorithm: "HS256" },
);
const refreshToken = jwt.sign(
{ sub: user.id, tokenVersion: user.tokenVersion },
process.env.JWT_REFRESH_SECRET!,
{ expiresIn: "7d" },
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.