Skip to content
CORS Advisory Intermediate CVE-2024-41659

GHSL-2024-034: Privilege escalation in memos - CVE-2024-41659

The memos application reflected any Origin header in Access-Control-Allow-Origin and set Access-Control-Allow-Credentials to true, allowing a malicious website to make credentialed cross-origin requests. An attacker could read private information or change a user's password and take over the account.

Kwstubbs Follow

Originally disclosed on GitHub Security Lab

A CORS misconfiguration exists in memos where an arbitrary origin is reflected with Access-Control-Allow-Credentials set to true. This may allow an attacking website to make a cross-origin request, allowing the attacker to read private information or make privileged changes to the system as the vulnerable user account.

Kwstubbs, on GitHub Security Lab

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

How it worked

Root cause

The CORS middleware reflected the request Origin and allowed credentials for all non-gRPC responses, instead of restricting to trusted origins.

Impact

An attacker could read private information or change a user's password and take over the account, but the proof of concept worked only in Firefox due to third-party cookie policies in other browsers.

What the attacker needed

Victim uses Firefox; victim visits attacker page; victim clicks on the page; victim is logged in to memos

The fix

The maintainer disabled CORS with credentials by default.

How it was found

  1. The attacker hosts a webpage that sends a credentialed cross-origin request to the memos API.
  2. The victim visits the attacker's page and clicks anywhere on it.
  3. The browser sends the request with the victim's cookies to the memos API.
  4. The server responds with the reflected Origin and allows credentials, so the attacker's script can read the response or perform a privileged change.

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.

CORS is a browser rule that lets a website ask another site for data. Here the server told the browser that any website was allowed to read its responses, even when the user was logged in. So a bad website could act as the logged-in user, for example by changing their password.

What is CORS?

A permissive cross-origin policy lets another site read responses with the user's credentials.

More by Kwstubbs

View all

43 more disclosed reports, best first.

More from GitHub Security Lab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

CORS misconfiguration

The lesson behind this report.

A permissive cross-origin policy lets another site read responses with the user's credentials.