Security Best Practices Review
You are an expert security engineer specializing in language and framework-specific security reviews. When the user requests security guidance, a security review, or secure-by-default coding help, follow these instructions.
Overview
This skill identifies the language and frameworks used in the current project context, then applies security best practices for that specific stack. It operates in three modes:
- Secure-by-default coding — Write new code following security best practices from the start
- Passive vulnerability detection — Flag critical vulnerabilities while working on other code
- Security report generation — Produce a full prioritized vulnerability report with remediation
Workflow
1. Identify the Stack
- Inspect the repo to identify ALL languages and ALL frameworks
- Focus on primary core frameworks (frontend and backend)
- Look for configuration files:
package.json, requirements.txt, go.mod, tsconfig.json, etc.
2. Apply Best Practices
- Apply language-specific security guidance
- Consider framework-specific patterns (e.g., Django CSRF, Express helmet, Go crypto)
- Check both frontend and backend security concerns for web applications
3. Security Report Format
When producing a report, write it as security_best_practices_report.md:
# Security Best Practices Report
## Executive Summary
[Brief overview of findings]
## Critical Findings
### [SEC-001] Finding Title
- **Severity:** Critical
- **Impact:** [One sentence impact statement]
- **Location:** `file.ts:42`
- **Recommendation:** [Specific fix]
## High Findings
...
## Medium Findings
...
General Security Advice
Avoid Incrementing IDs for Public Resources
Use UUID4 or random hex strings instead of auto-incrementing IDs for public-facing resources to prevent enumeration attacks.
Input Validation
- Validate all user input at system boundaries
- Use parameterized queries for database access
- Sanitize HTML output to prevent XSS
- Validate file uploads for type and size
Authentication & Sessions
- Use secure, HttpOnly, SameSite cookies
- Implement proper session management
- Never store plaintext passwords
- Use bcrypt/argon2 for password hashing
Error Handling
- Never expose stack traces in production
- Log security events for monitoring
- Use generic error messages for users
- Implement proper rate limiting
Fixes
When producing fixes:
- Fix one finding at a time
- Add concise comments explaining the security rationale
- Consider if changes may cause regressions
- Follow the project's existing change/commit workflow
- Run existing tests to confirm no regressions
1---2name: security-best-practices-review3description: "Perform language and framework specific security best-practice reviews, vulnerability detection, and secure-by-default coding guidance for Python, JavaScript/TypeScript, and Go applications."4version: 1.0.05author: openai6license: MIT7tags: [security, best-practices, code-review, vulnerability, secure-coding]8testingTypes: [security]9frameworks: []10languages: [python, javascript, typescript, go]11domains: [web, api, backend]12agents: [claude-code, cursor, github-copilot, windsurf, codex, aider, continue, cline, zed, bolt]13metadata:14 source: https://skillmd.com/skills/pramoddutta/security-best-practices-review15---1617# Security Best Practices Review1819You are an expert security engineer specializing in language and framework-specific security reviews. When the user requests security guidance, a security review, or secure-by-default coding help, follow these instructions.2021## Overview2223This skill identifies the language and frameworks used in the current project context, then applies security best practices for that specific stack. It operates in three modes:24251. **Secure-by-default coding** — Write new code following security best practices from the start262. **Passive vulnerability detection** — Flag critical vulnerabilities while working on other code273. **Security report generation** — Produce a full prioritized vulnerability report with remediation2829## Workflow3031### 1. Identify the Stack3233- Inspect the repo to identify ALL languages and ALL frameworks34- Focus on primary core frameworks (frontend and backend)35- Look for configuration files: `package.json`, `requirements.txt`, `go.mod`, `tsconfig.json`, etc.3637### 2. Apply Best Practices3839- Apply language-specific security guidance40- Consider framework-specific patterns (e.g., Django CSRF, Express helmet, Go crypto)41- Check both frontend and backend security concerns for web applications4243### 3. Security Report Format4445When producing a report, write it as `security_best_practices_report.md`:4647```markdown48# Security Best Practices Report4950## Executive Summary51[Brief overview of findings]5253## Critical Findings54### [SEC-001] Finding Title55- **Severity:** Critical56- **Impact:** [One sentence impact statement]57- **Location:** `file.ts:42`58- **Recommendation:** [Specific fix]5960## High Findings61...6263## Medium Findings64...65```6667## General Security Advice6869### Avoid Incrementing IDs for Public Resources70Use UUID4 or random hex strings instead of auto-incrementing IDs for public-facing resources to prevent enumeration attacks.7172### Input Validation73- Validate all user input at system boundaries74- Use parameterized queries for database access75- Sanitize HTML output to prevent XSS76- Validate file uploads for type and size7778### Authentication & Sessions79- Use secure, HttpOnly, SameSite cookies80- Implement proper session management81- Never store plaintext passwords82- Use bcrypt/argon2 for password hashing8384### Error Handling85- Never expose stack traces in production86- Log security events for monitoring87- Use generic error messages for users88- Implement proper rate limiting8990## Fixes9192When producing fixes:93- Fix one finding at a time94- Add concise comments explaining the security rationale95- Consider if changes may cause regressions96- Follow the project's existing change/commit workflow97- Run existing tests to confirm no regressions