Cwe Code Review logo

Cwe Code Review

Organization
SpecterOps
cwe-code-review

Perform CWE-grounded security code reviews and precise weakness mapping using a locally derived MITRE CWE corpus, relationship graphs, mapping notes, detection methods, mitigations, and schema semantics. Use when Codex needs to audit source code or pull requests, identify root-cause weakness classes, distinguish broad symptoms from mappable CWEs, justify CWE IDs in findings, or review code against CWE views such as Software Development, Research Concepts, Top 25, OWASP, language-specific, or AI/ML weakness sets.

Overview

PublisherSpecterOps
Repositoryskills
Skill namecwe-code-review
Stars
706
Forks
80
Bundled files
9
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 9 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by SpecterOps on GitHub. Read the source before you install it.

Installation

Install the Cwe Code Review AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/SpecterOps/skills/tree/main/skills/cwe-code-review
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/SpecterOps/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/cwe-code-review .claude/skills/cwe-code-review
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Cwe Code Review in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Cwe Code Review on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Cwe Code Review is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

CWE Code Review

Use this skill for manual security review when the result needs defensible CWE mapping, not just a list of suspicious patterns. Prefer a narrower language, framework, CI, cloud, or infrastructure review skill when one clearly fits; use this skill to add CWE precision and cross-cutting review logic.

Review Principles

  • Start from architecture, trust boundaries, attacker-controlled inputs, sensitive assets, and reachable sinks.
  • Confirm a code path before assigning a CWE. A keyword match or a dangerous API alone is not a finding.
  • Use CWE as a root-cause taxonomy. Prefer the most precise supported weakness over a broad Pillar, Class, Category, or View.
  • Treat mapping notes as part of the evidence. Allowed and Allowed-with-Review entries are usually better finding mappings than Discouraged or Prohibited entries.
  • Use Top 25, OWASP, language, and lifecycle views for coverage and prioritization context, not as severity proof.
  • Keep unsupported hypotheses as open questions or coverage gaps instead of forcing a CWE mapping.
  • Always create or update one standalone poc_<finding_slug>.py artifact per confirmed finding in the review workspace, with exploit prerequisites and validation steps for that finding.

References

Lookup Workflow

Resolve this skill directory, then use the lookup helper from that directory:

bash
python3 scripts/cwe_lookup.py --query "server-side request forgery"
python3 scripts/cwe_lookup.py --id 918
python3 scripts/cwe_lookup.py --id CWE-79 --full
python3 scripts/cwe_lookup.py --view 1435 --limit 30
python3 scripts/cwe_lookup.py --phase Implementation --functional-area Authorization --limit 20
python3 scripts/cwe_lookup.py --impact "Execute Unauthorized Code or Commands" --mapping Allowed --limit 20

Use --query to discover candidates, then --id to read the mapping notes, relationships, consequences, detection methods, and mitigations before naming a CWE in a finding.

Review Process

  1. Build a threat model and code inventory.

    • Identify components, entry points, identities, privilege levels, data stores, external integrations, sensitive assets, and deployment boundaries.
    • Record attacker-controlled inputs, security decisions, and trust assumptions.
  2. Trace security-relevant paths.

    • Follow untrusted data to queries, templates, files, archives, URLs, deserializers, process execution, logs, caches, and client responses.
    • Follow identity, authorization, session, secret, cryptographic, and business-state decisions through alternate routes and asynchronous handlers.
    • Record controls, normalization, validation, encoding, authorization checks, failure behavior, and privilege transitions.
  3. Discover candidate weaknesses.

    • Query by sink, violated control, impact, lifecycle phase, or functional area.
    • Use view references to widen coverage when the repository exposes a relevant language, platform, lifecycle, OWASP, Top 25, mobile, or AI/ML surface.
    • Use parent and child relationships to move from broad symptoms toward a precise root cause.
  4. Validate the mapping.

    • Read the candidate record with --id.
    • Check Abstraction, Status, Mapping Usage, mapping rationale, relationship context, and suggestions.
    • Prefer Base or Variant entries when the evidence supports them. Use Compound entries when the exploit requires the combined condition.
    • Avoid mapping a finding to a Category or View. Avoid a Pillar or broad Class when a supported child weakness matches the actual failure.
    • If the best entry is Allowed-with-Review, state why the code path fits that entry. If the best visible entry is Discouraged or Prohibited, keep searching or explain the mapping gap.
  5. Report only confirmed findings.

    • Tie each finding to file and line references, attacker influence, the missing or incorrect control, reachable impact, and a focused remediation.
    • Name one primary CWE mapping per finding. Mention secondary CWE relationships only when they explain a distinct contributing weakness or attack chain.
    • Include concise syntax-highlighted code blocks for the affected source or configuration sections that establish the input, missing control, sensitive sink, or authorization decision.
    • Include a regression test or validation step that would fail before the fix and pass after it.
  6. Build the PoC artifacts.

    • Create or update one standalone poc_<finding_slug>.py file in the review workspace for each confirmed finding.
    • Do not combine unrelated findings into one harness unless the user explicitly asks for a consolidated runner.
    • Make each path incremental: print or implement numbered steps for prerequisites, authentication or material acquisition, trigger, impact verification, and cleanup guidance.
    • State attacker position, required permissions, credentials or certificates, environmental dependencies, and any unproven prerequisite before sending requests.
    • Default to dry-run or harmless markers and require an explicit flag for state-changing validation. Do not overclaim impact when a later exploit step remains unproven.
    • If a confirmed finding has no runnable path, still create its per-finding PoC scaffold and explain the missing prerequisite or why exploitation was not confirmed.

PoC Artifacts

Per-finding PoC scripts are part of the review output, not an optional appendix. Each script should help another reviewer reproduce one finding without reconstructing the exploit chain from prose.

  • Prefer standalone standard-library scripts named poc_<finding_slug>.py. Duplicating small amounts of transport or auth plumbing is acceptable when it keeps each PoC independently runnable.
  • Keep requirements discoverable through python3 poc_<finding_slug>.py --requirements or equivalent help text.
  • Model chained findings explicitly. If one finding yields the credential or primitive required by another, state the dependency and expose the steps separately.
  • Use safe default destinations, fake secrets, and non-destructive checks where they still prove the root cause. Put stronger impact demonstrations behind explicit arguments and document the side effects.
  • Validate each script locally with syntax checks and dry runs, then record which live steps were and were not executed.

Finding Standard

Lead with findings ordered by severity. For each finding include Severity, Location, Issue, CWE, Evidence, Exploit Path, Impact, Remediation, and Test.

For CWE, include the identifier, name, and one sentence explaining why that entry is the precise root-cause mapping. Note Allowed-with-Review caveats when applicable.

For Evidence, include line-scoped fenced code blocks with an appropriate language tag such as python, go, javascript, yaml, json, nginx, bash, or sql. Put the source path and line range immediately above each block. Keep excerpts narrow enough to show the relevant control flow without dumping whole modules, and include supporting configuration blocks when they are part of the exploit path.

For each finding, also include PoC Requirements and reference the corresponding poc_<finding_slug>.py artifact and step sequence.

After findings, include Open Questions / Assumptions and Coverage. If no confirmed findings exist, say so explicitly and still state the reviewed surfaces, unresolved risks, test gaps, and that no per-finding PoC artifacts were created.

Regeneration

Rebuild the derived corpus when a newer CWE catalog or schema is provided:

bash
python3 scripts/build_cwe_references.py \
  --catalog /path/to/cwec.xml \
  --schema /path/to/cwe_schema.xsd

Keep the generated references aligned with the source catalog and schema version recorded in references/cwe-catalog-summary.md.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Cwe Code Review AI skill do?

Perform CWE-grounded security code reviews and precise weakness mapping using a locally derived MITRE CWE corpus, relationship graphs, mapping notes, detection methods, mitigations, and schema semantics. Use when Codex needs to audit source code or pull requests, identify root-cause weakness classes, distinguish broad symptoms from mappable CWEs, justify CWE IDs in findings, or review code against CWE views such as Software Development, Research Concepts, Top 25, OWASP, language-specific, or AI/ML weakness sets.

Why use Cwe Code Review on TypingMind?

Because you install it once and use it with any model. Cwe Code Review is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Cwe Code Review in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/SpecterOps/skills/tree/main/skills/cwe-code-review. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Cwe Code Review?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Cwe Code Review?

As many as you like. As long as a model supports skills, you can use Cwe Code Review with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Cwe Code Review AI skill free?

Yes. It is published on GitHub by SpecterOps under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇