Logotipo de Detecting Memory Safety Bugs

Detecting Memory Safety Bugs

Organización
UnboundCompute
detecting-memory-safety-bugs

Find memory-safety bugs in C/C++ and other unmanaged code - use-after-free, double-free, out-of-bounds read/write, uninitialized use, and NULL deref - by reasoning about object lifetime and buffer bounds along real code paths. Use on an authorized source target when a candidate catalog does NOT model these temporal/lifetime classes (most don't), so a keyword or sink scan will miss them; when reviewing allocators, parsers, buffer handling, or refcounting. Pairs the lifetime/bounds reasoning with source→sink confirmation and the shared finding schema.

Descripción general

EditorUnboundCompute
Repositoriosecurity-agent-skills
Nombre de la habilidaddetecting-memory-safety-bugs
Estrellas
27
Forks
8
Archivos incluidos
Solo instrucciones
LicenciaMIT
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando la petición encaja con la habilidad.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • Todo en las instrucciones

    Todo lo que necesita el modelo está en las instrucciones: no hay archivos adicionales que sincronizar.

  • Código abierto

    Publicada por UnboundCompute en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA Detecting Memory Safety Bugs en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/detecting-memory-safety-bugs
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/UnboundCompute/security-agent-skills.git /tmp/security-agent-skills
mkdir -p .claude/skills
cp -r /tmp/security-agent-skills/skills/detecting-memory-safety-bugs .claude/skills/detecting-memory-safety-bugs
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Detecting Memory Safety Bugs en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición encaja con la habilidad, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga Detecting Memory Safety Bugs automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que Detecting Memory Safety Bugs no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición que encaja con la habilidad, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu modelo seguirá.

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.

  2. 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.

  3. 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 <= size, unchecked memcpy length, integer-truncated length, signed/unsigned confusion at the check.

  4. Uninitialized use. A value is read before it's written. Hunt: stack structs and locals used on a path that skipped their initialization (an early goto, an error branch, a partially-filled struct). Confirm: a path from declaration to use with no write on that path.

  5. NULL / invalid-pointer deref. A pointer that can be NULL (or an error sentinel) is dereferenced without a check. Hunt: allocation and lookup returns that can fail; dereferences of a parameter documented as nullable. Confirm: a path where the returning call can yield NULL and the deref has no guard between.

Integer overflow feeds all of the above

Overflow is rarely the final bug - it's the step that produces a bad length/index/size. Treat a * b, a + b, and truncating casts on attacker-influenced sizes as candidates because they flow into an allocation or a bound. Trace overflow → size/index → memory op; report the memory bug with the overflow as its cause.

Worked example

UAF via error path. In parse_record: rec = alloc(); if (read(rec) < 0) { 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 < 0); impact = attacker-triggered malformed record 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 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.

Preguntas frecuentes

¿Qué hace la habilidad de IA Detecting Memory Safety Bugs?

Find memory-safety bugs in C/C++ and other unmanaged code - use-after-free, double-free, out-of-bounds read/write, uninitialized use, and NULL deref - by reasoning about object lifetime and buffer bounds along real code paths. Use on an authorized source target when a candidate catalog does NOT model these temporal/lifetime classes (most don't), so a keyword or sink scan will miss them; when reviewing allocators, parsers, buffer handling, or refcounting. Pairs the lifetime/bounds reasoning with source→sink confirmation and the shared finding schema.

¿Por qué usar Detecting Memory Safety Bugs en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Detecting Memory Safety Bugs está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo Detecting Memory Safety Bugs en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/detecting-memory-safety-bugs. TypingMind lee el archivo SKILL.md de esa carpeta e instala su contenido como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar Detecting Memory Safety Bugs?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar Detecting Memory Safety Bugs?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Detecting Memory Safety Bugs con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA Detecting Memory Safety Bugs?

Sí. UnboundCompute la ha publicado en GitHub bajo la licencia MIT. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver el directorio

Crea ya tu propio espacio de trabajo con IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇