Source Code Analysis in YSurvey — Luminate bug
The YSurvey admin panel used a cookie value to decide whether a user was an administrator, so anyone could set that cookie and gain admin access. The admin template loader also passed a GET parameter straight into a SQL query, allowing an attacker to read the database and potentially pivot to other systems.
Published on medium.com
This is going to be a really short bug and also an example of why you should do source code analysis when applicable.
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 application trusted a client-controlled cookie for authorisation and failed to sanitise a GET parameter before using it in a SQL query.
Impact
An attacker could gain admin access to a YSurvey installation and use SQL injection to read the database, potentially pivoting to other services and defacing the website.
What the attacker needed
Access to a YSurvey instance; ability to modify cookies
The fix
Yahoo discontinued YSurvey, which removed the vulnerable code.
How it was found
- Open the admin panel and observe the cookie that identifies admin status.
- In an incognito session, modify the cookie to the admin value.
- Access the admin panel of the website.
- Trigger the survey template loading request that contains the vulnerable parameter.
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 cookie is a small piece of data a website stores in your browser. Here the site trusted a cookie to say 'this person is an admin' without checking with the server, so changing the cookie let anyone pretend to be the admin. Separately, a part of the site put user input directly into a database command, which can let an attacker read or change data.
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.