smithery/valec3

backend-security-best-practices

SQL injection prevention, XSS, CSRF, validation.

Installation

$ npx skills add smithery/valec3 --skill backend-security-best-practices

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/valec3 · top by installs.

npx skills add smithery/valec3

Browse all from smithery/valec3

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,314 B
  • docs SUMMARY.md 87 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

Backend Security Best Practices

When to use this skill

  • All application development
  • Security reviews
  • Penetration testing prep
  • Compliance requirements

Workflow

  • Validate all input
  • Use prepared statements
  • Escape output
  • Enable CSRF protection
  • Use HTTPS

Instructions

SQL Injection Prevention

<?php

// ❌ Bad
$sql = "SELECT * FROM users WHERE email = '{$email}'";

// ✅ Good: Query builder
$this->db->table('users')->where('email', $email)->get();

// ✅ Good: Prepared statement
$this->db->query("SELECT * FROM users WHERE email = ?", [$email]);

XSS Prevention

<?php

// In views
<?= esc($user->name) ?> // HTML escape
<?= esc($user->bio, 'js') ?> // JavaScript escape

CSRF Protection

<?php

// Config/Security.php
public $csrfProtection = 'session';

// In forms
<?= csrf_field() ?>

// In AJAX
headers: {
    'X-CSRF-TOKEN': '<?= csrf_hash() ?>'
}

Environment Variables

<?php

// ❌ Bad
$apiKey = 'hardcoded-key';

// ✅ Good
$apiKey = env('API_KEY');

Resources

  • Validate and sanitize all input
  • Never trust user data
  • Use framework security features
  • Keep dependencies updated