Skip to content
IDOR Write-up Intermediate

Adding Descriptions to Instagram Posts on Behalf of Other Users

An IDOR flaw in Instagram's IGTV editing endpoint allowed an attacker to add a description to any public post that lacked one by swapping the media ID in the request. The attacker could modify other users' posts, including those of high-profile accounts.

Sarmad Hassan Follow

Published on blog.flawminers.com

Instagram, launched in October 2010, is a widely used social media platform recognized for its emphasis on sharing photos and videos. Users create profiles to engage with a global audience, sharing visually compelling moments.

Sarmad Hassan, on blog.flawminers.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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 4 min read.

Context

Instagram is a social media platform launched in October 2010 and owned by Meta. Users create profiles and share photos and videos with a global audience. Over time the platform added features such as Stories, IGTV and Reels. IGTV, introduced in 2018, lets users watch long-form vertical videos from creators.

The finding concerns the editing of an IGTV post: the request that saves a caption (description) and title for a video. The report describes an Insecure Direct Object Reference (IDOR) in that feature which let an attacker add a description to another user's post when that post had none.

Setup

The researcher used two things: an attacker-controlled Instagram account and the media ID of a victim's post. The interception tool named in the report is Burp Suite, used to capture and modify the edit request. The only precondition stated is that the victim's account must be public, so that the attacker can see the victim's posts. The report does not give any version numbers for the app, the API or Burp Suite.

Finding it

The IGTV edit request identifies the post being edited by a media ID carried in the URL path. Because the ID is a direct reference to an object and the server did not check that the object belonged to the caller, changing the ID in an otherwise valid request pointed the edit at someone else's post.

Exploitation

Step 1: create and edit an IGTV video

Upload an IGTV video from the attacker's account and start editing it. This produces a legitimate edit request that the attacker is authorised to make.

Step 2: intercept the edit request

Capture the request with Burp Suite. The report shows it as:

HTTP
POST /media/1887820989027383407/edit/
caption=<your_post_description_here>&publish_mode=igtv&title=test

The path segment 1887820989027383407 is the attacker's own media ID. The body carries the caption to be set (caption=), the mode publish_mode=igtv, and a title value of test.

Step 3: choose the victim's media ID

Obtain the media ID of a victim's post that has no description. The report does not describe how the ID is obtained beyond the requirement that the victim's posts are visible to the attacker, which the public-account condition provides.

Step 4: swap the ID

Replace the attacker's media ID in the intercepted request with the victim's media ID, leaving the rest of the request as it was.

Step 5: send the modified request

Submit the request. The server responds with an Internal Server error carrying the message "Oops, an error occurred."

Step 6: verify the result

Despite the error response, refresh the victim's post page. The description supplied by the attacker is now present on the victim's post.

Root cause

The edit endpoint takes the media ID from the request path and applies the caption and title to that object without verifying that the authenticated caller owns it. The report does not include the server-side code, so the exact check that was missing is not shown; the behaviour is consistent with an authorisation check on object ownership being absent or ineffective.

Impact

An attacker can add a description to posts of other users that are missing one. The report states the exploit works across all post types, including photos, videos and IGTV posts, and is limited to public accounts, because the attacker needs visibility of the victim's posts.

The report frames the risk around public profiles: many users have public accounts and many public accounts have posts without descriptions, so the bug applies to a large number of accounts. It notes that high-profile individuals with millions of followers, naming Mark Zuckerberg and Lionel Messi as examples, could be targeted, and that misuse could be aimed at generating media coverage, creating conflict between companies or public figures (it gives Apple and Samsung as an example), spreading misinformation or controversy through social media, and enabling social engineering by manipulating public perception or exploiting trust. It also raises legal and privacy concerns from unauthorised manipulation of high-profile accounts and the resulting damage to reputation and trust in the platform.

Fix

The report records that the bug was successfully fixed on 15 August 2018, one day after triage, and that the researcher confirmed the fix the same day.

Variants to test

  1. Swap the media ID in other object-scoped edit endpoints (caption, title, location, tagging) and check whether the change lands on an account you do not control. A positive result is the modification appearing on the other account's post after a refresh.
  2. Try IDs belonging to different post types (photo, video, IGTV) against the same endpoint. A positive result is the edit applying across types, as the report says it did here.
  3. Send the request with a valid ID you own but a body field you should not be able to set, and compare the response with the cross-account case. A positive result is the same error message paired with a persisted change.
  4. Repeat the swap against a private account you have no access to. A positive result is the edit applying anyway, which would remove the public-account limitation described here.
  5. Check whether the error response hides a successful write on other endpoints: send a request that returns an error and then re-read the object. A positive result is state changed despite the failure message.

Timeline

Date Actor Event
6 August 2018 Sarmad Initial bug report
14 August 2018 Meta Bug Bounty Report triaged
15 August 2018 Meta Bug Bounty Bug successfully fixed
15 August 2018 Sarmad Fix confirmed
10 October 2018 Meta Bug Bounty Bounty awarded

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 11 min read.

What happened, in plain words

Instagram is a social media platform that launched in October 2010 and is owned by Meta. People create profiles and share photos and videos with a global audience. Over the years Instagram added features such as Stories, IGTV and Reels. IGTV, introduced in 2018, lets people watch long-form vertical videos from creators.

Posts on Instagram can have a caption, the short piece of text that sits under a photo or video. Some posts have no caption at all. This report is about a bug that let one person add a caption to somebody else's post when that post had none.

To understand the bug you need one idea: when you edit your own post, your browser sends a request to Instagram's servers. That request contains an identifier for your post, a long number called a media ID. The servers look at the number and save your new caption on the post with that number. The bug was that the servers did not check whether the post with that number actually belonged to you. So if you changed the number to somebody else's post, Instagram saved your caption on their post instead.

Security people call this an Insecure Direct Object Reference, or IDOR. The name sounds complicated but the idea is simple. Imagine a hotel where every room key is just the room number written on a card, and the front desk never checks that the number on your card matches the room you booked. You booked room 101, but nothing stops you writing 102 on the card and walking into that room. The room number is the direct reference, and the missing check is what makes it insecure. Here the media ID is the room number and the caption edit is the door.

The report was written by Sarmad Hassan. The finding was reported to Meta's bug bounty programme, which pays people for reporting security problems, and the timeline at the end shows how it was handled.

The finding

In 2018 Instagram introduced IGTV, a feature for watching long-form vertical videos from creators. The report describes a vulnerability in the IGTV feature: an IDOR bug that let an attacker add descriptions to posts of other users that were missing one.

A few details about the scope of the bug, as the report states them:

  • The attacker can add descriptions to posts that lack one.
  • The exploit works across all post types, including photos, videos and IGTV posts.
  • It is limited to public accounts, because the attacker needs to be able to see the victim's posts.

That last point matters. A public account is one whose posts anyone can view. A private account only shows its posts to approved followers, so an outsider cannot see the post in the first place and has nothing to aim at.

Reproduction steps

These are the steps the researcher followed to prove the bug. I will go through each one and explain why it was done.

Step 1: upload and edit an IGTV video from your own account

The first move is to do something completely normal: upload an IGTV video to an account you control and start editing it. The reason is that you need a real, legitimate request to look at. When you edit your own post, your browser sends a request that Instagram accepts because the post really is yours. That request becomes the template you will later tamper with. If you tried to build the request from scratch you would have to guess at its shape; capturing a genuine one removes the guesswork.

Step 2: intercept the editing request

An intercepting tool sits between your browser and the website. Normally your browser talks straight to Instagram's servers. With a tool like Burp Suite in the middle, the request passes through the tool first, and the tool can pause it, show it to you, and let you change it before it continues on its way. The report names Burp Suite as the tool used here.

The captured request looks like this:

HTTP
POST /media/1887820989027383407/edit/
caption=<your_post_description_here>&publish_mode=igtv&title=test

Line by line:

  • POST /media/1887820989027383407/edit/ is the first line of an HTTP request. HTTP is the language browsers and servers use to talk to each other. POST is the method, which means "I am sending data that should change something on the server". The part after it is the path, the address of the thing being changed. Here the path points at a media item with the ID 1887820989027383407, followed by /edit/, which says the action is an edit. That long number is the attacker's own media ID, the identifier of the video they just uploaded.
  • caption=<your_post_description_here>&publish_mode=igtv&title=test is the body of the request, the data being sent. It is written in a format called form encoding, where each field is a name, an equals sign and a value, and fields are joined with &. The caption= field holds the description to be saved; the placeholder <your_post_description_here> stands for whatever text you want. publish_mode=igtv tells the server this is an IGTV post. title=test sets the title to the word test.

So the whole request says: "change the post with ID 1887820989027383407, set its caption to this text, treat it as an IGTV post, and give it the title test." Because the ID belongs to the attacker, Instagram has every reason to accept it.

Step 3: obtain the media ID of a victim's post without a description

Next you need the ID of somebody else's post, specifically one that has no description yet. The report does not explain how the ID is obtained beyond the requirement that the victim's posts are visible to the attacker, which the public-account condition provides.

Step 4: replace the attacker's media ID with the victim's

Now edit the captured request. Leave everything else alone and swap only the number in the path, so the request points at the victim's post instead of your own. This is the heart of the attack. The request still looks valid in every other way: it has the right shape, the right fields and the right values. The only thing that changed is which object it refers to. If the server checked ownership, it would refuse. The whole question is whether it does.

Step 5: submit the modified request

Send the changed request on to Instagram. The server responds with an Internal Server error carrying the message "Oops, an error occurred." An Internal Server error is a general "something went wrong on our side" response. On its own it looks like the request failed, and a casual attacker might stop here and assume the attempt did not work.

Step 6: refresh the victim's post page

Despite the error, go and look at the victim's post. Refresh the page and the description supplied by the attacker is now there. This is the surprising part: the server reported a failure, yet the change had already been saved. The report does not explain why the error appeared despite the description being added.

Why this bug poses a severe threat

The report sets out the risk in a series of points.

  • Wide user exposure. Millions of Instagram users have public profiles, so the pool of possible targets is very large.
  • Pervasive lack of descriptions. Many public accounts have posts without descriptions, so the bug applies to a vast number of accounts.
  • Targeting high-profile users. The bug allows malicious actors to target high-profile individuals, such as celebrities like Mark Zuckerberg and Lionel Messi, who have millions of followers.
  • Potential for media exploitation. In the wrong hands the bug could be used to generate sensational media coverage by targeting celebrities, leading to significant public attention and potential reputational damage.
  • Inter-company conflict. Malicious use could create conflicts between prominent companies or public figures, amplifying tensions or disputes, such as between competitors like Apple and Samsung.
  • Amplification through social media. Exploiting the bug on influential accounts could cause a ripple effect, spreading misinformation or creating controversies that gain widespread attention through social media platforms.
  • Social engineering opportunities. The bug opens avenues for social engineering attacks, as attackers could manipulate public perception, exploit trust, or engage in identity-related fraud. Social engineering means tricking people into trusting something false, and a caption appearing on a famous person's post is exactly the kind of thing people trust.
  • Potential legal and privacy issues. Unauthorised manipulation of high-profile accounts raises serious legal and privacy concerns, potentially leading to legal action against the platform and impacting user trust.
  • Reputation damage and trust erosion. Targeting individuals with large followings can damage their reputation and erode trust in Instagram, affecting user confidence and engagement.

In summary, the report says the combination of the bug's widespread applicability, the potential for high-profile targeting, and the resulting social, legal and reputational consequences underscores its severe and far-reaching implications.

Root cause

The edit endpoint takes the media ID from the request path and applies the caption and title to that object without verifying that the authenticated caller owns it. The report does not include the server-side code, so the exact check that was missing is not shown. The behaviour is consistent with an authorisation check on object ownership being absent or ineffective. The error response on a successful modification suggests the request failed some later step while the write had already happened, which is why the change is visible only after a refresh.

Fix

The report records that the bug was successfully fixed on 15 August 2018, one day after triage, and that the researcher confirmed the fix the same day.

Variants to test

Once you understand one IDOR, it is worth asking where else the same pattern might appear.

  1. Swap the media ID in other object-scoped edit endpoints (caption, title, location, tagging) and check whether the change lands on an account you do not control. A positive result is the modification appearing on the other account's post after a refresh.
  2. Try IDs belonging to different post types (photo, video, IGTV) against the same endpoint. A positive result is the edit applying across types, as the report says it did here.
  3. Send the request with a valid ID you own but a body field you should not be able to set, and compare the response with the cross-account case. A positive result is the same error message paired with a persisted change.
  4. Repeat the swap against a private account you have no access to. A positive result is the edit applying anyway, which would remove the public-account limitation described here.
  5. Check whether the error response hides a successful write on other endpoints: send a request that returns an error and then re-read the object. A positive result is state changed despite the failure message.

Timeline

Date Actor Event
6 August 2018 Sarmad Initial bug report
14 August 2018 Meta Bug Bounty Report triaged
15 August 2018 Meta Bug Bounty Bug successfully fixed
15 August 2018 Sarmad Fix confirmed
10 October 2018 Meta Bug Bounty Bounty awarded

Glossary

  • API: the set of addresses and rules a program uses to talk to a server, so one piece of software can ask another to do things.
  • Authentication: proving who you are, for example by logging in with a password.
  • Authorisation: deciding what an authenticated person is allowed to do, for example whether a post belongs to them.
  • Body: the part of an HTTP request that carries the data being sent, as opposed to the address and method.
  • Bug bounty programme: a scheme where a company pays people for reporting security problems in its products.
  • Burp Suite: a tool that sits between a browser and a server so requests can be captured, inspected and modified.
  • Caption: the text attached to a post, also called a description in this report.
  • Endpoint: a specific address on a server that performs a particular action, such as editing a post.
  • Form encoding: a way of writing data as name=value pairs joined by &, used in request bodies.
  • HTTP: the language browsers and servers use to exchange requests and responses.
  • IDOR (Insecure Direct Object Reference): a bug where a request refers to an object by its identifier and the server does not check that the caller is allowed to access that object.
  • IGTV: an Instagram feature, introduced in 2018, for long-form vertical videos from creators.
  • Internal Server error: a general server response meaning something went wrong on the server side while handling the request.
  • Media ID: the long number that identifies a particular post or media item on Instagram.
  • Meta: the company that owns Instagram and other social media platforms.
  • Method: the part of an HTTP request that says what kind of action is intended, such as POST for sending data that changes something.
  • Path: the part of a request address that points at the specific thing being acted on, such as /media/1887820989027383407/edit/.
  • POST: an HTTP method used to send data that should change something on the server.
  • Private account: an account whose posts are visible only to approved followers.
  • Public account: an account whose posts anyone can view.
  • Request: a message a browser sends to a server asking it to do something.
  • Response: the message a server sends back after handling a request.
  • Root cause: the underlying reason a bug exists, as opposed to its visible symptoms.
  • Social engineering: tricking people into trusting or believing something false in order to manipulate them.
  • Triage: the first review of a reported bug, where the receiving team confirms it is real and worth acting on.
  • Vulnerability: a weakness in software that can be used to do something the owner did not intend.

More by Sarmad Hassan

View all

17 more disclosed reports, best first.

More from Meta

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Insecure direct object reference (IDOR)

The lesson behind this report.

One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.