# Limited path traversal in Node.js SDK leads to PII disclosure

Passing `.` as a Stripe resource ID in the Node.js SDK normalizes the URL path, turning a retrieve call into a list call that leaks all checkout sessions with PII.

- Payout: $1,000
- Severity: medium
- Program: Stripe
- Found by: zerodivisi0n
- Disclosed: 2023-10-10
- Write-up quality: 7/10
- Original: https://hackerone.com/reports/1575014
- Library page: https://bugbountylibrary.com/r/h1%3A1575014
- Tags: area:web domain:api impact:data-leak impact:pii-leak kind:bounty platform:hackerone sev:medium tech:nodejs technique:parser-differential vuln:access-control vuln:info-disclosure vuln:path-traversal

**Target:** Stripe Node.js SDK / checkout sessions retrieve endpoint
**Root cause:** Node.js HTTP client normalizes `/v1/checkout/sessions/.` to `/v1/checkout/sessions/`, so a retrieve-by-id call silently becomes a list-all call; the SDK did not validate or encode the identifier.
**Steps:**
1. Set up accept-a-payment sample with Node server and STRIPE_SECRET_KEY.
2. Complete a payment so a checkout session exists.
3. Send `curl "http://localhost:4242/checkout-session?sessionId=."`.
4. Server calls stripe.checkout.sessions.retrieve('.') which normalizes to the list endpoint.
5. Response is a list of all checkout sessions including customer email, name, address, payment_intent.
**How found:** Noticed that `.` and `..` are accepted as identifiers across API methods; hypothesized Node's HTTP path normalization would collapse the trailing `/.` to `/`, converting retrieve into list; confirmed only Node.js SDK affected by testing other SDKs.
**Exploitation:** Any unauthenticated user hitting an app endpoint that forwards a user-supplied sessionId to the Node SDK retrieve method can pass `.` (or `..`) to force the list endpoint, dumping all successful payments' PII without auth.
**Insight:** When an SDK builds URLs by string concatenation and the runtime normalizes paths, test `.`/`..`/`%2e` as resource IDs to pivot a single-object GET into a collection GET; check each language SDK separately since normalization differs.

## Proof of concept (copied exactly from the original report)

**Curl request with dot sessionId**

```
curl "http://localhost:4242/checkout-session?sessionId=." | jq
```

