Logo: Auditing Cors And Cross Origin Trust

Auditing Cors And Cross Origin Trust

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

Iwwerpréift de Code an d'Konfiguratioun, déi den Zougrëff iwwer verschidde Origins bestëmmen, op Vertrauen, dat e Browser zum Liese vun authentifizéierten Donnéeë benotzt. Deckt eng Äntwert of, déi en arbiträren Origin aus der Ufro am Allow-Origin-Header zeréckgëtt, zesumme mat Allow-Credentials; eng Allowlist, déi den Null-Origin akzeptéiert; eng Allowlist, déi no Präfix, Suffix, Deelstring oder engem net verankerte Muster vergläicht, dat och op e gläich ausgesinnenden Origin passt; den Origin-Header, deen als Autorisatioun oder als Schutz géint Ufro-Fälschung vertraut gëtt; an e Cross-Window-Message-Handler, deen op Donnéeën reagéiert, ouni Origin a Quell genee ze kontrolléieren. Begrenz dëse Skill op de Code an d'Konfiguratioun, déi d'Entscheedung treffen, net op e Scan vu Live-Headeren. Benotzt en, wann Dir Header fir Zougrëff iwwer verschidden Origins, Zougrëffslogik op Basis vum Origin oder Cross-Window-Message-Handler iwwerpréift. Den Origin vun der Ufro oder déi geschéckt Message ass d'Quell; d'Liese vun Donnéeën iwwer verschidden Origins mat Umeldungsinformatiounen oder den Empfänger vun der Message ass den Zilpunkt; an engem vum Ugräifer festgeluechten Origin ze vertrauen ass de Feeler.

Iwwersiicht

EditeurUnboundCompute
Repositorysecurity-agent-skills
Skill-Nummauditing-cors-and-cross-origin-trust
Stären
27
Forks
8
Matgeliwwert Dateien
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    UnboundCompute huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Auditing Cors And Cross Origin Trust an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-cors-and-cross-origin-trust
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-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-cors-and-cross-origin-trust .claude/skills/auditing-cors-and-cross-origin-trust
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Auditing Cors And Cross Origin Trust an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Auditing Cors And Cross Origin Trust automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Auditing Cors And Cross Origin Trust net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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.

Heefeg gestallte Froen

Wat mécht de KI-Skill Auditing Cors And Cross Origin Trust?

Iwwerpréift de Code an d'Konfiguratioun, déi den Zougrëff iwwer verschidde Origins bestëmmen, op Vertrauen, dat e Browser zum Liese vun authentifizéierten Donnéeë benotzt. Deckt eng Äntwert of, déi en arbiträren Origin aus der Ufro am Allow-Origin-Header zeréckgëtt, zesumme mat Allow-Credentials; eng Allowlist, déi den Null-Origin akzeptéiert; eng Allowlist, déi no Präfix, Suffix, Deelstring oder engem net verankerte Muster vergläicht, dat och op e gläich ausgesinnenden Origin passt; den Origin-Header, deen als Autorisatioun oder als Schutz géint Ufro-Fälschung vertraut gëtt; an e Cross-Win...

Firwat Auditing Cors And Cross Origin Trust op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Auditing Cors And Cross Origin Trust besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Auditing Cors And Cross Origin Trust an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-cors-and-cross-origin-trust an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Auditing Cors And Cross Origin Trust benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Auditing Cors And Cross Origin Trust benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Auditing Cors And Cross Origin Trust domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Auditing Cors And Cross Origin Trust gratis?

Jo. UnboundCompute huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇