Logo : Auditing File Upload And Content Handling

Auditing File Upload And Content Handling

Organisation
UnboundCompute
auditing-file-upload-and-content-handling

Auditez le processus de téléversement et de traitement des fichiers pour repérer les fichiers fournis par un attaquant dont les octets, le type déclaré, le nom ou le contenu intégré atteignent une destination qui les stocke dans un emplacement servi ou exécutable, ou les transmet à un analyseur qui traite leur contenu, après avoir examiné la couche de décision sur le type et le comportement de mise à disposition. Cela couvre une extension ou un type de contenu considéré comme fiable pour déterminer le type, mais contredit par une seconde couche ; un fichier SVG, HTML ou XML stocké et servi en ligne comme contenu actif ; l’exploitation d’un analyseur d’images ou de documents ; un fichier polyglotte qui passe une vérification de contenu, mais s’exécute dans un autre contexte ; un processus de téléversement qui écrit en dehors du répertoire prévu ; et une archive qui, à l’extraction, permet d’écrire des fichiers. À utiliser pour examiner la validation, le stockage et la mise à disposition des fichiers téléversés, mais pas le point d’injection DOM côté client ni l’écriture de fichiers à l’extraction d’archives, couverts par leurs propres compétences. Un fichier téléversé est la source ; une destination de mise à disposition ou d’analyse qui traite son contenu est la destination ; la faille réside dans une décision sur le type contredite par une autre couche.

Présentation

ÉditeurUnboundCompute
Dépôtsecurity-agent-skills
Nom de la compétenceauditing-file-upload-and-content-handling
Étoiles
27
Forks
8
Fichiers inclus
Instructions uniquement
LicenceMIT
Liens
  • Instructions en Markdown

    Un fichier SKILL.md que le modèle charge à la demande : il ne consomme donc des tokens que lorsqu’une demande correspond réellement à la compétence.

  • Compatible avec tous les LLM

    Les compétences IA sont rédigées en Markdown et non sous forme de code propre à un fournisseur. Elles fonctionnent donc avec GPT, Claude, Gemini, Grok ou un modèle local.

  • Tout dans les instructions

    Tout ce dont le modèle a besoin se trouve dans les instructions : aucun fichier supplémentaire à synchroniser.

  • Open source

    Publiée par UnboundCompute sur GitHub. Consultez les sources avant de l’installer.

Installation

Installez la compétence IA Auditing File Upload And Content Handling dans TypingMind pour l’utiliser avec n’importe quel LLM, ou ajoutez-la à un autre agent capable de lire SKILL.md.

1

Installer dans TypingMind

TypingMind installe une compétence directement depuis son dossier GitHub : l’application lit SKILL.md, regroupe les fichiers de ressources et enregistre le tout localement.

  1. Ouvrez l’application et accédez à Plugins → Compétences.
  2. Choisissez « Installer depuis GitHub ».
  3. Copiez l’URL ci-dessous, qui pointe vers le dossier de la compétence, puis collez-la et confirmez.
    https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-file-upload-and-content-handling
  4. Activez la compétence dans chaque discussion où vous souhaitez pouvoir l’utiliser.
Plugins → Compétences → Ajouter une compétence → Via une URL GitHub, puis collez l’URL du dossier et appuyez sur Continuer.
2

Installer dans un autre agent

Tout agent capable de lire le format Agent Skills peut utiliser cette compétence : copiez le dossier dans le répertoire des compétences de cet agent.

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
Redémarrez Claude Code après la copie pour que la nouvelle compétence soit prise en compte.

Utilisez cette compétence dans TypingMind

Activez Auditing File Upload And Content Handling dans n’importe quelle discussion TypingMind et le modèle s’occupe du reste. Le nom et la description de la compétence figurent dans le prompt système. Dès qu’une demande correspond, le modèle charge lui-même l’intégralité des instructions : vous n’avez jamais à l’invoquer manuellement, et elle ne consomme aucun token tant qu’elle n’est pas utilisée.

Le modèle charge automatiquement Auditing File Upload And Content Handling dès qu’une demande correspond à cette compétence.

Compatible avec tous les modèles IA

Les compétences IA sont de simples instructions Markdown, et non du code propre à un fournisseur. Ainsi, la compétence Auditing File Upload And Content Handling n’est pas liée au modèle pour lequel elle a été conçue. Installez-la une seule fois dans TypingMind et utilisez-la avec GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou un modèle local que vous exécutez vous-même, le tout avec vos propres clés API.

  • Chargée uniquement en cas de besoin

    Le prompt système ne contient que le nom et la description. Les instructions sont récupérées à la première demande correspondante : une compétence inutilisée ne coûte donc rien.

  • Changez de modèle en cours de discussion

    La compétence étant constituée d’instructions et non de code, elle reste fonctionnelle lorsque vous changez de modèle : le nouveau modèle lit le même fichier SKILL.md.

Instructions de la compétence

Voici le contenu de SKILL.md que le modèle charge. Lisez-le avant l’installation : une compétence contient des instructions que votre modèle suivra.

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.

Foire aux questions

À quoi sert la compétence IA Auditing File Upload And Content Handling ?

Auditez le processus de téléversement et de traitement des fichiers pour repérer les fichiers fournis par un attaquant dont les octets, le type déclaré, le nom ou le contenu intégré atteignent une destination qui les stocke dans un emplacement servi ou exécutable, ou les transmet à un analyseur qui traite leur contenu, après avoir examiné la couche de décision sur le type et le comportement de mise à disposition. Cela couvre une extension ou un type de contenu considéré comme fiable pour déterminer le type, mais contredit par une seconde couche ; un fichier SVG, HTML ou XML stocké et servi...

Pourquoi utiliser Auditing File Upload And Content Handling sur TypingMind ?

Parce que vous l’installez une seule fois pour l’utiliser avec n’importe quel modèle. Auditing File Upload And Content Handling se compose de simples instructions en Markdown plutôt que de code propre à un fournisseur. La même compétence fonctionne donc avec GPT-5, Claude, Gemini, Grok ou un modèle local, et vous pouvez changer de modèle en cours de discussion sans perturber son fonctionnement. TypingMind utilise vos propres clés API : vous payez donc directement les fournisseurs plutôt qu’un abonnement par siège, et vos compétences et discussions restent dans votre propre espace de stockage.

Comment installer Auditing File Upload And Content Handling dans TypingMind ?

Dans TypingMind, ouvrez Plugins → Compétences → Installer depuis GitHub et collez https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-file-upload-and-content-handling. TypingMind lit le fichier SKILL.md et l’installe sous forme de compétence que vous pouvez activer pour chaque discussion.

Quels modèles d’IA peuvent utiliser Auditing File Upload And Content Handling ?

N’importe quel modèle que vous connectez dans TypingMind. Les compétences IA sont de simples instructions en Markdown, et non du code propre à un fournisseur. GPT, Claude, Gemini, Grok et les modèles locaux peuvent donc tous charger cette compétence lorsqu’une demande lui correspond.

Combien de modèles d’IA puis-je utiliser avec Auditing File Upload And Content Handling ?

Autant que vous le souhaitez. Vous pouvez utiliser Auditing File Upload And Content Handling avec tout modèle qui prend en charge les compétences : GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama et bien d’autres, le tout dans TypingMind avec vos propres clés API.

La compétence IA Auditing File Upload And Content Handling est-elle gratuite ?

Oui. Cette compétence est publiée sur GitHub par UnboundCompute sous licence MIT. Vous ne payez que votre propre fournisseur d’IA pour les tokens utilisés.

Que sont les compétences IA ?

Une compétence IA est un ensemble d’instructions réutilisables qui apprend à un modèle d’IA à accomplir une tâche précise. Elle suit le format ouvert Agent Skills : un fichier SKILL.md contenant un nom et une description, ainsi que les éventuels scripts, gabarits ou fichiers de référence dont le modèle peut avoir besoin. Le modèle ne lit les instructions que lorsque votre demande correspond à la compétence. Une compétence installée ne coûte donc rien tant qu’elle n’est pas utilisée.

En quoi les compétences IA diffèrent-elles des plugins ou des serveurs MCP ?

Un plugin ou un serveur MCP fournit au modèle de nouveaux outils à appeler : du code qui s’exécute quelque part et renvoie un résultat. Une compétence IA lui apporte plutôt des connaissances et une méthode : comment aborder une tâche, quelles étapes suivre et à quoi ressemble un bon résultat. Les compétences sont de simples instructions en Markdown. Elles ne nécessitent donc ni serveur, ni clé API, ni environnement d’exécution, et fonctionnent avec n’importe quel modèle.

Tout voir

Créez votre propre espace de travail IA dès maintenant

Abonnez-vous à notre newsletter pour être informé des nouvelles fonctionnalités et des prochains cadeaux à gagner 👇