Improper santization of edit in list feature at twitter leads to delete any twitter user's list cover photo.
The edit-list feature did not properly check ownership of the media identifier used for a List's cover photo. An attacker could point their own list's banner at a victim's banner media identifier and then delete it, which removed the victim's cover photo as well.
- Disclosed after 21 months
Summary by the program
An attacker could delete a victim’s public List banner image by setting the mediaId to the same mediaId of an existing banner image, and then removing the banner image. This ultimately deleted the victim’s banner image, which violates access controls in place that restrict unauthorized users from editing another user’s lists.
The report
Summary: Improper santization of edit list feature at twitter leads to delete any twitter user's list cover photo. from this bug attacker can delete any twitter users list's cover photo.
Description: Improper santization of edit in list feature at twitter leads to delete any twitter user's list cover photo. from this bug attacker can delete any twitter users list's cover photo. as changing a media id in attackers request makes two entity referring to single photo so when attacker deletes his cover photo automatically the media related to that gets deleted so victims cover photo also gets deleted
Steps To Reproduce:
Step 1: gain media-id(for cover photo of list) of victim easily accessible by visiting list on victims profile.
Step 2: now from attackers account create a list and change cover photo, intercept the request and change the media id to victims cover photo id.
Step 3 : after that delete list's cover photo from attackers account it will automatically delete victim list's cover photo .
Impact:
Security Impact : attacker can delete any twitter users list's cover photo.
Supporting Material/References:
POC Attached Below
- List any additional material (e.g. screenshots, logs, etc.)
Impact
Security Impact : attacker can delete any twitter users list's cover photo.
Context
X (Twitter) Lists are public collections of accounts that a user curates. A List can carry a banner image, referred to in the report as the List cover photo. The banner is a media object referenced by a media ID from the List editing flow.
The report describes an Insecure Direct Object Reference in the List edit feature, specifically in how the banner media ID is handled. The program's own summary states the outcome plainly: an attacker could delete a victim's public List banner image by setting the mediaId to the same mediaId as an existing banner image and then removing the banner image. That deleted the victim's banner and violated the access controls that are supposed to stop unauthorised users from editing another user's Lists.
The affected asset is listed as *.twitter.com, the weakness as Insecure Direct Object Reference, the severity as medium with a CVSS score of 4.3, and the report was disclosed on 18 September 2023.
Setup
The report does not describe any special tooling, versions or configuration. The preconditions that follow from the steps are:
- An attacker account able to create a List and set a cover photo.
- A victim account with a public List that has a banner image.
- The ability to intercept and modify the attacker's own HTTP request, since step 2 requires changing the media ID in flight.
No credentials, tokens or request captures are included in the report text.
Finding it
The researcher's observation is about how the banner media ID is treated when a List is edited. The media ID for a victim's List cover photo is not a secret: it is exposed simply by visiting the List on the victim's profile. The edit flow, however, accepted the attacker's media ID and associated it with the attacker's List.
The reasoning in the report is that changing the media ID in the attacker's request makes two entities refer to a single photo. When the attacker then deletes their own cover photo, the media behind it is deleted, and because the victim's List points at the same media, the victim's cover photo disappears too. In other words, the bug is not just that an attacker can point their List at someone else's image; it is that the shared reference means a delete on the attacker's side cascades to the victim's asset.
Exploitation
Step 1: obtain the victim's media ID
The media ID for the cover photo of a List is easily accessible by visiting the List on the victim's profile. No request is shown in the report for this step; the point is that the identifier is public and needs no privileged access to discover.
Step 2: point the attacker's List at the victim's media
From the attacker's account, create a List and change its cover photo. Intercept the request and change the media ID to the victim's cover photo ID. The report does not include the captured request, so the exact endpoint, parameters and headers are not reproduced here.
Step 3: delete the attacker's cover photo
After step 2, delete the List's cover photo from the attacker's account. According to the report, this automatically deletes the victim's List cover photo as well.
Root cause
The report attributes the issue to improper sanitisation of the edit List feature. The report attributes the issue to improper sanitisation of the edit List feature, which allowed the attacker's List to reference the victim's media. Because the same media object is now referenced by two Lists, the delete operation performed by the attacker on their own List removes the underlying media, and the victim's List loses its banner.
The report states that the behaviour violates the access controls restricting unauthorised users from editing another user's Lists. Whether the delete path also lacked a reference or ownership check is not stated; the report only describes the outcome.
Impact
An attacker can delete any X user's List cover photo, since the media ID is obtainable by visiting the List. The action is destructive but limited to the banner image; the report does not claim any other effect on the List or the account. The program rated the issue medium with a CVSS score of 4.3.
Fix
The report does not describe the fix that was applied. Based on the root cause, the edit flow should validate that a supplied media ID belongs to the authenticated user before associating it with a List, and the delete path should not remove media that is still referenced elsewhere. Which of these was implemented is not stated.
Variants to test
- On other platforms with List, board or collection features that accept an image ID, substitute another user's public image ID in the edit request. A positive result is the attacker's collection displaying the victim's image, or the victim's image being removed when the attacker deletes theirs.
- Test the delete path separately from the edit path: after a legitimate association, delete the object and check whether media referenced by another entity is removed. A positive result is a second entity losing its image.
- Try media IDs that are visible in public pages, such as profile banners or post attachments, in any endpoint that accepts a media ID for a user-owned object. A positive result is acceptance of an ID the caller does not own.
Hunting notes
This class of bug hides in features where a client supplies an identifier for a shared resource, such as an image or media object, and the server trusts it. During recon, look for public pages that expose media IDs, since those IDs become usable inputs elsewhere. The signal is an edit endpoint that accepts an ID without an ownership check, combined with a delete operation that removes the underlying object rather than only the reference.
The report describes a concrete destructive outcome on a victim's List, and the program's summary confirms the access-control violation. That clear, reproducible consequence is what the report rests on.
What happened, in plain words
X (the platform formerly known as Twitter) lets people build Lists: public collections of accounts that someone curates, a bit like a public playlist of people. A List can have a banner image at the top, which the report calls the List cover photo. That image is stored on X's servers as a media object, and the platform refers to it by a media ID, a short identifier that points at the stored picture.
The researcher found that when you edit a List and set its cover photo, the platform accepted the media ID of another user's picture. So an attacker could take the media ID of a victim's public List banner, put it into their own List edit request, and end up with two Lists pointing at the same picture. Then, when the attacker deleted their own cover photo, the platform deleted the underlying picture, and the victim's banner vanished too.
The program's own summary puts it this way: an attacker could delete a victim's public List banner image by setting the mediaId to the same mediaId of an existing banner image, and then removing the banner image. That deleted the victim's banner and broke the access controls that are supposed to stop unauthorised users from editing another user's Lists.
The affected asset is listed as *.twitter.com, the weakness as Insecure Direct Object Reference, the severity as medium with a CVSS score of 4.3, and the report was disclosed on 18 September 2023.
Background concepts, from zero
Before the steps make sense, a few ideas need unpacking.
- A web request: when you click something in a browser, the browser sends a message to a server asking it to do something, and the server sends back a reply. That message is a request. Most of the time you never see it.
- An API: the set of addresses and rules a website's own pages use to talk to its servers. Think of it as the service counter behind the shop front: the page you see is the shop, and the API is the counter where the actual work gets done. When you change a cover photo, your browser is calling an API behind the scenes.
- Intercepting a request: using a tool that sits between your browser and the server so you can pause a request, look at it, change it, and then let it continue. It is like intercepting a letter before it is posted, editing a line, and sealing it back up.
- A media ID: a label for a stored file, such as a picture. It is not the picture itself, just a name the server uses to find it. Two different things can hold the same label and end up pointing at the same file.
- Insecure Direct Object Reference (IDOR): a bug where the server lets you name an object directly (here, a media ID) and does not check that the object is yours. It is like a hotel clerk handing out a room key to anyone who says a room number, without checking whether they booked that room.
- Access control: the rules that decide who is allowed to do what. The rule here is that you may edit your own Lists, not someone else's.
- Sanitisation: checking and cleaning up the values a user sends before acting on them. Improper sanitisation means that check is missing or too weak.
- CVSS: a standard scoring system for how serious a security flaw is. 4.3 is in the medium range.
Setup
The report does not describe any special tooling, versions or configuration. The preconditions that follow from the steps are:
- An attacker account able to create a List and set a cover photo.
- A victim account with a public List that has a banner image.
- The ability to intercept and modify the attacker's own HTTP request, since step 2 requires changing the media ID in flight.
No credentials, tokens or request captures are included in the report text.
Finding it
The researcher's observation is about how the banner media ID is treated when a List is edited. The media ID for a victim's List cover photo is not a secret: it is exposed simply by visiting the List on the victim's profile. The edit flow, however, accepts a media ID supplied by the client without checking that the media belongs to the caller.
The reasoning in the report is that changing the media ID in the attacker's request makes two entities refer to a single photo. When the attacker then deletes their own cover photo, the media behind it is deleted, and because the victim's List points at the same media, the victim's cover photo disappears too. In other words, the bug is not just that an attacker can point their List at someone else's image; it is that the shared reference means a delete on the attacker's side cascades to the victim's asset.
Exploitation
Step 1: obtain the victim's media ID
The media ID for the cover photo of a List is easily accessible by visiting the List on the victim's profile. No request is shown in the report for this step; the point is that the identifier is public and needs no privileged access to discover.
Why this step matters: the whole attack depends on knowing the label of the victim's picture. Because the List is public, the label is visible to anyone who looks, so the attacker does not need to break into anything to get it.
Step 2: point the attacker's List at the victim's media
From the attacker's account, create a List and change its cover photo. Intercept the request and change the media ID to the victim's cover photo ID. The report does not include the captured request, so the exact endpoint, parameters and headers are not reproduced here.
Why this step matters: this is where the missing check is exploited. The attacker's browser sends a request that says, in effect, "set my List's banner to picture X". The server accepted the attacker's request, and the result was two Lists pointing at the same stored picture. The result is two Lists, the attacker's and the victim's, both pointing at the same stored picture.
Step 3: delete the attacker's cover photo
After step 2, delete the List's cover photo from the attacker's account. According to the report, this automatically deletes the victim's List cover photo as well.
Why this step matters: the attacker is only allowed to delete their own banner, and on the surface that is all they do. But because both Lists share the same underlying picture, deleting it from one side removes the file itself, and the victim's List is left without a banner. The attacker never touches the victim's account directly; the shared reference does the damage.
Root cause
The report attributes the issue to improper sanitisation of the edit List feature. The report attributes the issue to improper sanitisation of the edit List feature, which allowed the attacker's List to reference the victim's media. Because the same media object is now referenced by two Lists, the delete operation performed by the attacker on their own List removes the underlying media, and the victim's List loses its banner.
The report states that the behaviour violates the access controls restricting unauthorised users from editing another user's Lists. Whether the delete path also lacked a reference or ownership check is not stated; the report only describes the outcome.
Impact
An attacker can delete any X user's List cover photo, since the media ID is obtainable by visiting the List. The action is destructive but limited to the banner image; the report does not claim any other effect on the List or the account. The program rated the issue medium with a CVSS score of 4.3.
Fix
The report does not describe the fix that was applied. Based on the root cause, the edit flow should validate that a supplied media ID belongs to the authenticated user before associating it with a List, and the delete path should not remove media that is still referenced elsewhere. Which of these was implemented is not stated.
Variants to test
- On other platforms with List, board or collection features that accept an image ID, substitute another user's public image ID in the edit request. A positive result is the attacker's collection displaying the victim's image, or the victim's image being removed when the attacker deletes theirs.
- Test the delete path separately from the edit path: after a legitimate association, delete the object and check whether media referenced by another entity is removed. A positive result is a second entity losing its image.
- Try media IDs that are visible in public pages, such as profile banners or post attachments, in any endpoint that accepts a media ID for a user-owned object. A positive result is acceptance of an ID the caller does not own.
Hunting notes
This class of bug hides in features where a client supplies an identifier for a shared resource, such as an image or media object, and the server trusts it. During recon, look for public pages that expose media IDs, since those IDs become usable inputs elsewhere. The signal is an edit endpoint that accepts an ID without an ownership check, combined with a delete operation that removes the underlying object rather than only the reference.
The report describes a concrete destructive outcome on a victim's List, and the program's summary confirms the access-control violation. That clear, reproducible consequence is what the report rests on.
Glossary
- API: the set of addresses and rules a website's pages use to talk to its servers, like a service counter behind a shop front.
- Access control: the rules deciding who may do what; here, who may edit a List.
- Banner / cover photo: the image shown at the top of a List.
- CVSS: a standard score for the seriousness of a security flaw; 4.3 is medium.
- Cascade: when one action causes a knock-on effect elsewhere, such as a delete removing a shared file.
- Client: the software on your side, usually your browser, that sends requests.
- Endpoint: a specific address on a server that accepts a particular kind of request.
- HTTP request: the message a browser sends to a server asking it to do something.
- IDOR (Insecure Direct Object Reference): a bug where the server lets you name an object directly and does not check that it is yours.
- Intercept: to pause and inspect or change a request between browser and server.
- List: a public collection of accounts curated by a user on X.
- Media ID: the label the platform uses to find a stored file such as a picture.
- Media object: a stored file on the platform, such as an image.
- Ownership check: a server-side test that the object being referenced belongs to the person making the request.
- Parameter: a named value sent with a request, such as a media ID.
- Reference: a pointer from one thing (a List) to another (a picture); several things can reference the same picture.
- Request: see HTTP request.
- Sanitisation: checking and cleaning the values a user sends before acting on them.
- Server: the computer that stores data and answers requests.
- Severity: how serious a flaw is judged to be, here medium.
- Token: a piece of data proving who you are; the report includes none.
- Vulnerability: a weakness in software that can be abused.