BreachHunter
Pricing Blog Log inSign up
● thermal huntscan engines onlineassessment only — no exploits
  1. Home
  2. Blog
  3. CORS Misconfiguration: When Cross-Origin Sharing Opens Your Data to Any Site

Guides · ← All guides

CORS Misconfiguration: When Cross-Origin Sharing Opens Your Data to Any Site

Published: November 14, 2026 · Last reviewed: November 14, 2026 · 7 min read

By the Ingenious AI team

The short answer: CORS is the browser mechanism that decides which other sites may read your responses with a visitor's browser. The dangerous shape an assessment probes for is the combination: a response that reflects any Origin (or sends Access-Control-Allow-Origin: *) together with Access-Control-Allow-Credentials: true — because that pairing lets any website read your logged-in pages through your visitors' browsers. BreachHunter's web-audit phase includes a dedicated CORS check that sends crafted Origin headers and reads exactly what your server answers.

Run a free BreachHunter assessment on your site →

CORS findings confuse owners because the feature is usually enabling something real: the marketing site reading the API, the partner widget, the mobile webview. Somewhere in making that work, “allow the partner” became “allow everyone” — often via the classic stack-overflow snippet that reflects the request's Origin back, which feels dynamic and is precisely the vulnerability.

This guide separates the harmless cases (public, credential-less data deliberately open) from the report-worthy ones (reflected origins, wildcard-with-credentials, null origin trust), explains how the check proves the issue from outside, and gives the allow-list pattern that keeps the integrations working.

Which CORS answers are actually dangerous?

The browser's same-origin policy is the wall; CORS is the gate list. Three answers open the gate too far. Reflect-and-credential: the server echoes any Origin it receives and allows credentials — any site on the internet can now make authenticated requests from a victim's browser and read the responses, the full “act as the logged-in user, from anywhere” package. Wildcard with credentials is nominally forbidden by browsers (they refuse the combination), but its presence signals the same intent and still fails reviews. And trusting the null origin lets sandboxed iframes and local files through a door meant for partners.

Context decides severity, which is why the check reads your actual endpoints rather than grading the concept. A public JSON of store hours under a wildcard is a design choice. The same wildcard reflected on /account or an API that returns personal data is the finding. The scanner's CORS probe targets the distinction by testing origins against real paths.

The allow-list pattern that keeps integrations alive

The fix is a server-side list, not a mirror: maintain the explicit set of origins your product genuinely integrates with (the app origin, the partner's exact scheme+host, the staging variant), compare the request's Origin against that set, and emit Access-Control-Allow-Origin only on a match — with Vary: Origin so caches do not serve one origin's permission to another. Credentials are allowed per-endpoint only where the integration truly needs them.

Then verify the way the audit does: send a request with a hostile Origin (https://evil.example) to your sensitive endpoints and confirm no allow-origin comes back, then repeat with each legitimate partner origin and confirm it does. Both directions matter — the common incident is fixing CORS so hard the partner integration dies in production, which is how the reflect-everything snippet got there in the first place.

Worked example: tempomusic.example

Tempo Music School runs enrollment on its main site and a practice-log app on a subdomain, sharing one API. To make the subdomain work, a developer had the API reflect any Origin with credentials allowed. The web audit's CORS probe demonstrated what that meant from a third origin entirely:

Request:  GET /api/students/me   Origin: https://unrelated.example
Response: Access-Control-Allow-Origin: https://unrelated.example
          Access-Control-Allow-Credentials: true
Finding: CORS — arbitrary origin reflected with credentials

The fix replaced reflection with the two-entry allow-list the school actually had (the app subdomain and the main site), added Vary: Origin, and the probe retest showed the unrelated origin receiving no CORS headers at all while the app subdomain worked unchanged. The enrollment API kept its integration and lost its “any website may read this” property — the whole content of the finding.

The five actions to take

Bringing a permissive CORS policy back to a list:

  1. Inventory who legitimately calls your API cross-origin: write the exact origins (scheme + host + port) in the change ticket.
  2. Replace reflection and wildcards with a server-side allow-list; emit headers only on a match, with Vary: Origin.
  3. Allow credentials per-endpoint only where genuinely required; never with a wildcard.
  4. Remove null from trusted origins unless a documented, sandboxed use case demands it.
  5. Probe-test both directions: hostile origin refused, each partner origin working — then re-scan.

Run a free BreachHunter assessment on your site →

Frequently asked questions

Is Access-Control-Allow-Origin: * always a vulnerability?

No — for public, unauthenticated data (a store-hours JSON, public docs) a wildcard is a legitimate publishing decision. It becomes a finding when credentials or non-public data are involved, or when * appears on endpoints that return per-user information.

Browsers block wildcard-plus-credentials anyway. Why flag it?

Because the combination usually indicates reflection logic elsewhere, and because non-browser clients and older engines handle it inconsistently. Audits report the configuration's intent; a server trying to allow everyone-with-credentials is misconfigured even where the browser saves it.

What is the null origin problem?

Requests from sandboxed iframes, redirects and some local files send Origin: null. Servers that allow-list “null” as if it were a partner hand those contexts authenticated cross-origin access — a known bypass that allow-list reviews should explicitly exclude.

Will tightening CORS break our mobile app?

Native mobile apps are not governed by CORS (it is a browser control), so tightening affects web origins only. Webviews follow the web rules — include their exact origin in the list and test, per the checklist's both-directions rule.

How does the assessment test CORS without an account?

It sends requests with crafted Origin headers and reads the response's CORS headers. Reflected or wildcard permissions are visible without credentials; what the probe proves is the policy shape. Reading actual user data would require an account — the policy alone is the finding.

A quick outside test you can run today

CORS answers are public by design, so test yours the way a stranger's browser would. Send a request carrying a foreign origin: curl -s -H "Origin: https://unrelated.example" -I https://api.yoursite.example/account and read what comes back. If the response reflects that origin in Access-Control-Allow-Origin and sends Access-Control-Allow-Credentials: true, any website can read your logged-in users' API responses. That pair is the finding.

Repeat it logged out and logged in, and against the endpoints that return personal data rather than public content. A wildcard on a public product feed is a shrug. The same wildcard reflected on an account endpoint is a breach with extra steps.

Sources

Where this guide's claims come from, in citable form:

  • MDN — Cross-Origin Resource Sharing (2025) — how browsers apply CORS answers, including credentialed requests.
  • WHATWG Fetch Standard (living standard, 2024) — the specification that defines the CORS protocol.
Share this: X · Facebook · LinkedIn · WhatsApp

Related guides

  • Website Security Test: What It Checks, What It Misses, and How to Read Yours · 9 min read
  • Website Security Cheat Sheet: Headers, TLS, Cookies and Exposed Files · 7 min read
  • What a Website Security Assessment Actually Tests · 10 min read
  • TLS/SSL Basics: What Your Certificate Says About Your Site · 8 min read
  • Common Website Misconfigurations (and How to Fix Them) · 11 min read
  • Reading Your First Pentest Report: From Score to Action · 9 min read
  • Deleted ≠ Gone: What the Wayback Machine Keeps After You Delete Your Secrets · 9 min read
  • SQL Injection in Plain English: How One Login Box Can Read Your Database · 9 min read
  • What Does a Website Security Scan Check? · 8 min read
  • Exposed .git Directory: What It Leaks and How to Check · 7 min read
  • Security Headers Missing? What Each Header Stops · 7 min read
  • How Much Does a Penetration Test Cost in 2026? · 7 min read
  • Website Security Checklist for Small Teams (60-second self-check) · 6 min read
  • Reading Your Scan Results: Which Findings Fix First? · 7 min read
  • Content-Security-Policy Missing: What CSP Does and How to Add It Safely · 8 min read
  • HSTS Missing: What Strict-Transport-Security Prevents · 7 min read
  • Clickjacking and X-Frame-Options: How Framing Attacks Work · 7 min read
  • Cookie Flags Explained: Secure, HttpOnly and SameSite · 8 min read
  • Exposed .env File: What Leaks, What Attackers Do Next, What You Do First · 8 min read
  • Directory Listing Enabled: What It Shows Attackers and How to Disable It · 7 min read
  • Mixed Content: Why Your HTTPS Page Still Loads Insecure Resources · 7 min read
  • Expired SSL Certificate: What Breaks, Why Renewal Fails, and How to Catch It Early · 7 min read
  • TLS 1.0 and 1.1 Still Enabled: Why Old Protocols Show Up as a Finding · 7 min read
  • Open Ports on a Web Server: Which Ones Should Never Face the Internet · 8 min read
  • No SPF or DMARC Record: How Missing Email Auth Exposes Your Website · 7 min read
  • Subdomain Takeover: How a Dangling DNS Record Lets Attackers Claim Your Name · 7 min read
  • Forgotten Subdomains: The Staging Site You Forgot Is Still Public · 7 min read
  • WordPress Security Scan: The Exposures an Assessment Finds on WordPress Sites · 8 min read
  • Exposed Backup Files: .bak, .old and .zip Files Sitting in Your Web Root · 7 min read
  • phpinfo() in Production: The Diagnostic Page That Maps Your Server for Attackers · 7 min read
  • Server Version Banners: Why Your Headers Point Attackers to the Right Exploit · 7 min read
  • End-of-Life Software: Running a Server Stack Nobody Patches Anymore · 7 min read
  • Open Redirect Vulnerability: How Your Own Domain Sends Visitors to a Phishing Page · 7 min read
  • Dangerous HTTP Methods: What TRACE, PUT and DELETE Should Never Answer · 7 min read
  • Host Header Injection: Poisoned Reset Links and Cache Attacks Explained · 7 min read
  • What Is security.txt? The Small File That Lets Researchers Reach You · 6 min read
  • Admin Panel Exposed to the Internet: What an Assessment Flags and Why · 7 min read
  • phpMyAdmin Exposed: Why This Database Door Is a Prime Brute-Force Target · 7 min read
  • Spring Boot Actuator Exposed: Environment Dumps, Heap Leaks and Shutdown Endpoints · 7 min read
  • Debug Console in Production: The Finding That Can Become Code Execution · 7 min read
  • Exposed AWS Credentials File: The /.aws/credentials Finding, Explained · 7 min read
  • Referrer-Policy and Permissions-Policy: The Two Quiet Headers You Are Probably Missing · 6 min read
  • Exposed package.json: Your Dependency List Is a Recon Gift · 6 min read
  • DNS Zone Transfer Open (AXFR): Handing Out Your Entire DNS Map · 6 min read
  • Certificate Name Mismatch: Why the Cert Does Not Match Your Domain · 6 min read
  • Website Security Assessments for Agencies: Checking Every Client Site Without a Security Team · 8 min read
  • SaaS Security Questionnaires: What Buyers Check About Your Website First · 8 min read
  • Ecommerce Website Security: The Exposures That Put Your Checkout at Risk · 8 min read
  • Small Business Website Security: The Checks That Matter at Your Size · 7 min read
  • How to Prepare for a Website Security Assessment (and Read the Report Calmly) · 7 min read
  • Vulnerability Severity Explained: What Critical, High, Medium and Low Actually Mean · 7 min read
  • Retest After Fixes: How to Prove a Security Finding Is Actually Closed · 7 min read
  • Security Assessment vs Vulnerability Scan vs Pentest: What Is the Difference? · 7 min read
  • How Long Does a Website Security Scan Take? · 6 min read
  • Website Security Drift: Why Last Month's Clean Scan Is Already Out of Date · 7 min read
  • WordPress Site Keeps Getting Hacked After Cleanup · 8 min read
  • Google Blacklist Removal: Getting the Red Warning Off Your Site · 8 min read
  • VirusTotal Flagged My Site: How to Clear a False Positive · 8 min read

Related from the Ingenious AI suite

  • Ingenious AI — the full suite of security and compliance tools
  • DomainGuard — domain impersonation and typosquat defense
  • See BreachHunter pricing →
BreachHunter · by Ingenious AI · read-only security assessment — scan only targets you own or are authorized to test
About · Contact · Blog · vs Intruder · Privacy · Terms · Security · Threats · Nextcloud Check · Verify Evidence · Help · Redeem
More from Ingenious AI:
DisclosureGuard — AI disclosure compliance · Vibe-Code Audit — AI code security scanner · Rogue-Agent Defense — AI agent firewall · ChatBreaker — AI chatbot red-teaming · ModelMinder — AI model deprecation radar · TermsWatch — AI vendor terms monitor · Agent Flight Recorder — tamper-evident agent audit trails · Agent Auth Gateway — agent credentials & kill switch · DomainGuard — domain impersonation defense · Agent Passport — Know-Your-Agent registry · AgentGate — agent policy publisher · AgentBlock — AI agent & crawler access control · BoundaryVault — agent log forensics · Agentic Receipts — verifiable agent payment receipts · EvalEgress — eval-to-production exposure scan · HomeShield MCP — home AI server exposure check · WireWatch — payment verification ceremony · ADMT Notice Kit — AI decision notice compliance · DueLadder — human-approved invoice chasing · Agent-Ready Store Audit — can AI agents buy from your store · ContentCraft AI — content operations · AgentReady — agent-readiness checks · AI Audit Exchange — AI audit exchange · CallbackShield — callback & webhook protection · CompanionGuard — AI companion safety guardrails · CRAClock — EU Cyber Resilience Act deadline clock · EInvoice Translator — e-invoice format translator · GEOFixer — geo & local listing fixes · MandateGuard — agent spending mandates · OutcomeMeter — AI outcome measurement · ProvenanceGuard — content provenance checks · ReviewDesk — review response desk · ReviewProof — verified review evidence · TakedownCoop — coordinated phishing takedowns · TrustGate — trust & safety gating · BreachHunter — website penetration testing · All 36 platforms — the Ingenious AI portfolio

We use cookies. Necessary cookies keep the site working. With your permission we also use analytics cookies (to understand usage) and marketing cookies (for ads). Read our privacy policy.

NecessaryRequired for login, security and core features. Always on.
AnalyticsHelps us understand which pages are useful.
MarketingUsed for advertising and measuring ad performance.

    No match. Try “pricing”, “php2shell” or “contact” — or press Esc to close.

    ↑↓ navigate · Enter open · Esc close