# Malicious reinstallation of jsm widget app (installed by default in JSM) allows extracting private oauth tokens and user data

JSM widget Connect app's /installed endpoint failed to validate JWT qsh claim, letting an attacker reinstall the app with a malicious baseurl and intercept OAuth tokens and user data.

- Payout: $10,000
- Severity: critical
- Program: Atlassian
- Found by: rjw
- Disclosed: 2021-05-11
- Write-up quality: 7/10
- Original: https://bugcrowd.com/disclosures/be80097a-2ec4-41b2-979c-61a75a81313d/malicious-reinstallation-of-jsm-widget-app-installed-by-default-in-jsm-allows-extracting-private-oauth-tokens-and-user-data
- Library page: https://bugbountylibrary.com/r/bc%3Aad5e53a0-d477-4dc9-8bda-4ec8d702364f
- Tags: area:cloud domain:cloud impact:ato impact:data-leak kind:bounty platform:bugcrowd sev:critical tech:jwt tech:oauth technique:chained technique:source-review vuln:access-control vuln:auth-bypass

**Target:** Atlassian Connect app /installed endpoint (JSM widget app) on Jira Service Management Cloud
**Root cause:** The /installed lifecycle endpoint did not verify the qsh claim of the context JWT, so a JWT captured from the browser console could be replayed to forge an installation request and rewrite the app's baseurl.
**Steps:**
1. Open Jira Service Management Cloud and capture the context JWT from the browser console
2. Craft a POST to the JSM widget app's `/installed` endpoint using the captured JWT, with a modified `baseUrl` pointing to attacker infrastructure
3. Server accepts the forged installation and updates the stored baseurl record
4. Subsequent requests from the JSM widget app server to JSM cloud are routed to the attacker's baseurl
5. Attacker intercepts OAuth tokens and user data in those requests
**How found:** Researcher inspected the JSM widget Connect app, noticed the /installed endpoint accepted a JWT without validating the qsh claim, and hypothesized a captured console JWT could be replayed to rewrite the baseurl.
**Exploitation:** Attacker with a valid context JWT (obtainable from the browser console) replays it against the unauthenticated-by-qsh /installed endpoint to hijack the app's baseurl, then passively intercepts all traffic the widget app server sends back to JSM cloud, harvesting private OAuth tokens and user data.
**Insight:** For Atlassian Connect apps, always test lifecycle endpoints (/installed, /uninstalled, /enabled) for missing qsh validation — a context JWT visible in the browser console is enough to forge installation and redirect the app's baseurl to attacker infrastructure.

