accelint-security-best-practices
Comprehensive security audit and vulnerability detection for JavaScript/TypeScript applications following OWASP Top 10. Use when (1) Users say 'audit security', 'check for vulnerabilities', 'security review', 'implement authentication', 'secure this code', (2) Adding authentication, API endpoints, file uploads, or handling user input, (3) Working with secrets, credentials, or sensitive data, (4) Implementing payment features or blockchain integrations, (5) Conducting pre-deployment security checks. Audits for: hardcoded secrets, injection vulnerabilities, XSS/CSRF, broken access control, insecure authentication, rate limiting, dependency vulnerabilities, sensitive data exposure.
What this skill does
# Security Best Practices Systematic security auditing and vulnerability detection for JavaScript/TypeScript applications. Combines audit workflow with OWASP Top 10 security patterns for production-ready code. **Framework-Agnostic Guidance**: This skill provides security principles applicable across frameworks (Express, Fastify, Nest.js, Next.js, etc.). Code examples illustrate concepts using common patterns—adapt them to your project's specific framework and package manager (npm, yarn, pnpm, bun). ## NEVER Do When Implementing Security **Note:** For general best practices (type safety, code quality, documentation), use the respective accelint skills. This section focuses exclusively on security-specific anti-patterns. - **NEVER hardcode secrets** - API keys, tokens, passwords, or credentials in source code are immediately compromised when pushed to version control. Even private repositories leak secrets through employee turnover, third-party access, and git history. In 2024 breach analysis, 47% of exposed credentials came from `.env` files accidentally committed then 'deleted' (but preserved in git history). Attackers scan public GitHub commits within minutes of push. Use environment variables exclusively. - **NEVER trust user input** - Validate with schemas (Zod, Joi) covering type, format, size, and content. - **NEVER concatenate user input into queries** - Use parameterized queries, ORMs, or prepared statements exclusively. String concatenation in SQL, NoSQL, or shell commands enables injection attacks. - **NEVER store sensitive data in localStorage** - localStorage is vulnerable to XSS attacks where malicious scripts steal tokens. JWT tokens, session IDs, or credentials in localStorage persist across sessions and are accessible to any JavaScript code. Use httpOnly cookies for auth tokens. - **NEVER skip authorization checks** - Authentication verifies identity; authorization verifies permission. Attackers will manipulate IDs, skip authentication, or guess URLs. Every endpoint accessing resources must verify the requesting user owns that resource or has appropriate role. - **NEVER expose detailed errors to users** - Log server-side, return generic messages. Stack traces leak architecture for reconnaissance. - **NEVER use Array.includes() for permission checks** - Permission arrays with 100+ roles suffer O(n) lookup time and type safety issues. Use `Set.has()` for O(1) lookup or role-based access control (RBAC) with proper type checking. - **NEVER skip rate limiting on APIs** - Unlimited API requests enable brute force attacks (1000 password attempts/second), denial of service (exhaust server resources), or data scraping (enumerate all users/resources). Apply rate limits to all endpoints, with stricter limits on authentication and expensive operations. - **NEVER log sensitive data** - Passwords, tokens, credit cards, or personal information in logs persist in log aggregation systems, backups, and third-party services. Logs are accessible to more people than the application itself. Redact sensitive fields before logging. - **NEVER use default configurations in production** - Default secrets, disabled security headers, permissive CORS, or development modes in production create known vulnerabilities. Attackers scan for defaults. Harden all configurations for production environments. ## Before Implementing Security, Ask Apply these tests to ensure comprehensive security coverage: ### Threat Assessment - **What's the attack surface?** Identify all points where user input enters the system (forms, APIs, file uploads, URLs) - **What's the worst-case scenario?** Consider data breaches, unauthorized access, service disruption, or financial loss - **Who are the attackers?** Script kiddies exploit known vulnerabilities; sophisticated attackers chain multiple weaknesses ### Compliance Verification - **Do I have authentication on all protected routes?** Public APIs may be intentional, but verify each endpoint's access policy - **Are authorization checks before operations?** Verify ownership/permissions before reading, writing, or deleting resources - **Is all user input validated?** Check type, format, size, and content with schemas before processing ### Defense in Depth - **Is there a single point of failure?** Layer defenses so one bypass doesn't compromise entire system - **Are errors handled gracefully?** Unhandled errors leak information; proper handling maintains security posture - **Is logging sufficient for audit trails?** Security events (login attempts, access denials, suspicious patterns) must be logged for incident response ## How to Use This skill uses **progressive disclosure** to minimize context usage: ### 1. Start with the Workflow (SKILL.md) Follow the 4-phase audit workflow below for systematic security analysis. ### 2. Reference Security Rules Overview (AGENTS.md) Load [AGENTS.md](AGENTS.md) to scan compressed security rule summaries organized by category. ### 3. Load Specific Security Patterns as Needed When you identify specific security issues, load corresponding reference files for detailed ❌/✅ examples. ### 4. Use the Report Template When this skill is invoked, use the standardized report format: **Template:** [`assets/output-report-template.md`](assets/output-report-template.md) ## Security Audit Workflow **Two modes of operation:** 1. **Audit Mode** - Skill invoked directly (`/accelint-security-best-practices <path>`) or user explicitly requests security audit - Generate a structured audit report using the template (Phases 1-2 only) - Report findings for user review before implementation - User decides which security fixes to apply 2. **Implementation Mode** - Skill triggers automatically during feature work - Identify and apply security fixes directly (all 4 phases) - No formal report needed - Focus on fixing vulnerabilities inline **Copy this checklist to track progress:** ``` - [ ] Phase 1: Discover - Identify security vulnerabilities through systematic code analysis - [ ] Phase 2: Categorize - Classify issues by OWASP category and severity - [ ] Phase 3: Remediate - Apply security patterns from references/ - [ ] Phase 4: Verify - Validate fixes and confirm vulnerability closure ``` ### Phase 1: Discover Security Vulnerabilities **CRITICAL: Audit ALL code for security vulnerabilities.** Do not skip code based on assumptions about exposure. Internal utilities, helpers, and data transformations are frequently exposed through APIs, file uploads, or user interactions even if their implementation appears isolated. **Perform systematic static code analysis to identify ALL security anti-patterns:** - Hardcoded secrets (API keys, passwords, tokens) - Missing input validation (user data, file uploads, API responses) - Injection vulnerabilities (SQL, NoSQL, Command, XSS) - Broken access control (missing auth, no ownership checks, IDOR) - Insecure authentication (tokens in localStorage, weak session management) - Missing rate limiting (auth endpoints, expensive operations) - Sensitive data exposure (logs, error messages, client responses) - Security misconfiguration (default configs, missing headers, permissive CORS) - Vulnerable dependencies (outdated packages, known CVEs) - Missing CSRF protection (state-changing operations) - SSRF vulnerabilities (unvalidated URL fetching) **Output**: Complete list of ALL identified vulnerabilities with their locations, severity, and OWASP category. Do not filter based on "likelihood" - report everything found. ### Phase 2: Categorize and Assess Risk For EVERY vulnerability identified in Phase 1, categorize by OWASP category and severity: **Categorize ALL vulnerabilities by OWASP Top 10 category:** | OWASP Category | Common Issues | Severity Range | |----------------|---------------|----------------| | A01: Broken Access Control | Missing auth, no ownership checks, IDOR | Critical-High | | A02: Cryptographic Failures | Hardcoded secrets, weak ha
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.