Subscribe to the Non-Human & AI Identity Journal

Cross-Origin Resource Sharing

CORS is a browser security control that decides whether one origin may read responses from another origin. It does not authenticate users or protect servers by itself. Instead, it governs which browser-based requests may be exposed to JavaScript after the server returns a response.

Expanded Definition

Cross-Origin Resource Sharing, or CORS, is a browser-enforced policy layer that decides whether JavaScript running on one origin may read a response from another origin. It sits on top of the same-origin policy and is usually implemented through response headers such as Access-Control-Allow-Origin, not through authentication logic. The NIST Cybersecurity Framework 2.0 emphasises governance, access control, and secure data exposure, which makes CORS relevant as an application control that shapes what the browser can reveal. Usage in the industry is still evolving when teams mix CORS with API authentication, federation, or token validation, and definitions vary across vendors when gateway products advertise “CORS security” as a broader protection than the browser actually provides.

For NHI and API security, CORS is about exposure of data to browser code, not whether an endpoint is reachable or whether a secret is valid. A permissive CORS setting can let a malicious origin read sensitive responses if the server also reflects credentials or allows trusted origins too broadly. The most common misapplication is treating CORS as an authentication control, which occurs when teams assume blocked browser reads mean the API itself is protected.

Examples and Use Cases

Implementing CORS rigorously often introduces friction for front-end teams, requiring organisations to weigh cross-site usability against tighter origin controls and more careful testing of credentialed requests.

  • A single-page application on app.example calls an API on api.example, and the API returns a narrow allowlist so only the production frontend can read JSON responses.
  • A browser-based admin console uses credentialed requests, so the server must avoid wildcard origins and ensure the response varies safely by origin and method.
  • A partner portal exposes data to a third-party dashboard, but only specific origins are permitted after review of the partner’s integration pattern and data sensitivity.
  • A security team investigates why an endpoint is visible to the network but unreadable in JavaScript, then confirms the browser is enforcing the CORS policy as intended.
  • An incident review links a misconfigured permissive origin to response exposure, similar in spirit to the kind of trust-boundary failures discussed in the ASP.NET machine keys RCE attack, where a weak control around a sensitive boundary amplified impact.

For browser-side guidance, the NIST Cybersecurity Framework 2.0 is useful for mapping CORS decisions to access governance, data protection, and secure interface management.

Why It Matters in NHI Security

CORS matters because many NHI workflows now expose tokens, API-backed dashboards, and automation interfaces through browsers. If the policy is too broad, browser-based code from an untrusted origin may read responses that include secrets, operational metadata, or high-value identity context. That is especially dangerous when service accounts, API keys, or agent credentials are surfaced through web consoles and then reused across systems. NHI Mgmt Group research shows that ASP.NET machine keys RCE attack illustrates how weaknesses around trust boundaries can become exploit paths once a protected interface is mishandled.

The operational issue is not just leakage, but false confidence: teams may think a browser warning equals security, while the backend remains reachable and the credential remains live. That matters in environments where 79% of organisations have experienced secrets leaks, with 77% of those incidents causing tangible damage, according to NHI Mgmt Group research. Browser access controls should therefore be paired with lifecycle controls, secret rotation, and origin review, not used as a substitute for them. Organisations typically encounter CORS as a root-cause topic only after a front-end data exposure or API incident, at which point the control becomes operationally unavoidable to address.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST CSF 2.0 and NIST SP 800-63 set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
NIST CSF 2.0 PR.AC-3 CORS supports controlled access to web resources by limiting who can read responses.
NIST SP 800-63 Identity assurance is separate from browser-origin policy and should not be conflated with CORS.
OWASP Non-Human Identity Top 10 NHI-02 Mismanaged browser exposure can leak secrets and credentials tied to NHI workflows.

Audit browser-facing endpoints for secret exposure and narrow origin permissions wherever sensitive NHI data appears.