Logotipo de Auditing File Upload And Content Handling

Auditing File Upload And Content Handling

Organización
UnboundCompute
auditing-file-upload-and-content-handling

Audita una ruta de carga y gestión de archivos para detectar archivos proporcionados por un atacante cuyos bytes, tipo declarado, nombre o contenido incrustado llegan a un destino que los almacena en una ubicación servida o ejecutable, o los entrega a un parser que procesa su contenido, una vez identificadas la capa que decide el tipo y la forma de servir el archivo. Abarca el caso en que una capa confía en la extensión o el tipo de contenido para decidir el tipo, pero otra lo contradice; archivos SVG, HTML o XML almacenados y servidos en línea como contenido activo; la explotación de parsers de imágenes o documentos; archivos poliglotas que superan una comprobación de contenido, pero se ejecutan en otro contexto; rutas de carga que escriben fuera del directorio previsto; y archivos comprimidos cuya extracción permite escribir archivos. Úsalo al revisar la validación, el almacenamiento y la publicación de cargas, no los destinos DOM del lado del cliente ni la escritura de archivos mediante extracción de archivos comprimidos, que corresponden a sus propias habilidades. Un archivo cargado es el origen; un destino de publicación o análisis que procesa su contenido es el destino; y la vulnerabilidad consiste en que una capa contradiga la decisión sobre el tipo.

Descripción general

EditorUnboundCompute
Repositoriosecurity-agent-skills
Nombre de la habilidadauditing-file-upload-and-content-handling
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 Auditing File Upload And Content Handling 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/auditing-file-upload-and-content-handling
  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/auditing-file-upload-and-content-handling .claude/skills/auditing-file-upload-and-content-handling
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Auditing File Upload And Content Handling 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 Auditing File Upload And Content Handling 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 Auditing File Upload And Content Handling 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á.

Auditing file upload and content handling: when the type one layer trusts another layer contradicts

A file upload becomes a vulnerability when the layer that decides a file's type disagrees with the layer that later serves or parses it. The upload validator trusts the extension or the declared content-type; the web server sniffs the bytes, or the storage path serves it inline, or a parser acts on embedded content, and the two disagreements meet in the attacker's favor. You audit it by resolving how the type is decided at upload and how the file is served and parsed afterward, then finding where those two views diverge. The strongest false-positive killers live in the serve layer: a no-execute sandboxed origin with a forced download, or a server-side re-encode, neutralizes the content regardless of its bytes. The client-side DOM sink and the archive-extraction write primitive have their own skills; this skill owns the upload-to-serve-or-parse decision.

When to use

  • You are reviewing an upload endpoint, its type validation, where files are stored, and how they are served.
  • A file's bytes, declared type, name, or embedded content reach a parser, a renderer, or a served location.
  • You want to know whether an uploaded file executes or is parsed dangerously somewhere downstream.

Scope check

Audit only applications you own or are authorized to assess, and upload a crafted file only to a system in scope, a stored active file can execute against real users. Adjudicate on the validation, the storage, and the serve path. If you can't name the authorization, stop.

The loop

  1. Resolve the type-decision layer and the serve behavior first. Determine how the upload decides the file's type (an extension check, a declared content-type, a magic-byte sniff, or a combination) and how the file is served afterward (inline or as an attachment, from the app origin or a separate no-execute origin, with what content-type). The bug is a divergence between these two, so establish both before judging any single check.

  2. Check the type-decision contradiction. Look for an extension or a client-declared content-type trusted for the type decision while a second layer (the web server's own sniffing, a content-disposition header, or the storage path's handler) treats the file differently, so a double extension, a null-byte or case trick, or an appended-data file is stored as one type and served as another.

  3. Check active-content serving. Look for an SVG, HTML, or XML file stored and served inline as active content, giving a stored cross-site-scripting or an external-entity parse, when it should be served as an inert attachment or sanitized.

  4. Check parser exploitation. Look for an uploaded image or document fed to a parser or converter that acts on its embedded content (a delegate command, an external reference, an embedded script), turning a crafted file into code execution or a server-side request in the parser.

  5. Check polyglots, path, and archives. Look for a polyglot file that passes one content check yet executes in another context, an upload path that writes outside the intended directory (traversal in the filename), and an archive uploaded and expanded to a write primitive (hand the extraction internals to the archive-extraction skill, keep the upload framing here).

  6. Confirm and record. Confirm by uploading a crafted file and showing it is stored and then executed or parsed dangerously along the reachable path. Kill the lead if the file is served from a no-execute separate origin with a forced attachment disposition and a fixed non-active content-type so the execution path is cut regardless of the bytes, if the server re-encodes the file (an image recompressed through a hardened pipeline) stripping any polyglot or parser payload, if the type is decided by a magic-byte allowlist and the extension and the serve layer all agree, if the stored filename is randomized and the path is outside the web root so a direct request cannot execute it, if the parser is hardened (delegates and external entities disabled) so the crafted content is inert, or if an SVG is sanitized or served with a policy that blocks inline script. Record the upload, the type divergence, and the serve or parse sink.

Where content handling leaks

  • The bug is a divergence, not a single check. The upload validator and the serve or parse layer holding different views of the file's type is the vulnerability; one layer alone rarely tells you.
  • The serve layer is the strongest killer. A no-execute sandboxed origin with a forced download, or a fixed inert content-type, neutralizes the file whatever its bytes; resolve the serve behavior first.
  • Re-encoding strips payloads. Recompressing an image through a hardened pipeline destroys polyglot and parser content; a validated-then-stored-verbatim file does not.
  • Active content served inline is stored injection. An SVG, HTML, or XML served inline runs or parses; the same file forced as an attachment from a sandbox origin does not.
  • The parser is a sink too. An image or document converter that acts on embedded delegates or external references is code execution or a server-side request; hardening the parser closes it.

Worked example (a confirm and a kill)

Confirm. An avatar upload validates only the file extension, stores the file under the application's web root with its original name, and the server serves it with a sniffable content-type. An attacker uploads an SVG (named to pass the extension check) containing a script; fetching the stored file executes the script in the application origin. Confirmed stored cross-site-scripting through an upload validated by extension and served inline as active content, high, remediation = serve user uploads as inert attachments from a separate no-execute origin, decide type by magic bytes, and sanitize or re-encode.

Kill. The same upload re-encodes the image to a fixed format through a hardened pipeline, stores it under a randomized name outside the web root, and serves it from a separate user-content origin with a forced attachment disposition and a fixed non-active content-type. The crafted bytes do not survive the re-encode and the file cannot execute where it is served. Killed, kill_reason = "the file is re-encoded and served no-execute cross-origin with a forced download, so the content-handling sink is neutralized regardless of the uploaded bytes."

Rationalizations to reject

  • "We check the extension." -> Does the serve layer agree? A double extension or a sniffed type diverges from the extension; the contradiction between the layers is the bug.
  • "It is just an image." -> Served inline from the app origin, or re-encoded and served as an attachment from a sandbox origin? An SVG or a polyglot served inline is active content.
  • "The parser is standard." -> Are its delegates and external entities disabled? A converter that acts on embedded content is a code-execution or server-side-request sink.
  • "The filename is validated." -> Against traversal, and stored where? A traversal in the name or a web-root path lets a direct request reach the file.
  • "It is a zip we extract." -> The extraction write primitive is the archive-extraction skill's; here confirm the upload accepts and routes it, and hand the expansion there.

Executing this in practice

You need the upload endpoint and its type validation, whether the file is re-encoded, where it is stored (web root or not, original or randomized name), how it is served (inline or attachment, which origin, which content-type), and any parser or converter the content reaches. For each upload, decide whether the type-decision layer and the serve or parse layer diverge in the attacker's favor. Reading the validator tells you what is accepted; reading the serve path tells you what happens to it.

Related

  • hunting-unsafe-archive-extraction - owns the archive-expansion write primitive (path traversal and resource exhaustion on extract); this skill routes an uploaded archive there rather than duplicating it.
  • testing-client-side-dom-vulnerabilities - owns the client-side DOM sink taxonomy; the SVG-as-active- content shape here is the server-served, stored variant, framed as content handling rather than a DOM sink.
  • reviewing-content-security-policy - the policy that blocks inline script in served active content is a mitigating layer this skill checks when adjudicating an SVG or HTML upload.
  • FINDING-SCHEMA.md - source = an uploaded file, sink = a serve or parse operation acting on its content, evidence = the type-decision layer, the serve behavior, and the divergence between them.

Preguntas frecuentes

¿Qué hace la habilidad de IA Auditing File Upload And Content Handling?

Audita una ruta de carga y gestión de archivos para detectar archivos proporcionados por un atacante cuyos bytes, tipo declarado, nombre o contenido incrustado llegan a un destino que los almacena en una ubicación servida o ejecutable, o los entrega a un parser que procesa su contenido, una vez identificadas la capa que decide el tipo y la forma de servir el archivo. Abarca el caso en que una capa confía en la extensión o el tipo de contenido para decidir el tipo, pero otra lo contradice; archivos SVG, HTML o XML almacenados y servidos en línea como contenido activo; la explotación de parse...

¿Por qué usar Auditing File Upload And Content Handling en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Auditing File Upload And Content Handling 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 Auditing File Upload And Content Handling en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-file-upload-and-content-handling. 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 Auditing File Upload And Content Handling?

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 Auditing File Upload And Content Handling?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Auditing File Upload And Content Handling 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 Auditing File Upload And Content Handling?

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 👇