Cross-API Vulnerability Chaining: From Misconfigured CORS to RCE
A permissive CORS policy on an OpenAPI endpoint, combined with a SameSite=None session cookie and a CSRF token reused as an authentication token, allowed an attacker to steal an admin's token and escalate a normal user to administrator. With admin rights, the attacker could execute arbitrary code through the Groovy console.
This paper documents the discovery of a critical cross-API vulnerability chain that escalates from seemingly low-severity misconfigurations into full remote code execution (RCE). A permissive CORS policy, misconfigured SameSite cookies, weak CSRF design, and the presence of a legacy JSONWS API combined to create a…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the combination of permissive CORS, SameSite=None cookies, a CSRF token reused as an auth token, and a shared session across APIs let a token leak from one API be used on another.
Impact
An attacker with a normal account could escalate to administrator and then execute arbitrary commands on the server, fully compromising confidentiality, integrity and availability.
What the attacker needed
A valid non-admin user account; admin logged in; victim clicks a crafted link; permissive CORS on the OpenAPI endpoint
The fix
The issues were fixed in Liferay DXP 2025.Q2.8 and later; the report also recommends strict CORS, SameSite=Lax or Strict cookies, independent CSRF tokens, Origin validation, restricting JSONWS, and disabling the Groovy console in production.
How it was found
- The attacker tricks an admin into visiting a crafted OpenAPI URL that loads attacker-controlled JSON.
- The attacker's server responds to the browser preflight with permissive CORS headers allowing credentials and the X-CSRF-TOKEN header.
- The admin's browser sends the X-CSRF-TOKEN (equal to p_auth) to the attacker's server, which publishes it.
- The attacker uses the leaked token in a JSONWS add-user-roles request; the SameSite=None cookie is attached automatically and no Origin check blocks it.
- The attacker's user account is granted the Administrator role.
- With admin rights, the attacker runs arbitrary code via the Groovy console.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A website can let other sites read its data if it sends loose CORS headers; here the OpenAPI endpoint did, so an attacker's page could read a secret token from the admin's browser. Because the session cookie was also sent on cross-site requests and the token doubled as a login token, the attacker could reuse it to make the admin's browser perform admin actions. Finally, the admin console allowed running code, turning admin access into full server control.
What is CORS?
A permissive cross-origin policy lets another site read responses with the user's credentials.