Logo di Auditing File Upload And Content Handling

Auditing File Upload And Content Handling

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

Verifica il flusso di caricamento e gestione dei file per individuare file forniti da un aggressore, i cui byte, tipo dichiarato, nome o contenuto incorporato raggiungono una destinazione che li archivia in un percorso servito o eseguibile oppure li passa a un parser che agisce sul loro contenuto, dopo aver esaminato il livello che decide il tipo e il comportamento di pubblicazione. Include un’estensione o un content-type considerati attendibili per determinare il tipo, ma contraddetti da un secondo livello; un file SVG, HTML o XML archiviato e servito inline come contenuto attivo; lo sfruttamento di parser di immagini o documenti; un file polyglot che supera un controllo del contenuto ma viene eseguito in un altro contesto; un percorso di caricamento che scrive al di fuori della directory prevista; e un archivio che, una volta estratto, permette di scrivere file. Usala per esaminare la convalida, l’archiviazione e la pubblicazione dei file caricati, non la destinazione DOM lato client o la primitiva di scrittura durante l’estrazione di archivi, coperte dalle rispettive skill. Un file caricato è la sorgente, una destinazione di pubblicazione o analisi che agisce sul suo contenuto è la destinazione e il bug consiste in una decisione sul tipo contraddetta da un altro livello.

Panoramica

Pubblicato daUnboundCompute
Repositorysecurity-agent-skills
Nome della skillauditing-file-upload-and-content-handling
Stelle
27
Fork
8
File inclusi
Solo istruzioni
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da UnboundCompute su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Auditing File Upload And Content Handling in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-file-upload-and-content-handling
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'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
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Auditing File Upload And Content Handling in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Auditing File Upload And Content Handling non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Auditing File Upload And Content Handling non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello 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.

Domande frequenti

Cosa fa la skill IA Auditing File Upload And Content Handling?

Verifica il flusso di caricamento e gestione dei file per individuare file forniti da un aggressore, i cui byte, tipo dichiarato, nome o contenuto incorporato raggiungono una destinazione che li archivia in un percorso servito o eseguibile oppure li passa a un parser che agisce sul loro contenuto, dopo aver esaminato il livello che decide il tipo e il comportamento di pubblicazione. Include un’estensione o un content-type considerati attendibili per determinare il tipo, ma contraddetti da un secondo livello; un file SVG, HTML o XML archiviato e servito inline come contenuto attivo; lo sfrut...

Perché usare Auditing File Upload And Content Handling su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Auditing File Upload And Content Handling è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Auditing File Upload And Content Handling in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-file-upload-and-content-handling. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Auditing File Upload And Content Handling?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Auditing File Upload And Content Handling?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Auditing File Upload And Content Handling: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Auditing File Upload And Content Handling è gratuita?

Sì. È pubblicata su GitHub da UnboundCompute con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇