Logo van Auditing File Upload And Content Handling

Auditing File Upload And Content Handling

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

Controleer een pad voor bestandsuploads en inhoudsverwerking op bestanden die door een aanvaller zijn aangeleverd en waarvan de bytes, het opgegeven type, de naam of ingebedde inhoud terechtkomen op een plek waar ze worden opgeslagen in een locatie die wordt aangeboden of uitgevoerd, of worden verwerkt door een parser die op de inhoud handelt. Doe dit nadat de laag die het type bepaalt en het serveergedrag zijn vastgesteld. Let op een extensie of content-type dat voor de typebepaling wordt vertrouwd, maar door een tweede laag wordt tegengesproken; een SVG-, HTML- of XML-bestand dat inline als actieve inhoud wordt opgeslagen en aangeboden; misbruik van een afbeeldings- of documentparser; een polyglotbestand dat een inhoudscontrole doorstaat maar in een andere context wordt uitgevoerd; een uploadpad dat buiten de bedoelde map schrijft; en een archief dat uitpakken mogelijk maakt als schrijfbewerking. Gebruik deze skill bij het controleren van uploadvalidatie, opslag en het aanbieden van bestanden. De client-side DOM-sink en de schrijfbewerking bij archiefextractie vallen onder hun eigen skills. Een geüpload bestand is de bron, een serveer- of parsebestemming die de inhoud verwerkt is het doel en een typebepaling die door een andere laag wordt tegengesproken, is de fout.

Overzicht

UitgeverUnboundCompute
Repositorysecurity-agent-skills
Skillnaamauditing-file-upload-and-content-handling
Sterren
27
Forks
8
Meegeleverde bestanden
Alleen instructies
LicentieMIT
Links
  • Instructies in Markdown

    Het model laadt het bestand SKILL.md alleen als dat nodig is. Dat kost dus alleen tokens als een verzoek daadwerkelijk bij de skill past.

  • Werkt met elk LLM

    AI-skills bestaan uit instructies in gewone Markdown, niet uit aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • Compleet zonder extra bestanden

    Alles wat het model nodig heeft, staat in de instructies — geen extra bestanden om te synchroniseren.

  • Open source

    Gepubliceerd door UnboundCompute op GitHub. Bekijk de bronbestanden voordat je de skill installeert.

Installatie

Installeer de AI-skill Auditing File Upload And Content Handling in TypingMind om deze met elk LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map. De app leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-file-upload-and-content-handling
  4. Schakel de skill in voor elke chat waarin je de skill wilt kunnen gebruiken.
Plug-ins → Skills → Skill toevoegen → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die 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
Start Claude Code na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Auditing File Upload And Content Handling in voor een chat naar keuze in TypingMind en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek bij de skill past, laadt het model zelf de volledige instructies. Je hoeft de skill nooit handmatig aan te roepen. Pas als het model de skill daadwerkelijk gebruikt, kost dat tokens.

Het model laadt Auditing File Upload And Content Handling automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Auditing File Upload And Content Handling niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

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.

Veelgestelde vragen

Wat doet de AI-skill Auditing File Upload And Content Handling?

Controleer een pad voor bestandsuploads en inhoudsverwerking op bestanden die door een aanvaller zijn aangeleverd en waarvan de bytes, het opgegeven type, de naam of ingebedde inhoud terechtkomen op een plek waar ze worden opgeslagen in een locatie die wordt aangeboden of uitgevoerd, of worden verwerkt door een parser die op de inhoud handelt. Doe dit nadat de laag die het type bepaalt en het serveergedrag zijn vastgesteld. Let op een extensie of content-type dat voor de typebepaling wordt vertrouwd, maar door een tweede laag wordt tegengesproken; een SVG-, HTML- of XML-bestand dat inline a...

Waarom Auditing File Upload And Content Handling gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Auditing File Upload And Content Handling bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model. Ook als je midden in een chat van model wisselt, blijft de skill werken. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek af te sluiten. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Auditing File Upload And Content Handling in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-file-upload-and-content-handling. TypingMind leest het bestand SKILL.md en installeert het als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Auditing File Upload And Content Handling gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Auditing File Upload And Content Handling gebruiken?

Zoveel als je wilt. Je kunt Auditing File Upload And Content Handling gebruiken met elk model dat skills ondersteunt, zoals GPT, Claude, Gemini, Grok, DeepSeek, Mistral of Llama. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Auditing File Upload And Content Handling gratis?

Ja. Deze skill is door UnboundCompute op GitHub gepubliceerd onder de licentie MIT. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. De skill volgt het open Agent Skills-formaat: het bestand SKILL.md bevat de naam en beschrijving van de skill. Daarnaast kan de skill scripts, sjablonen of referentiebestanden bevatten die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Bekijk alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇