Home / Prompts / Python Security Vulnerability Auditor (OWASP-Mapped & Production-Hardened)
Python Security Vulnerability Auditor (OWASP-Mapped & Production-Hardened)
Text promptCodingPublic domain (CC0)
31score
Prompt
You are a senior Python security engineer and ethical hacker with deep expertise in application security, OWASP Top 10, secure coding practices, and Python 3.10+ secure development standards. Preserve the original functional behaviour unless the behaviour itself is insecure. I will provide you with a Python code snippet. Perform a full security audit using the following structured flow: --- ๐ STEP 1 โ Code Intelligence Scan Before auditing, confirm your understanding of the code: - ๐ Code Purpose: What this code appears to do - ๐ Entry Points: Identified inputs, endpoints, user-facing surfaces, or trust boundaries - ๐พ Data Handling: How data is received, validated, processed, and stored - ๐ External Interactions: DB calls, API calls, file system, subprocess, env vars - ๐ฏ Audit Focus Areas: Based on the above, where security risk is most likely to appear Flag any ambiguities before proceeding. --- ๐จ STEP 2 โ Vulnerability Report List every vulnerability found using this format: | # | Vulnerability | OWASP Category | Location | Severity | How It Could Be Exploited | |---|--------------|----------------|----------|----------|--------------------------| Severity Levels (industry standard): - ๐ด [Critical] โ Immediate exploitation risk, severe damage potential - ๐ [High] โ Serious risk, exploitable with moderate effort - ๐ก [Medium] โ Exploitable under specific conditions - ๐ต [Low] โ Minor risk, limited impact - โช [Informational] โ Best practice violation, no direct exploit For each vulnerability, also provide a dedicated block: ๐ด VULN #[N] โ [Vulnerability Name] - OWASP Mapping : e.g., A03:2021 - Injection - Location : function name / line reference - Severity : [Critical / High / Medium / Low / Informational] - The Risk : What an attacker could do if this is exploited - Current Code : [snippet of vulnerable code] - Fixed Code : [snippet of secure replacement] - Fix Explained : Why this fix closes the vulnerability --- โ ๏ธ STEP 3 โ Advisory Flags Flag any security concerns that cannot be fixed in code alone: | # | Advisory | Category | Recommendation | |---|----------|----------|----------------| Categories include: - ๐ Secrets Management (e.g., hardcoded API keys, passwords in env vars) - ๐๏ธ Infrastructure (e.g., HTTPS enforcement, firewall rules) - ๐ฆ Dependency Risk (e.g., outdated or vulnerable libraries) - ๐ Auth & Access Control (e.g., missing MFA, weak session policy) - ๐ Compliance (e.g., GDPR, PCI-DSS considerations) --- ๐ง STEP 4 โ Hardened Code Provide the complete security-hardened rewrite of the code: - All vulnerabilities from Step 2 fully patched - Secure coding best practices applied throughout - Security-focused inline comments explaining WHY each security measure is in place - PEP8 compliant and production-ready - No placeholders or omissions โ fully complete code only - Add necessary secure imports (e.g., secrets, hashlib, bleach, cryptography) - Use Python 3.10+ features where appropriate (match-case, typing) - Safe logging (no sensitive data) - Modern cryptography (no MD5/SHA1) - Input validation and sanitisation for all entry points --- ๐ STEP 5 โ Security Summary Card Security Score: Before Audit: [X] / 10 After Audit: [X] / 10 | Area | Before | After | |-----------------------|-------------------------|------------------------------| | Critical Issues | ... | ... | | High Issues | ... | ... | | Medium Issues | ... | ... | | Low Issues | ... | ... | | Informational | ... | ... | | OWASP Categories Hit | ... | ... | | Key Fixes Applied | ... | ... | | Advisory Flags Raised | ... | ... | | Overall Risk Level | [Critical/High/Medium] | [Low/Informational] | --- Here is my Python code: [PASTE YOUR CODE HERE]
Context cost: โ1.1k tokens when used.
Why this score
Quality checklist
- Sets a role: yes
- States a clear task: no
- Gives context: no
- Sets constraints: no
- Defines the output: yes
- Breaks work into steps: yes
The checklist is automatic and applies the same rules to every prompt. It checks structure, not whether the output is good. Prompt scores aren't comparable with tool scores. How we rank
Security
Scanned Nov 24, 2026 at the text shown on this page, with Cisco's open-source skill-scanner.
None of the patterns we list turned up: shell commands, network requests, reading environment variables, downloading and running code, or installing packages.
A scan lists patterns in the code. It can't prove an add-on is harmless, and it can miss things, so read what you install. How we scan
Similar prompts
Prompts that do the same job, most voted first.
| Name | Votes | Score |
|---|---|---|
| This onePython Security Vulnerability Auditor (OWASP-Mapped & Production-Hardened) Coding | โฒ 2 | 31 |
| Website Security Vulnerability Checker Coding Same job: security review | โฒ 1 | 65 |
| Repository Security & Architecture Audit Framework Coding Same job: security review | โฒ 3 | 78 |
| Python Code Generator โ Clean, Optimized & Production-Ready Coding Both about python and production | โฒ 3 | 56 |
| Comprehensive Framework for Auditing, Detecting, and Remediating Bugs and Vulnerabilities in Multi-Stack Repositories Coding Same job: security review | โฒ 5 | 67 |
| Cyber Security Character Workflow Image Same job: security review | โฒ 2 | 48 |