memory-safety-c-cpp

memory-safety-c-cpp is a skill for Claude Code, Codex from provos/ironcurtain. It costs 113 tokens per session (4,486 once invoked), scanned A, original, Apache-2.0.

A reference guide to memory-safety bugs in native C and C++ programs, including standard names, arithmetic patterns, and common pointer mistakes.

In plain words
What is it for?
Use it when examining suspected memory corruption, planning tests or harnesses, or interpreting sanitizer findings such as buffer overflows and use-after-free errors.
Why use it?
It gives an investigation a shared vocabulary for describing bugs and linking them to detection tools and root causes. The supplied excerpt does not show the add-on performing the analysis itself.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/provos/ironcurtain/memory-safety-c-cpp
Any agent
npx skills add provos/ironcurtain --skill memory-safety-c-cpp
Clone the repo
git clone --depth 1 https://github.com/provos/ironcurtain

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for memory-safety-c-cpp

README.md
[![agentmods](https://agentmods.dev/badge/skills/provos/ironcurtain/memory-safety-c-cpp.svg)](https://agentmods.dev/skills/provos/ironcurtain/memory-safety-c-cpp)
Your own site
<a href="https://agentmods.dev/skills/provos/ironcurtain/memory-safety-c-cpp"><img src="https://agentmods.dev/badge/skills/provos/ironcurtain/memory-safety-c-cpp.svg" alt="Measured on agentmods" height="20"></a>
Per session 113 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,486 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00113 $0.04486
Opus 5 $0.00056 $0.02243
Sonnet 5 $0.00023 $0.00897
Haiku 4.5 $0.00011 $0.00449

Measured 6d ago against content hash b3c5e3177560, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

memory-safety-c-cpp scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/workflow/workflows/vuln-discovery/skills/memory-safety-c-cpp/SKILL.md · 168 lines

How it starts

The opening of the file, as written. The whole thing — 168 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Memory-Safety Bugs in C/C++

Reference vocabulary for native C/C++ code with sanitizer support. Catalogs the bug classes, patterns, and exploitability factors a memory-safety investigation needs to reason about.

Bug-class taxonomy

Identifiers below are the canonical IDs to use when naming a bug class in any artifact. Map each to the oracle that catches it and the root-cause CWE.

Bug class Oracle Root-cause CWE Where it lives
heap_overflow ASAN heap-buffer-overflow CWE-122 Read or write past a heap allocation
stack_overflow ASAN stack-buffer-overflow CWE-121 Read or write past a stack frame buffer
out_of_bounds_read ASAN OOB-read CWE-125 Generic OOB load — distinct from heap/stack only by site
out_of_bounds_write ASAN OOB-write CWE-787 Generic OOB store
use_after_free ASAN heap-use-after-free CWE-416 Pointer dereferenced after the allocation it pointed to was freed
double_free ASAN attempting double-free CWE-415 free() called twice on the same allocation
integer_overflow UBSAN signed-integer-overflow / unsigned-integer-overflow CWE-190 Arithmetic produces a value outside the type's range
type_confusion ASAN OOB or UBSAN vptr CWE-843 A value is interpreted as a different type than it was created with — frequently across vtable / dispatch-table boundaries
format_string ASAN OOB / UBSAN CWE-134 Attacker-controlled bytes reach the format-spec argument of a printf-family call
null_deref SIGSEGV (caught by ASAN as SEGV on unknown address 0x000000000000) CWE-476 Dereference of a pointer the attacker can force to NULL
uninitialized_memory MSan use-of-uninitialized-value CWE-457 Read of memory before it was written
race_condition TSAN data race CWE-362 Concurrent unsynchronized access (a TOCTOU is a special case where the racing accesses are check-then-use)
memory_leak LSan / ASAN leak report CWE-401 Heap allocation lost without free()

Read the full file on GitHub · 168 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 168 lines · 113 tokens per session scan A b3c5e3177560

Subscribe to this mod's changes

memory-safety-c-cpp is a skill published in the GitHub repository provos/ironcurtain (600 stars, last pushed 2d ago), licensed Apache-2.0. It adds 113 tokens to every session and 4,486 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories