Skip to content
Account takeover Disclosed report Beginner

Not Using Secure Flag Option on Cookies Could Lead to a Man in the Middle Session Highjacking

Session cookies (uid and user token) were sent without the Secure flag, so they could be transmitted over plain HTTP. An attacker on the same network could intercept these cookies and use them to hijack the victim's session.

yaworsk Follow

Originally disclosed on HackerOne

  • Triaged in 4 hours
  • Fixed in 12 hours
  • Disclosed after 13 hours

Hi, I noticed that your cookies are stored in plain text, without a secure flag option. As a result, if a user is logged and visits http://sandbox.veris.in/portal/, the cookies with the uid and user token are submitted.

If a malicious attacker was on the same network and managed to get a legitimate user to visit the non-secure version of the site, they would be able to intercept the two values which enables them to take over their session.

I've included a POC video, unlisted, on YouTube. In it, you'll see I am using Chrome on the left, logged in as a legitimate user. I visit the http version of the site and receive the redirect. Using chrome tools, I can see the cookies being sent - this is meant to simulate was a man in the middle attack would accomplish.

Then, with those values, I open up firefox and an existing session I have with another account. I modify my cookies with the stolen values and I am now logged in as the victim.

POC video: https://youtu.be/KiJtsDosGT8

Please let me know if you have any questions. Pete

The original report as published on HackerOne, by yaworsk. 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 session cookies were set without the Secure attribute, allowing them to be sent over unencrypted HTTP.

Impact

An attacker on the same network could intercept the cookies and take over the victim's session.

What the attacker needed

Attacker on same network; victim visits HTTP version

The fix

The cookies should be set with the Secure flag so they are only sent over HTTPS.

How it was found

  1. Log in as a legitimate user and visit the HTTP version of the site.
  2. Observe the redirect and use browser tools to see the cookies being sent.
  3. Capture the uid and user token values (simulating a man-in-the-middle attack).
  4. In another browser, modify the existing session cookies with the stolen values.
  5. Confirm that you are now logged in as the victim.

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.

Cookies are small pieces of data a website stores in your browser to remember you. The Secure flag tells the browser to send a cookie only over encrypted HTTPS connections, not over unencrypted HTTP. Without it, someone on the same Wi-Fi network could read the cookie and pretend to be you.

What is Account takeover?

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.

More by yaworsk

View all

21 more disclosed reports, best first.

More from Veris

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.