Join our Newsletter — 33% off our NHI Course
Home› FAQ› Threats, Abuse & Incident Response› How do attackers use JSON hijacking, also called…
Threats, Abuse & Incident Response

How do attackers use JSON hijacking, also called JavaScript hijacking?

← Back to all FAQ
By NHI Mgmt Group Editorial Team Updated October 19, 2026 Domain: Threats, Abuse & Incident Response

Attackers use JSON hijacking to steal data from vulnerable endpoints that return sensitive JSON to authenticated browsers without proper anti-CSRF protections. They abuse browser behaviour and cross-origin request handling to read information they should not see. Defenders should avoid exposing sensitive data in unauthorised JSON responses, require anti-CSRF controls, and verify content types and access checks.

How JSON hijacking works in practice

JSON hijacking targets browsers that will send authenticated requests automatically, then exposes sensitive JSON through a response that can be abused from another origin. The attacker relies on a vulnerable endpoint returning data in a form that script execution or browser quirks can read, instead of treating the response as private application data bound to the legitimate session.

It is not the same as stealing cookies directly. The weakness is usually that the application exposes sensitive JSON without enough anti-CSRF protection, and the browser is tricked into delivering data to attacker-controlled code. That makes the issue fundamentally about access control on the response, not just about the request.

Why vulnerable JSON endpoints are attractive

Endpoints that return account details, profile data, token-like values, or other authenticated content are attractive because the browser will often attach existing session context without extra user action. If the application does not force a response pattern that resists cross-origin reading, an attacker can sometimes turn a normal data fetch into a data leak.

Web Application Attacks Guide covers the broader attack family that includes JSON hijacking, CSRF, and related cross-origin web abuse patterns. That matters because the practical defence is usually a combination of request validation, response hardening, and careful endpoint design rather than a single control.

How defenders close the exposure

The safest pattern is to avoid returning sensitive data in unauthorised JSON responses at all, and to require anti-CSRF controls wherever a browser session can reach protected data. Teams should also verify content types, reject unsafe cross-origin assumptions, and make sure access checks happen before any sensitive object is serialised into a response.

Where an endpoint is intended for browser use, defenders should treat the response format as part of the security boundary. If a JSON payload can be consumed as executable script, or if the application exposes sensitive records without confirming the requester is allowed to see that exact object, the endpoint remains at risk even when authentication is present.

Risk and Threat Considerations

JSON hijacking creates confidentiality risk because it converts an authorised browser session into a data source for an untrusted origin. The exposure is greatest when the endpoint returns personal, financial, or otherwise sensitive objects and assumes authentication alone is enough to protect the response.

Failure mechanism: The application returns sensitive JSON in a browser-consumable form without sufficient CSRF resistance or content handling restrictions, allowing attacker-controlled script or browser behaviour to obtain data cross-origin.

Impact: Attackers can read protected records from authenticated sessions, which can expose customer data, internal account state, or other information that should never leave the trusted application context.

Standards & Framework Alignment

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

OWASP API Security Top 10 addresses the attack and risk surface, while NIST SP 800-53 Rev 5, OWASP ASVS and CIS Controls v8 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP API Security Top 10API2 — Broken AuthenticationJSON hijacking depends on trusted browser sessions and weak request validation.
Recommendation — Harden authenticated API responses so cross-origin abuse cannot read protected data.
NIST SP 800-53 Rev 5AC-6 — Least PrivilegeLimit what a session can retrieve so exposed JSON contains the minimum necessary data.
IA-5 — Authenticator ManagementSession-backed browser access makes credential and session handling central to preventing misuse.
Recommendation — Restrict returned data to the least privilege needed for each authenticated user. Protect session credentials and rotate or revoke them when exposure is suspected.
OWASP ASVSV10 — OAuth and OIDCBrowser session trust and cross-origin flow handling are relevant to authenticated data exposure.
Recommendation — Validate browser-authenticated flows so protected data cannot be read through unsafe cross-origin patterns.
CIS Controls v8CIS-6 — Access Control ManagementSensitive JSON exposure is prevented by controlling who can access each response path.
Recommendation — Review and restrict every endpoint that returns sensitive data to authenticated users.

Practitioner Guidance

What to verify: Confirm whether any authenticated endpoint returns sensitive JSON to a browser session, especially if the same data can be reached through multiple routes or is meant to support legacy front-end code. If the endpoint can be invoked cross-origin, treat it as a candidate for response hardening review.

Decision rule: If the response contains data that would be damaging to expose, require a design that blocks cross-origin reading by default, then validate that access control is enforced before serialisation. Do not rely on authentication alone when the browser itself is part of the attack path.

Practitioner takeaway: JSON hijacking is usually a response-design failure, not just a request-validation failure, so the right fix is to make sensitive browser-delivered data unreadable to untrusted origins even when a user is already signed in.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on October 19, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org