security-audit

Reviews code for vulnerabilities and enforces secure coding practices in Python applications.

Updated Sep 2, 2026
One-click install
npx skills add https://github.com/Dazlarus/karl-code --skill security-audit-dazlarus
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: security-audit
Source: https://github.com/Dazlarus/karl-code/tree/main/.agents/skills/security-audit
Command: npx skills add https://github.com/Dazlarus/karl-code --skill security-audit-dazlarus

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Codebases often ship with preventable vulnerabilities like SQL injection, hardcoded secrets, weak password hashing, and missing input validation. This Skill provides a structured security review framework that catches these issues before they reach production. ## Core Features & Use Cases - Vulnerability Detection: Identifies injection attacks, path traversal, hardcoded secrets, weak cryptography, and missing authentication checks with concrete bad/good code examples. - Security Audit Checklist: Provides a 12-point checklist covering parameterized queries, input validation, HTTPS enforcement, security headers, rate limiting, and dependency auditing. - Structured Review Output: Formats findings as Critical Issues, High Priority items, and Positive Patterns with line-specific fixes. - Use Case: Before merging a pull request that adds a new API endpoint handling user uploads, run a security audit to verify input validation, path sanitization, and proper authentication decorators are in place. ## Quick Start Review the authentication and file upload modules in this project for security vulnerabilities and list any critical issues with fixes.

Frequently Asked Questions about security-audit

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

FAQPage Schema
How do I prevent SQL injection in Python?

Use parameterized queries instead of string formatting in SQL statements. Pass user values as separate parameters, for example conn.execute("SELECT * FROM users WHERE id = $1", (user_id,)), so the database driver handles escaping safely.

What is the best way to hash passwords in Python?

Use bcrypt or argon2 for password hashing, never MD5 or SHA1. The bcrypt library generates a salt automatically with gensalt() and verifies passwords with checkpw(), while passlib's CryptContext supports multiple algorithms with automatic deprecation handling.

How do I check Python dependencies for security vulnerabilities?

Run pip-audit or the safety tool to scan installed packages against known vulnerability databases. Both tools report affected package versions and can be integrated into CI pipelines to catch vulnerable dependencies before deployment.

How do I prevent path traversal attacks in file handling?

Resolve the full path and verify it stays within the intended base directory before reading. Reject filenames containing path separators, or use Path.resolve() and confirm the result starts with the allowed base directory path.

When should a security audit not be applied to code?

Skip the audit for purely internal code with no external interaction and for non-security refactoring that introduces no new risks. The review focuses on code handling user input, secrets, authentication, or external systems.