CVE-2026-77291io.jans.jans-auth-server Cross-site Scripting (XSS)
NVD
Vulnerability Summary
File: `jans-auth-server/server/src/main/java/io/jans/as/server/session/ ws/rs/EndSessionUtils.java:77-101` `createFronthannelHtml` concatenates the attacker-controlled state parameter into the body of a <script> block that calls window.location: ``` if (!Util.isNullOrEmpty(postLogoutUrl)) { if (!Util.isNullOrEmpty(state)) { if (postLogoutUrl.contains("?")) { postLogoutUrl += "&state=" + state; } else { postLogoutUrl += "?state=" + state; } } html += "<script>" + "window.onload=function() {" + "window.location='" + postLogoutUrl + "'" + // <-- JS context "}" + "</script>"; } ``` The state parameter is attacker-controlled by OAuth/OIDC spec design (it round-trips through the user-agent). Because the injection point is a JavaScript string literal (not an HTML attribute), HTML-context escaping does not help — the attacker breaks out of the JS string with a single quote and executes arbitrary JavaScript in the AS's origin. Crafted URL (victim with active session follows it): `/jans-auth/restv1/end_session?id_token_hint=<valid token> &post_logout_redirect_uri=https://target.example/ &state='+alert(document.cookie)+'` Injected JS runs in the AS's origin. Can exfiltrate cookies/session tokens, read localStorage (where OAuth client tokens may be stashed), and issue same-origin fetches with the user's credentials. Default deployments have no browser-side mitigation. The default Apache template at community-edition-setup/templates/apache/https_gluu.conf has the Content-Security-Policy header commented out: # Header always set Content-Security-Policy "default-src 'self' # 'unsafe-inline' https://%(hostname)s" Even if uncommented, the proposed value includes 'unsafe-inline' in script-src and would not block this injection. Suggested fix: JS-string-escape state and postLogoutUrl values (the cleanest approach is to JSON-encode the string, which produces a valid JS string literal): ``` String postLogoutUrlJs = JsonUtil.toJson(postLogoutUrl); html += "<script>" + "window.onload=function() {" + "window.location=" + postLogoutUrlJs + ";" + "}" + "</script>"; ``` The same applies to the logoutUri values inserted into iframe src attributes earlier in the method (HTML-attribute context; needs HTML escape). Also recommend uncommenting + tightening the CSP in the Apache template, removing 'unsafe-inline' from script-src.
CVSS v3.1 Base Metrics — Score 9.3
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:NAttack VectorNetwork
Attack ComplexityLow
Privileges RequiredNone
User InteractionRequired
ScopeChanged
ConfidentialityHigh
IntegrityHigh
AvailabilityNone
Affected & Patched Versions
- io.jans.jans-auth-server <=2.1.0
- io.jans.jans-auth-server >=2.2.0, 0.0.0-nightly
What to do
Plan remediation soon. No exploitation is confirmed yet, but the severity is critical.
- Check whether you run io.jans.jans-auth-server and which version.
- Update to a patched version listed above, then confirm the new version.
Timeline
- Jul 10, 2026Published
- Jul 10, 2026Record last modified
Score, severity and exploitation changes are tracked from the day Watchtower started logging them.
Get notified about new io.jans.jans-auth-server CVEsYou are reading CVE-2026-77291. Get an email when KEV listings, exploits or new CVEs match your stack.
Set up CVE alertsExternal References
Data last checked: Nov 25, 2026 14:00 UTC