security-patterns

Apply security patterns to prevent common PHP vulnerabilities across frameworks.

2|Updated Oct 19, 2025
One-click install
npx skills add https://github.com/masanao-ohba/claude-manifests --skill security-patterns-masanao-ohba
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: security-patterns
Source: https://github.com/masanao-ohba/claude-manifests/tree/main/skills/php/security-patterns
Command: npx skills add https://github.com/masanao-ohba/claude-manifests --skill security-patterns-masanao-ohba

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PHP applications often suffer from security vulnerabilities due to inconsistent coding practices. This Skill consolidates widely accepted patterns into a single reference to prevent common issues.

Core Features & Use Cases

  • Input validation and data sanitization to prevent invalid or malicious user input.
  • Secure database access with prepared statements and proper output escaping to prevent SQL injection and XSS.
  • Authentication, password hashing, CSRF protection, and secure session handling to defend user accounts and sessions.
  • Framework-agnostic guidance that applies to CakePHP, Laravel, and Symfony projects.

Quick Start

Review and apply these security patterns to your PHP project. Start by replacing unsafe code with parameterized queries, enabling password_hash-based authentication, and implementing CSRF tokens.

Frequently Asked Questions about security-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent SQL injection and XSS in PHP applications?

Prevent SQL injection and XSS in PHP by replacing unsafe code with prepared statements for database access and applying proper output escaping for user input. This Skill provides code examples for both security patterns to protect your application.

What's the best way to implement CSRF tokens and password hashing in PHP?

Implement CSRF tokens and password hashing in PHP by enabling password_hash-based authentication and integrating CSRF protection mechanisms. This Skill consolidates these security patterns into a single reference for defending user accounts and sessions.

Does this PHP security guidance work with Laravel, Symfony, and CakePHP?

Yes, this PHP security guidance works with Laravel, Symfony, and CakePHP. It provides framework-agnostic guidance that applies to any PHP project across these frameworks for preventing common vulnerabilities during development and code reviews.

How do I validate user input and sanitize data to prevent malicious PHP attacks?

Validate user input and sanitize data in PHP by applying input validation patterns that reject invalid or malicious user input. This Skill codifies these requirements and provides code examples to secure your application during development.

What patterns should I use for secure session handling and safe file uploads in PHP?

Use secure session configuration and safe file upload patterns to protect your PHP application. This Skill codifies these security patterns alongside path traversal prevention and error handling to ensure comprehensive vulnerability protection.