Skip to content
Account takeover Write-up Intermediate

Securing the Computer Security Course: Discovering a Session Hijacking Vulnerability in EPFL's COM-301 Website

The three sibling homework websites shared the same secret key for signing session cookies, but assigned different user IDs to the same student. An attacker could reuse their remember_token from an intermediary site to authenticate as another student on the main grading site, and because one intermediary site was intentionally XSS-vulnerable and the cookie lacked HttpOnly, they could steal tokens from many students.

Thomas Houhou Follow

Published on thomashouhou.com

One year ago, during my 3rd bachelor year at EPFL, I was following COM-301's Computer Security course, an introductory course to security. The final exam was coming in a few days.

Thomas Houhou (@Th0h0), on thomashouhou.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

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

How it worked

Root cause

Likely the three sibling applications shared the same signing secret while maintaining inconsistent user ID mappings across sites, and the remember_token cookie was not marked HttpOnly.

Impact

Any student could access another student's grading panel, and by combining this with the intentional XSS on one intermediary site and the missing HttpOnly flag, an attacker could steal many students' tokens and pivot to their accounts on the main site.

What the attacker needed

A student account on the course websites; victim visits a malicious URL (for mass theft)

The fix

The report was made to the lab, which identified the root cause, and the fix could be deployed in the following semester.

How it was found

  1. Authenticate to an intermediary homework website and obtain a remember_token cookie containing the user ID and its signature.
  2. Reuse that remember_token cookie against the main grading website, where the same numeric ID belongs to a different student.
  3. Access the other student's grading panel.

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

A session cookie is like a wristband that proves who you are after logging in. The three course websites used the same secret stamp to sign these wristbands, but gave the same person different numbers on each site. So a wristband from one site could be used on another site to pretend to be a different student. One site also let attackers run their own code in victims' browsers, letting them steal wristbands from many students.

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 Thomas Houhou

View all

1 more disclosed report, best first.

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.