InfoSec Write-ups

A collection of write-ups from the best hackers in the world on topics ranging from bug bounties and CTFs to vulnhub machines, hardware challenges and real life encounters. Subscribe to our weekly newsletter for the coolest infosec updates: https://weekly.infosecwriteups.com/

Follow publication

Simple CORS misconfig leads to disclose the sensitive token worth of $$$

Hey fellow hacker’s and Bug hunters , Recently i found some weird CORS misconfiguration in one of my targets.

If you don’t know what is CORS then learn from here.

Let’s assume the target as target.com . I started to extract the subdomains of target and saved it as target_subdomains.txt and extracted waybackurls for all the subdomains.

cat target_subdomains.txt | waybackurls >> target_waybackurls.txt

The waybackurls file has huge number of urls count of 10 lakh+ lines.

I started to search for sensitive words like token,password,amount etc… After 1–2 hours of searching , I’ve found one api endpoint which looks like

https://www-api.target.com/api/user/info/email

This api endpoint leaks the token which is used to authenticate a user for many api endpoints.this api response has two headers as

Access-Control-Allow-Origin: https://target.com
Access-Control-Allow-Credentials: true

I changed the Origin header in request as http://mysite.com but the response didn’t allowed that mysite.com and again i gave the origin as mysite.target.com now the target allowed this origin.

So, After this i simply gave the Origin as mysitetarget.com .Surprisingly it allowed this origin . i was like WTH!!!!

Now i can able to steal any user’s token from mysitetarget.com origin .I only need to buy the mysitetarget.com .

— — — — — — — — — — — — — — — — — — END — — — — — — — — — — — — — — — — —

Follow me for more bug hunting writeup’s

Follow me on Instagram : https://www.instagram.com/ram_0x_infosec/

Follow me on Twitter : https://twitter.com/Ram00733925

Connect with me on Linkedin : https://www.linkedin.com/in/ram0xinfosec/

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Published in InfoSec Write-ups

A collection of write-ups from the best hackers in the world on topics ranging from bug bounties and CTFs to vulnhub machines, hardware challenges and real life encounters. Subscribe to our weekly newsletter for the coolest infosec updates: https://weekly.infosecwriteups.com/

Written by Ramalingasamy

Security Engineer | CTF Player at TamilCTF

Responses (1)

Write a response