Secure code review

From Hack23/European-Parliament-MCP-Server · View interactive version

Secure code review is an AI agent skill from the GitHub repository Hack23/European-Parliament-MCP-Server. Security code review using OWASP Top 10, input validation, and Hack23 ISMS secure development policy for TypeScript/MCP

How to use this skill

Skill file

Secure Code Review Skill

Purpose

Conduct thorough security code reviews for TypeScript MCP server code, identifying vulnerabilities before production.

When to Use

Security Review Checklist

Input Validation (OWASP A03 - Injection)

// ✅ SECURE: Zod schema validation
import { z } from 'zod';
const InputSchema = z.object({
  id: z.number().int().positive(),
  name: z.string().min(1).max(255),
  country: z.string().length(2)
});

// ❌ INSECURE: No validation
function getUser(id: any) { return db.query(`SELECT * FROM users WHERE id = ${id}`); }

API Security (OWASP A01 - Broken Access Control)

Dependency Security (OWASP A06 - Vulnerable Components)

npm audit --audit-level=high
npx knip                    # Find unused dependencies
npm run test:licenses       # Check license compliance

Error Handling

// ✅ SECURE: Generic error messages
catch (error) {
  logger.error('Internal error details', { error });
  return { error: 'An unexpected error occurred' };
}

// ❌ INSECURE: Leaking internals
catch (error) {
  return { error: error.stack }; // Never expose stack traces
}

Review Exit Criteria

ISMS Policy References

Core SDLC policies (authoritative — always cite the applicable ones in review comments):

Supporting policies (cite when applicable):

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.