# Vibe Security > Audita código en busca de vulnerabilidades comunes que los asistentes de IA introducen en apps 'vibe-coded': claves expuestas, RLS roto, fallos de auth, pagos inseguros y más. Fuente: https://skillsagentes.com/skills/raroque/vibe-security-skill/vibe-security Markdown: https://skillsagentes.com/skills/raroque/vibe-security-skill/vibe-security.md Repositorio: https://github.com/raroque/vibe-security-skill Autor: raroque Licencia: MIT Actualizado: hace 8 meses Coste de contexto: 179 tok instalada, 1.8k tok al activarse, 8.2k tok con todos los archivos del bundle Bundle: 11 archivos, 32 KB Permisos que pide: ninguno declarado ## Instalación Un skill son archivos markdown: los mismos archivos valen para cualquier agente y lo único que cambia es el directorio de destino, es decir la bandera `--agent`. Añade `-g` para instalarlo en todos los proyectos de la máquina. ```bash # Claude Code npx -y skills add raroque/vibe-security-skill --skill vibe-security --agent claude-code # Cursor npx -y skills add raroque/vibe-security-skill --skill vibe-security --agent cursor # Codex npx -y skills add raroque/vibe-security-skill --skill vibe-security --agent codex # Gemini CLI npx -y skills add raroque/vibe-security-skill --skill vibe-security --agent gemini # Windsurf npx -y skills add raroque/vibe-security-skill --skill vibe-security --agent windsurf # Cline npx -y skills add raroque/vibe-security-skill --skill vibe-security --agent cline ``` ## Qué hace - Audita el código en busca de secretos expuestos, RLS/reglas de base de datos mal configuradas, fallos de autenticación y otros fallos de seguridad típicos de apps generadas con IA - Revisa rate limiting, pagos, seguridad móvil, integración con LLMs, configuración de despliegue y validación de entradas - Organiza los hallazgos por severidad (Crítico, Alto, Medio, Bajo) con archivo, línea, impacto y fix antes/después - Consulta archivos de referencia específicos según la tecnología detectada en el proyecto - Aplica las mismas reglas de forma proactiva al generar código nuevo que toque auth, pagos o datos de usuario ## Cuándo usarla - El usuario pregunta por seguridad, pide una revisión de código o menciona 'vibe coding' - Estás escribiendo o revisando código que maneja autenticación, pagos, acceso a base de datos, claves de API o datos de usuario - El usuario dice cosas como '¿esto es seguro?', 'revisa mi código', 'audita esto' o '¿pueden hackear esto?' ## Qué la activa - "¿Es seguro este código?" - "Audita este proyecto en busca de vulnerabilidades" - "Revisa si alguien podría hackear esta app" - "¿Hay claves de API expuestas en mi repositorio?" ## Antes de instalar - Variables de entorno: NEXT_PUBLIC_SUPABASE_ANON_KEY, NEXT_PUBLIC_SUPABASE_SERVICE_KEY - needs API credentials ## Archivos - SKILL.md — 7 KB - agents/openai.yaml — 274 B - references/ai-integration.md — 2 KB - references/authentication.md — 3 KB - references/data-access.md — 3 KB - references/database-security.md — 5 KB - references/deployment.md — 2 KB - references/mobile.md — 2 KB - references/payments.md — 2 KB - references/rate-limiting.md — 2 KB - references/secrets-and-env.md — 2 KB ## SKILL.md Reproducido tal cual desde raroque/vibe-security-skill bajo MIT. Esta sección es el documento original y está en inglés. Audit code for security vulnerabilities commonly introduced by AI code generation. These issues are prevalent in "vibe-coded" apps — projects built rapidly with AI assistance where security fundamentals get skipped. AI assistants consistently get these patterns wrong, leading to real breaches, stolen API keys, and drained billing accounts. This skill exists to catch those mistakes before they ship. ## The Core Principle Never trust the client. Every price, user ID, role, subscription status, feature flag, and rate limit counter must be validated or enforced server-side. If it exists only in the browser, mobile bundle, or request body, an attacker controls it. ## Audit Process Examine the codebase systematically. For each step, load the relevant reference file only if the codebase uses that technology or pattern. Skip steps that aren't relevant. 1. **Secrets & Environment Variables** — Scan for hardcoded API keys, tokens, or credentials. Check for secrets exposed via client-side env var prefixes (`NEXT_PUBLIC_`, `VITE_`, `EXPO_PUBLIC_`). Verify `.env` is in `.gitignore`. See `references/secrets-and-env.md`. 2. **Database Access Control** — Check Supabase RLS policies, Firebase Security Rules, or Convex auth guards. This is the #1 source of critical vulnerabilities in vibe-coded apps. See `references/database-security.md`. 3. **Authentication & Authorization** — Validate JWT handling, middleware auth, Server Action protection, and session management. See `references/authentication.md`. 4. **Rate Limiting & Abuse Prevention** — Ensure auth endpoints, AI calls, and expensive operations have rate limits. Verify rate limit counters can't be tampered with. See `references/rate-limiting.md`. 5. **Payment Security** — Check for client-side price manipulation, webhook signature verification, and subscription status validation. See `references/payments.md`. 6. **Mobile Security** — Verify secure token storage, API key protection via backend proxy, and deep link validation. See `references/mobile.md`. 7. **AI / LLM Integration** — Check for exposed AI API keys, missing usage caps, prompt injection vectors, and unsafe output rendering. See `references/ai-integration.md`. 8. **Deployment Configuration** — Verify production settings, security headers, source map exposure, and environment separation. See `references/deployment.md`. 9. **Data Access & Input Validation** — Check for SQL injection, ORM misuse, and missing input validation. See `references/data-access.md`. If doing a partial review or generating code in a specific area, load only the relevant reference files. ## Core Instructions - Report only genuine security issues. Do not nitpick style or non-security concerns. - When multiple issues exist, prioritize by exploitability and real-world impact. - If the codebase doesn't use a particular technology (e.g., no Supabase), skip that section entirely. - When generating new code, consult the relevant reference files proactively to avoid introducing vulnerabilities in the first place. - If you find a critical issue (exposed secrets, disabled RLS, auth bypass), flag it immediately at the top of your response — don't bury it in a long list. ## Output Format Organize findings by severity: **Critical** → **High** → **Medium** → **Low**. For each issue: 1. State the file and relevant line(s). 2. Name the vulnerability. 3. Explain what an attacker could do (concrete impact, not abstract risk). 4. Show a before/after code fix. Skip areas with no issues. End with a prioritized summary. ### Example Output #### Critical **`lib/supabase.ts:3` — Supabase `service_role` key exposed in client bundle** The `service_role` key bypasses all Row-Level Security. Anyone can extract it from the browser bundle and read, modify, or delete every row in your database. ```typescript // Before const supabase = createClient(url, process.env.NEXT_PUBLIC_SUPABASE_SERVICE_KEY!) // After — use the anon key client-side; service_role belongs only in server-side code const supabase = createClient(url, process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!) ``` #### High **`app/api/checkout/route.ts:15` — Price taken from client request body** An attacker can set any price (including $0.01) by modifying the request. Prices must be looked up server-side. ```typescript // Before const session = await stripe.checkout.sessions.create({ line_items: [{ price_data: { unit_amount: req.body.price } }] }) // After — look up the price server-side const product = await db.products.findUnique({ where: { id: req.body.productId } }) const session = await stripe.checkout.sessions.create({ line_items: [{ price: product.stripePriceId }] }) ``` ### Summary 1. **Service role key exposed (Critical):** Anyone can bypass all database security. Rotate the key immediately and move it to server-side only. 2. **Client-controlled pricing (High):** Attackers can purchase at any price. Use server-side price lookup. ## When Generating Code These rules also apply proactively. Before writing code that touches auth, payments, database access, API keys, or user data, consult the relevant reference file to avoid introducing the vulnerability in the first place. Prevention is better than detection. ## References - `references/secrets-and-env.md` — API keys, tokens, environment variable configuration, and `.gitignore` rules. - `references/database-security.md` — Supabase RLS, Firebase Security Rules, and Convex auth patterns. - `references/authentication.md` — JWT verification, middleware, Server Actions, and session management. - `references/rate-limiting.md` — Rate limiting strategies and abuse prevention. - `references/payments.md` — Stripe security, webhook verification, and price validation. - `references/mobile.md` — React Native and Expo security: secure storage, API proxy, deep links. - `references/ai-integration.md` — LLM API key protection, usage caps, prompt injection, and output sanitization. - `references/deployment.md` — Production configuration, security headers, and environment separation. - `references/data-access.md` — SQL injection prevention, ORM safety, and input validation. ## Dónde encaja - Categoría: [Seguridad](https://skillsagentes.com/categorias/seguridad.md) — Auditorías, revisión de dependencias, manejo de secretos y modelado de amenazas. - Creador: [raroque](https://skillsagentes.com/creators/raroque.md) — 1 skills en el directorio - [Todas las skills](https://skillsagentes.com/skills.md) - [Ranking de instalaciones](https://skillsagentes.com/ranking.md) ## Skills relacionadas - [Careful](https://skillsagentes.com/skills/garrytan/gstack/careful.md): Barreras de seguridad para comandos destructivos (gstack). - [Cso](https://skillsagentes.com/skills/garrytan/gstack/cso.md): Modo Chief Security Officer: auditoría de seguridad centrada en infraestructura, con OWASP Top 10, modelado de amenazas STRIDE y verificación activa. - [Guard](https://skillsagentes.com/skills/garrytan/gstack/guard.md): Modo de máxima seguridad: avisos ante comandos destructivos más restricción de ediciones a un directorio concreto (gstack). - [Security And Hardening](https://skillsagentes.com/skills/addyosmani/agent-skills/security-and-hardening.md): Refuerza el código frente a vulnerabilidades: entradas de usuario, autenticación, almacenamiento de datos, integraciones externas, el OWASP Top Ten, auditoría de dependencias y cumplimiento de privacidad (GDPR, CCPA). - [Security Audit](https://skillsagentes.com/skills/cloudflare/security-audit-skill/security-audit.md): Orientación de seguridad y revisión de vulnerabilidades para código, APIs, servicios, CLI y daemons; úsalo para preguntas de seguridad, revisiones focalizadas o auditorías completas. --- Skills Agentes · [Índice de páginas en markdown](https://skillsagentes.com/sitemap.md) · [Inicio](https://skillsagentes.com/index.md)