- Backend: FastAPI app with all models, services, schemas, routes - Admin Panel: Next.js dashboard with all modules (CRM, POS, repairs, warranties, billing, notifications, etc.) - Ecommerce: storefront (submodule) + product catalog - AI Agents: .agents/ skill library for Antigravity IDE - Docs: architecture, billing, notification gateway markdown - Submodules: Backend/OpenWA, Ecommerce/File 2/storefront
36 lines
1.4 KiB
Markdown
36 lines
1.4 KiB
Markdown
---
|
|
name: "Security Review"
|
|
description: "Review a Node.js TypeScript change or module for security and privacy risks"
|
|
---
|
|
|
|
# Skill: Security Review
|
|
|
|
## 1. Purpose
|
|
Audit the implementation for typical vulnerabilities: injection flaws, unauthenticated endpoints, XSS, and data privacy leaks.
|
|
|
|
## 2. When to Use
|
|
When writing code that handles user input, writes to databases, processes payments, or accesses files.
|
|
|
|
## 3. Preconditions
|
|
* Source code logic is complete and compiles successfully.
|
|
* Zod/Pydantic validation schemas are declared.
|
|
|
|
## 4. Step-by-Step Checklist
|
|
1. Scan endpoints to verify they require valid authentication headers (JWT verification).
|
|
2. Audit raw database statements to prevent SQL injections.
|
|
3. Check inputs for HTML sanitization to block Cross-Site Scripting (XSS).
|
|
4. Ensure compliance with DPDP act requirements (consent parameters, database encryption).
|
|
5. Review file uploads for path traversal controls.
|
|
|
|
## 5. Validation Checklist
|
|
* No dynamic input is passed directly to database executors without escaping.
|
|
* Endpoints require correct authorization clearances.
|
|
|
|
## 6. Examples
|
|
```python
|
|
# Vulnerable: db.execute(f"SELECT * FROM users WHERE id = '{user_input}'")
|
|
# Secure: db.execute("SELECT * FROM users WHERE id = :id", {"id": user_input})
|
|
```
|
|
|
|
## 7. Failure Cases
|
|
* Blindly trust inputs received from third-party webhooks without verifying token signatures.
|