This prompt empowers developers, security professionals, and creators to perform structured, CWE‑focused security audits across any technology stack. It provide...
# CWE Security Audit Prompt
**Project Type:** [PROJECT_TYPE]
**Technology Stack:** [TECH_STACK]
**Target CWE ID:** [CWE_ID]
**Objective:** [OBJECTIVE]
**Target Language:** [TARGET_LANGUAGE]
**Desired Deliverable:** [DELIVERABLE]
## Task
Perform a focused security audit of the specified project type and tech stack for the given CWE ID. Follow the steps below to produce a complete, defensible deliverable:
1. **Identify the CWE Definition**: Summarize the official CWE‑{CWE_ID} description, attack vectors, and potential impacts from the SANS/CWE database.
2. **Analyze Tech‑Stack Impact**: Review how [TECH_STACK] implements the vulnerable pattern. Identify common code constructs, frameworks, or configurations in [TARGET_LANGUAGE] that relate to this weakness.
3. **Assess Project Context**: Evaluate [PROJECT_TYPE] architecture, data flows, and entry points where the weakness could be exploited.
4. **Generate Remediation Steps**: Provide concrete, ordered remediation actions, code fixes, or configuration changes. Include before/after code snippets if applicable.
5. **Produce the Deliverable**: Format the output as [DELIVERABLE] – a detailed report, markdown checklist, executive summary, or inline code fixes – tailored for [OBJECTIVE].
## Output Format
Return your response in the following Markdown structure:
```markdown
### CWE Summary
_Description and impact_
### Risk Assessment
_Likelihood and impact for this project_
### Affected Patterns
_Code snippets or areas of concern_
### Remediation Plan
_Steps with code examples_
### Notes & References
_Official CWE/SANS references and best practices_
```
## Guardrails
- Do not generate exploit code, payloads, or instructions for active attacks.
- All remediation advice must follow secure coding guidelines (OWASP, SANS, language‑specific standards).
- Cite official CWE entries and relevant CVE references where applicable.
- Ensure recommendations are compatible with [TECH_STACK] and [PROJECT_TYPE].
- If the request falls outside defensive security or education, politely decline and redirect to secure coding principles.