Logo di Auditing Cors And Cross Origin Trust

Auditing Cors And Cross Origin Trust

Organizzazione
UnboundCompute
auditing-cors-and-cross-origin-trust

Verifica il codice e la configurazione che decidono l'accesso cross-origin, cercando casi in cui il browser si fida di un'origine e consente così di leggere dati autenticati. Include risposte che riflettono un'origine arbitraria della richiesta nell'header allow-origin insieme ad allow-credentials, allowlist che accettano l'origine null, corrispondenze nell'allowlist basate su prefisso, suffisso, sottostringa o pattern non ancorati che accettano origini simili, l'uso dell'header origin come difesa di autorizzazione o contro la falsificazione delle richieste e gestori di messaggi tra finestre che elaborano dati senza verificare origine e sorgente esatte. L'ambito è il codice e la configurazione che determinano la decisione, non la scansione degli header in tempo reale. Usalo per esaminare gli header di risposta cross-origin, la logica di accesso basata sull'origine o i gestori di messaggi tra finestre. L'origine della richiesta o il messaggio inviato è la sorgente; la lettura cross-origin autenticata o il gestore del messaggio è la destinazione; il bug consiste nel fidarsi di un'origine controllata dall'attaccante.

Panoramica

Pubblicato daUnboundCompute
Repositorysecurity-agent-skills
Nome della skillauditing-cors-and-cross-origin-trust
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 Cors And Cross Origin Trust 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-cors-and-cross-origin-trust
  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-cors-and-cross-origin-trust .claude/skills/auditing-cors-and-cross-origin-trust
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Auditing Cors And Cross Origin Trust 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 Cors And Cross Origin Trust 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 Cors And Cross Origin Trust 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 CORS and cross-origin trust: when an attacker's origin is trusted

The request origin is fully attacker-controlled: any site the victim visits sets it. Cross-origin sharing is safe only because the server decides, per origin, whether to hand back an authenticated response, and a browser enforces that decision. The bugs are all the same shape: the server trusts the origin it was told. It reflects whatever origin arrived and pairs it with credentials, so any site reads the victim's authenticated data; it matches an allowlist by substring, so a lookalike passes; it treats the origin as proof of who is calling. The client-side mirror is a message handler that acts on a posted message without checking where it came from. You find these by reading the code that builds the allow-origin decision, or handles a cross-window message, and asking whether an attacker-set origin is trusted.

When to use

  • The code sets cross-origin response headers, statically or by computing them from the request origin.
  • An access, authorization, or request-forgery decision is made by looking at the origin or referer.
  • Client code receives cross-window messages and acts on their data.

Scope check

Test cross-origin behavior only against applications you own or are authorized to assess, from a test origin and test accounts. A confirmed credentialed cross-origin read exposes real user data, so coordinate. If you can't name the authorization, stop.

The loop

  1. Map the decision points. Find where the allow-origin and allow-credentials headers are set and whether the origin value is static or reflected from the request, where any access or request-forgery logic reads the origin or referer, and where client code registers a cross-window message handler. These are the sources and sinks the rest of the loop examines.

  2. Check reflected origin with credentials. The dangerous combination is an allow-origin header set to the arbitrary incoming origin together with allow-credentials enabled, on an endpoint that returns cookie-authenticated data. That lets any site read the victim's authenticated response. A wildcard without credentials on genuinely public data is not this bug.

  3. Check the allowlist match and the null origin. If the origin is validated against an allowlist, read how. A prefix, suffix, substring, or unanchored pattern match accepts a lookalike origin that contains or ends with the allowed string, and an unescaped separator in a pattern matches more than it appears to. An allowlist that contains the literal null origin trusts a value an attacker can force from a sandboxed context. Only an exact match against a fixed set is a real check.

  4. Check the origin as an authorization or request-forgery defense. The origin and referer are spoofable from non-browser clients and sometimes absent, so any access or state-change decision that relies on them as the sole control is bypassable. Flag origin-based authorization and origin-only request-forgery protection.

  5. Check cross-window message handlers. A message handler that reads the message data into a sink, the document, navigation, or evaluation, without checking that the origin exactly matches an expected value lets any origin drive that sink. Flag a missing origin check, a weak one, and a handler that also fails to confirm the source window; flag sending a secret to a wildcard target as well.

  6. Confirm and record. Confirm a header finding by issuing a cross-origin request from a test origin and showing the response is readable with credentials attached; confirm a message finding by posting from an unexpected origin and reaching the sink. Kill the lead if the wildcard carries no credentials on non-sensitive data, the endpoint is authenticated by a token the browser will not attach cross-site rather than a cookie, allow-credentials is absent so the body is unreadable, the allowlist is an exact match, or the message handler only reads inert data. Record the endpoint or handler, the trusted value, and what it exposed.

Where cross-origin trust leaks

  • The origin is the attacker's to set. Every check that trusts it without an exact allowlist is trusting the attacker. Reflection is the extreme case: trusting all of them.
  • Credentials are what make a cross-origin read matter. Reflected origin plus credentials plus authenticated data is the exploitable triple; drop any one and the severity collapses.
  • Substring matching is the classic allowlist bug. A suffix test for a domain also accepts a lookalike that ends with it; only exact equality against a fixed set holds.
  • The origin is not an identity. Using it for authorization or as the only request-forgery defense trusts a header a non-browser client sets freely.
  • A message handler is a cross-origin entry point in the page. Without an exact origin and source check, any site that can open the window drives whatever the handler does with the data.

Worked example (a confirm and a kill)

Confirm. An account endpoint sets the allow-origin header to the incoming request origin and enables allow-credentials, and returns the signed-in user's profile from a session cookie. A page on an attacker origin issues a credentialed cross-origin request and reads the victim's profile. Confirmed reflected origin with credentials, high, remediation = set allow-origin only from an exact-match allowlist, never reflect an arbitrary origin with credentials, and add a vary-on-origin response so a shared cache cannot cross responses.

Kill. The same endpoint validates the origin against a fixed set by exact equality and only then echoes it, rejects the null origin, sets a vary-on-origin response, and elsewhere authorizes by a token the browser does not attach cross-site rather than by the origin; the one message handler checks the event origin by exact equality and the source window before using the data. A request from a test origin is not reflected and cannot read the body. Killed, kill_reason = "origin echoed only on exact-match allowlist without the null origin, credentials not exposed to unlisted origins, and message handler validates origin and source before its sink."

Rationalizations to reject

  • "We only reflect origins we trust." -> Reflecting the incoming origin trusts all of them unless an exact-match allowlist gates it first. Read the gate, not the intent.
  • "The wildcard is fine, it is public data." -> Then it is fine, and this is not the finding. The bug is a reflected or listed origin paired with credentials on authenticated data.
  • "We check the origin ends with our domain." -> A suffix check accepts a lookalike that ends with your domain. Only exact equality is a check.
  • "We block cross-site requests by checking the origin." -> A non-browser client sets the origin freely and sometimes omits it; origin alone is not a request-forgery defense.
  • "The message handler is internal." -> Any origin that can open or frame the window can post to it. If the handler reaches a sink, it needs an exact origin and source check.

Executing this in practice

You need the code that sets the allow-origin and allow-credentials headers and whether the origin is reflected or listed, the allowlist match logic, any origin-based authorization or request-forgery check, and every cross-window message handler with the sink it feeds. For each, decide whether an attacker-set origin is trusted and whether credentials or a real sink make it matter. Reading the code tells you the match shape; a credentialed request from a test origin, or a message from an unexpected one, tells you whether it holds.

Related

  • testing-client-side-dom-vulnerabilities - the cross-window message handler is a client-side sink both skills care about; that one covers the injection it can cause in depth.
  • auditing-webhook-authenticity-and-callback-trust - a sibling trust-boundary audit where an attacker-controlled value is trusted without proof.
  • reviewing-content-security-policy - the other browser-enforced control on the same pages; a weak policy and a permissive cross-origin decision often compound.
  • FINDING-SCHEMA.md - source = the request origin or posted message, sink = the credentialed cross-origin read or the message sink, evidence = the readable authenticated response or the sink reached from an unexpected origin.

Domande frequenti

Cosa fa la skill IA Auditing Cors And Cross Origin Trust?

Verifica il codice e la configurazione che decidono l'accesso cross-origin, cercando casi in cui il browser si fida di un'origine e consente così di leggere dati autenticati. Include risposte che riflettono un'origine arbitraria della richiesta nell'header allow-origin insieme ad allow-credentials, allowlist che accettano l'origine null, corrispondenze nell'allowlist basate su prefisso, suffisso, sottostringa o pattern non ancorati che accettano origini simili, l'uso dell'header origin come difesa di autorizzazione o contro la falsificazione delle richieste e gestori di messaggi tra finestr...

Perché usare Auditing Cors And Cross Origin Trust su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Auditing Cors And Cross Origin Trust è 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 Cors And Cross Origin Trust in TypingMind?

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

Quali modelli IA possono usare Auditing Cors And Cross Origin Trust?

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 Cors And Cross Origin Trust?

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

La skill IA Auditing Cors And Cross Origin Trust è 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 👇