AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Detecting Memory Safety Bugs

skill-unboundcompute-security-agent-skills-detecting-memory-safety-bugs · by UnboundCompute

>-

No reviews yet
0 installs
18 views
0.0% view→install

Install

$ agentstack add skill-unboundcompute-security-agent-skills-detecting-memory-safety-bugs

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-unboundcompute-security-agent-skills-detecting-memory-safety-bugs)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
17d ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Detecting Memory Safety Bugs? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Detecting memory-safety bugs

Temporal and spatial memory bugs are the ones a sink-based catalog usually doesn't model: there's no single "dangerous function" to grep - the bug is a relationship between a pointer's lifetime and its use, or between an index and a bound, spread across code paths. So you hunt them by reasoning about lifetime and bounds, not by matching a call. This skill covers the five workhorse classes and how to confirm each.

When to use

  • The target is C/C++/Rust-unsafe/CGo or any unmanaged memory, and you want the

classes a catalog leaves out (hunting-bugs-with-a-code-graph flags these as out-of-catalog and sends you here).

  • You're reviewing allocators, parsers, serializers, ring buffers, refcounting,

or anything doing pointer arithmetic.

Scope check

Authorized source only. If you can't name the authorization, stop.

The five classes and how to confirm each

For every candidate, the confirmation is a path: an allocation/definition site, the operation that changes its state, and the use - read the source at each.

  1. Use-after-free (UAF). A pointer is used after its object is freed. Hunt:

for each free/delete/refcount-drop, ask what still holds this pointer and can any path reach a use after this point - including aliases stored in structs, callbacks, and error paths. Confirm: a live path free → … → deref with no reassignment in between. Watch the classic shapes: free-in-a-loop then use, free in an error branch then fallthrough use, and a cached pointer that outlives the object.

  1. Double-free. The same allocation freed twice. Hunt: two frees reachable in

sequence on some path without a nulling/reassignment between them; ownership handed to a callee that also frees; error paths that free then fall into a cleanup that frees again. Confirm: both frees hit the same object on one path.

  1. Out-of-bounds read/write. An index or pointer crosses a buffer's bound.

Hunt: every buffer access where the index/length is attacker-influenced or derived from a separate field (length prefixes are a hotspot). Confirm: trace the index/length source and the buffer's true size; the bug is any path where index/len can exceed size - off-by-one at **UAF via error path.** In parse_record: rec = alloc(); if (read(rec) free(rec); } … use(rec->field); - the free is in the error branch but the > function falls through to use(rec->field) without returning. Path: alloc → > free (error branch) → deref (fallthrough). **Confirmed UAF**; reachable = > conditional (read returns frees then dereferences. Remediation: return` after the free, or restructure > cleanup with a single exit.

Rationalizations to reject

  • "There's no dangerous function call, so it's memory-safe." → These classes

have no single sink. Reason about lifetime and bounds, not calls.

  • "The length is checked." → Checked where, against the true size, before

every path to the access, and without integer truncation? Verify all four.

  • "It's freed once in the code I can see." → Ownership may free again in a

callee or a cleanup path. Follow the pointer, including aliases.

  • "The compiler/sanitizer would catch it." → Only on inputs the test suite

exercised. Static path reasoning finds the untested path.

Executing this in practice

You need to follow a pointer's aliases and a value's flow across functions, and read the exact body at each site. A code property graph with points-to/alias information makes "what else holds this pointer" answerable; a memory-safety static analyzer (or the compiler's sanitizers on targeted inputs) corroborates; manual path reading closes it. Confirm every class as a concrete path, then emit per the [finding schema](../../FINDING-SCHEMA.md) with the alloc/free/use hops in path.

Related

  • adjudicating-taint-paths - for the attacker-input side (who controls the

length/index).

  • hunting-bugs-with-a-code-graph - the master loop that routes these here.
  • [FINDING-SCHEMA.md](../../FINDING-SCHEMA.md).

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.