Skip to content
Access control Disclosed report Beginner

Possible to invite any team member without being logged in. [ Session Management Issue ]

An invitation API endpoint kept accepting requests after the user logged out, because the bearer token was not invalidated on logout. An attacker holding a captured token could still invite new team members, including with administrator role, after the victim had logged out.

basant0x01 Follow

Originally disclosed on HackerOne

Medium 6.1 View original
  • Triaged in 35 hours
  • Fixed in 7 days
  • Disclosed after 9 days

Hi, I would like to report session management issue to you, while testing i found that we can easily invite or we can easily perform invite related action, even we logged out from the the account. This mean the session are not properly managed. I didn't checked the other functionality under session management but this can prove the session won't expired after the account admin logout from his account.

Screenshot_from_2021-08-26_12-05-45.png
Screenshot_from_2021-08-26_12-05-45.png From the original on HackerOne

#STEP TO REPRODUCE:

  1. Login to your account
  2. Go to the invite and intercept the invite request from the burp suite
JavaScript
POST /studio/invitations?_ga=1033804257.1629921862&tenantId=583b9369-f31c-4355-bcc4-785aad9cf78f HTTP/2
Host: api.courier.com
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0
Accept: application/json, text/plain, */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/json; charset=UTF-8
Content-Length: 57
Origin: https://www.trycourier.app
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: cross-site
Authorization: eyJraWQiOiJPRTlwVkdlQUtCVTNxMnFlTnFPWXB6YVpobm9FK1NnaUYwdGhtMkFaSU1nPSIsImFsZyI6IlJTMjU2In0.eyJzdWIiOiJiN2UzNzI2Ny0zOWQwLTQwNzUtOTVlMS01NTIyYzNhOWRiM2YiLCJhdWQiOiI1ZjRmbWVjMnFudXNjcDg5cWJ0OG5zdWZ0aiIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJldmVudF9pZCI6IjQwYmU4Y2UzLTkxZDAtNGU0Yi1hOWE1LTBmZmVkOWUxMjAzYiIsInRva2VuX3VzZSI6ImlkIiwiYXV0aF90aW1lIjoxNjI5OTIzOTU3LCJpc3MiOiJodHRwczpcL1wvY29nbml0by1pZHAudXMtZWFzdC0xLmFtYXpvbmF3cy5jb21cL3VzLWVhc3QtMV9wdGJSenFpTHciLCJjb2duaXRvOnVzZXJuYW1lIjoiYjdlMzcyNjctMzlkMC00MDc1LTk1ZTEtNTUyMmMzYTlkYjNmIiwiZXhwIjoxNjI5OTYwMTkzLCJpYXQiOjE2Mjk5NTY1OTMsImVtYWlsIjoiaWxvdmVidWdib3VudHlAZ21haWwuY29tIn0.gbqkE49TaxOgYwCnSkAUeausim-Phn-D1lWu_ZEuwFRGP1lBpzzNnlA3-AOCfPDjjAcueeHZJtWyMYBuDTKzFE5ZONOwo1LOyDS8TU--Ud_NAw1NO52HmeQZHGGstk4mkYd7ceAco1YpakRjaJ3SsSZlafOIk6jw6y82_ylodr1_F8iNY5--mqW5D_ioKSgcjQGpNj_ytNIQdCPsowz-LWOoNaEtwT4MjydYB1SJ1HtLNKyVatfdEWAS3FDsBaR2nOBG_Yp7hoC4leuiYTtSkPR0PlEJBqBlbRR8FJHF4-Ksa7x3D-3tQvLHq62HyVMH25QHuyQYvKbyLEFKEEr8HQ
Referer: https://www.trycourier.app/
Te: trailers

{"email":"[email protected]","role":"ADMINISTRATOR"}
  1. Now logout from your account and try to send the request again. The expectation is "Session Expired or Login to perform the action". but the request executing successfully without being logged in to account.
JavaScript
HTTP/2 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 135
Date: Thu, 26 Aug 2021 06:13:32 GMT
X-Amzn-Requestid: 4785534c-81b7-454e-b89e-ffee8fc9014f
Access-Control-Allow-Origin: https://www.trycourier.app
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Amzn-Remapped-Content-Length: 135
X-Ratelimit-Remaining: 34
X-Amz-Apigw-Id: EqSZ4EhOIAMFdHw=
Vary: Origin
X-Ratelimit-Limit: 50
X-Content-Type-Options: nosniff
X-Amzn-Trace-Id: Root=1-6127310b-7cd190a16e3ea71251218f51
X-Cache: Miss from cloudfront
Via: 1.1 239ab88732bfa02ab05c2b2116638aeb.cloudfront.net (CloudFront)
X-Amz-Cf-Pop: TPE51-C1
X-Amz-Cf-Id: b4UjaeoBTQuIFaG-eI-Fvyv44U_i8HIVnX_DaBlHqS7VQDjF0kOzNA==

{"code":"eyJlbmNyeXB0ZWREYXRhIjoiMWFjYjRlNzU4MjNmNDhlZWJlNTJjZWEwMTE5ZGIxOTkiLCJpdiI6IjQ3ZWQyZmNmZGVhM2E4OTYyM2VkYTE1Y2U0OTFkMzE2In0="}

SOLUTION:

  1. Instantly expire the session once the account admin logouts from his account.

#Please let me know if you need any extra information

Impact

Once the session is hijacked, attacker can easily perform the request even the account admin revoke his session.

The original report as published on HackerOne, by basant0x01. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the API validated only the signature and expiry of the bearer token and never checked a server-side revocation list, so logout on the client did not invalidate the token.

Impact

A stolen or captured token could still be used to invite users, including administrators, even after the account owner logs out, so logout does not end the attacker's access.

What the attacker needed

A valid session token; ability to capture the invite request

The fix

The session or token should be revoked server-side immediately on logout so replayed requests are rejected.

How it was found

  1. Log in to the account.
  2. Capture the invitation request in an intercepting proxy.
  3. Log out of the account.
  4. Replay the captured invitation request and observe it still succeeds.

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 report has not been written yet. The Original tab links to the source.

When you log in, the site gives your browser a token that proves who you are. Logging out should make that token useless. Here it did not, so anyone who copied the token could keep acting as the user, for example adding people to the team.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by basant0x01

View all

12 more disclosed reports, best first.

More from Courier

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.