# CORS on Internal and Local Services
> Unauthenticated intranet apps, localhost agents and LAN devices that send `Access-Control-Allow-Origin: *` (or never needed CORS at all) let any web page the victim visits use the victim's network position as the credential: it can read data, and through simple requests it can act.
## How it works
`*` cannot carry cookies, but on these targets nothing needs to be carried. The "auth" is that the browser sits on the VPN, LAN or loopback. Attacker JS in the victim's browser reaches the internal host, and `*` lets it read the response ([[raw/outpost24.com/exploiting-trust-weaponizing-permissive-cors-configurations-6598|Outpost24]]). HackTricks puts it the same way: an unauthenticated loopback or internal API is still CSRF-able because "the victim browser contributes its network position instead of a cookie" ([[raw/book.hacktricks.xyz/csrf-cross-site-request-forgery-hacktricks-2874|HackTricks CSRF]]).
Even without `*`, simple requests (form-encoded, multipart or `text/plain` POSTs) reach the service. CORS only hides the response ([[raw/medium.com/eight-doors-one-key-chaining-misconfigurations-into-full-account-takeo-12490|Eight Doors]], [[raw/tib3rius.com/web-appsec-interview-questions-5906|Tib3rius]]).
**Browser network-access controls and their gaps**
- Private Network Access: a request from a more public to a more private address space sends a preflight with `Access-Control-Request-Private-Network: true` and needs `Access-Control-Allow-Private-Network: true` back. WebSockets skip it, so CSWSH against private IPs still works ([[raw/blog.includesecurity.com/cross-site-websocket-hijacking-exploitation-in-2025-include-security-r-5000|Include Security]]).
- Local Network Access (Chrome 142, Firefox 151, Edge 143) prompts before cross-origin requests to localhost. Neither CORS nor LNA blocks **top-level navigations**, so a form POST still lands ([[raw/securitylabs.datadoghq.com/rce-in-opencode-ghsa-632h-h47v-g4x4-12148|Datadog OpenCode]]).
- Older history: Zoom's localhost server returned data encoded in image dimensions to work around CORS, and browser vendors pointed to the CORS-RFC1918 proposal as the eventual fix (CVE-2019-13449/13450) ([[raw/medium.com/zoom-zero-day-4-million-webcams-maybe-an-rce-just-get-them-to-visit-yo-974|Zoom zero-day]]).
## Techniques / payloads
- **Read an unauthenticated API** ([[raw/getastra.com/cve-2026-34839-cors-vulnerability-in-glances-rest-api-4910|Astra]]):
```js
fetch('http://<victim-ip>:61208/api/4/all').then(r => r.json()).then(exfil)
```
- **Steal secrets embedded in internal SPAs**: internal apps with permissive CORS expose API keys hardcoded in their client-side JS to any internet origin. AWS and other SaaS APIs send `ACAO: *`, which encourages putting credentials in browser code in the first place ([[raw/trufflesecurity.com/trufflehog-the-chrome-extension-6955|TruffleHog]]).
- **Drive a local daemon to RCE**: `*`-CORS plus no auth let a page POST to `/api/apps/install-private-space`, read the `job_id`, and poll `/api/apps/job-status/<uuid>` ([[raw/jfrog.com/breachying-the-perimeter-how-one-http-request-can-hijack-your-ai-robot-13039|JFrog]]).
- **CORS-blocked JSON, so switch to a form**: when the preflight fails, resend as `application/x-www-form-urlencoded` or as `text/plain` with a JSON-looking body via a top-level form submit ([[raw/securitylabs.datadoghq.com/rce-in-opencode-ghsa-632h-h47v-g4x4-12148|Datadog OpenCode]]).
## Notable cases
- **Glances CVE-2026-34839**: `glances -w -B 0.0.0.0` exposes `/api/4/all` (processes, network interfaces, host fingerprint) to any origin with no auth. Fixed after 4.5.2 ([[raw/getastra.com/cve-2026-34839-cors-vulnerability-in-glances-rest-api-4910|Astra]]).
- **Reachy Mini robot**: FastAPI on 0.0.0.0:8000, `allow_origins/methods/headers=["*"]`, no auth, mDNS-advertised. A page triggers a pip install of an attacker HF Space using the operator's HF token (CVE-2026-96455), giving a reverse shell ([[raw/jfrog.com/breachying-the-perimeter-how-one-http-request-can-hijack-your-ai-robot-13039|JFrog]]).
- **OpenCode GHSA-632h-h47v-g4x4**: the local API on 127.0.0.1:4096 refused the CORS preflight, but a form POST to `/global/upgrade` installed an attacker tarball ([[raw/securitylabs.datadoghq.com/rce-in-opencode-ghsa-632h-h47v-g4x4-12148|Datadog OpenCode]]).
- **Apache Zeppelin CVE-2026-44613**: default allowed origins `*` plus `text/plain` bodies allowed forged credentialed REST and WebSocket actions. The default is now an empty allowlist ([[raw/ox.security/cve-2026-44613-turning-a-csrf-into-silent-unauthorized-actions-11104|OX]]).
- **Internal Bitbucket** (Outpost24 case 7): no auth plus `*`, so a VPN user's browser leaked private repositories ([[raw/outpost24.com/exploiting-trust-weaponizing-permissive-cors-configurations-6598|Outpost24]]).
- **Langflow**: on-prem, non-public instances were also exploitable because the request originates from the victim's browser ([[raw/obsidiansecurity.com/cve-2025-34291-critical-account-takeover-and-rce-in-langflow-3513|Obsidian]]).
## Defenses
- Bind to 127.0.0.1, require authentication even on "trusted" networks, and restrict CORS to the dashboard's real origin. Don't use `*` ([[raw/getastra.com/cve-2026-34839-cors-vulnerability-in-glances-rest-api-4910|Astra]], [[raw/jfrog.com/breachying-the-perimeter-how-one-http-request-can-hijack-your-ai-robot-13039|JFrog]]).
- Reject CORS-safelisted content types on JSON endpoints, and validate `Origin` server-side on state-changing calls ([[raw/ox.security/cve-2026-44613-turning-a-csrf-into-silent-unauthorized-actions-11104|OX]], [[raw/medium.com/eight-doors-one-key-chaining-misconfigurations-into-full-account-takeo-12490|Eight Doors]]).
- Treat `*` on internal apps as a real finding during VPN-side testing ([[raw/outpost24.com/exploiting-trust-weaponizing-permissive-cors-configurations-6598|Outpost24]]).
## Related
- [[CORS Misconfiguration]] (main guide) · [[Origin Reflection and Validation Flaws]] · [[Null Origin and Credentialed CORS]]
- [[DNS Rebinding]] · [[Cross-Site Request Forgery]] · [[JSON CSRF]] · [[MCP Security]] · [[Hardcoded Secrets]]
## Sources
- [[raw/outpost24.com/exploiting-trust-weaponizing-permissive-cors-configurations-6598|Exploiting trust: Weaponizing permissive CORS configurations]]
- [[raw/medium.com/eight-doors-one-key-chaining-misconfigurations-into-full-account-takeo-12490|Eight Doors, One Key: Chaining Misconfigurations into Full Account Takeover]]
- [[raw/obsidiansecurity.com/cve-2025-34291-critical-account-takeover-and-rce-in-langflow-3513|CVE-2025-34291: Critical Account Takeover and RCE in Langflow]]
- [[raw/getastra.com/cve-2026-34839-cors-vulnerability-in-glances-rest-api-4910|CVE-2026-34839: CORS Vulnerability in Glances REST API]]
- [[raw/jfrog.com/breachying-the-perimeter-how-one-http-request-can-hijack-your-ai-robot-13039|bREACHYing the Perimeter: How One HTTP Request can Hijack your AI Robot]]
- [[raw/securitylabs.datadoghq.com/rce-in-opencode-ghsa-632h-h47v-g4x4-12148|RCE in OpenCode (GHSA-632h-h47v-g4x4)]]
- [[raw/medium.com/zoom-zero-day-4-million-webcams-maybe-an-rce-just-get-them-to-visit-yo-974|Zoom Zero Day: 4 Million Webcams & maybe an RCE? Just get them to visit yo]]
- [[raw/trufflesecurity.com/trufflehog-the-chrome-extension-6955|TruffleHog The Chrome Extension]]
- [[raw/blog.includesecurity.com/cross-site-websocket-hijacking-exploitation-in-2025-include-security-r-5000|Cross-Site WebSocket Hijacking Exploitation in 2025 - Include Security Research Blog]]
- [[raw/tib3rius.com/web-appsec-interview-questions-5906|Web AppSec Interview Questions]]
- [[raw/book.hacktricks.xyz/csrf-cross-site-request-forgery-hacktricks-2874|CSRF (Cross Site Request Forgery) - HackTricks]]
- [[raw/ox.security/cve-2026-44613-turning-a-csrf-into-silent-unauthorized-actions-11104|CVE-2026-44613: Turning a CSRF into Silent Unauthorized Actions]]