Instagram's One-Click Privacy Switch
Three Instagram API endpoints that change account privacy settings lacked CSRF protection, so an attacker could make a victim's private profile public and view their private pictures. After the initial fix, the same endpoints still accepted POST requests without a CSRF token, allowing the attack to continue.
Back in April I found three CSRF issues on Instagram, stemming from their Android/iOS App API (which is slightly different from their public API - it’s hosted on their main domain and doesn’t need an access token).
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
The API endpoints for changing profile privacy did not require a CSRF token or any other proof that the request came from the legitimate user.
Impact
An attacker could make a victim's private Instagram profile public and view their private pictures; the initial fix blocked GET requests but a POST request still worked until a later patch.
What the attacker needed
Victim is logged in to Instagram; attacker can make the victim's browser send a request
The fix
The endpoints were fixed by requiring a csrftoken parameter on all requests and a _uid parameter on signed requests to prevent replay attacks.
How it was found
- Identify the three API endpoints that change profile picture and privacy settings.
- Send a GET request to the set_public endpoint to make a profile public.
- After the fix, send a POST request to the same endpoint, which still worked without a token.
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 CSRF (Cross-Site Request Forgery) attack tricks a logged-in user's browser into sending a request to a website they are already signed into, without the user meaning to. Here, the Instagram app's API accepted requests to change privacy settings without checking that the request really came from the user, so an attacker could flip a private account to public and see its photos.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.