How I was able to change Reddit acquired Dubsmash’s music library sound tracks.
The UpdateSound GraphQL endpoint failed to check whether the supplied soundtrack UUID belonged to the logged-in user, allowing an attacker to change the title of any soundtrack. Because soundtrack UUIDs were publicly known, an attacker could have changed titles across the entire music library using an automated script.
Published on web.archive.org
Dubsmash, initially released in 2014, is a New York-based video-sharing social media service application for iOS and Android. On December 13, 2020, Reddit announced it had acquired Dubsmash.
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.
Context
Dubsmash is a video-sharing social media application for iOS and Android, first released in 2014 and based in New York. Users record themselves lip-syncing over soundtracks, which can include sections of songs, movies and famous quotes. Soundtracks are selected from a large music library managed by Dubsmash, and users can also upload their own soundtracks to the application. On 13 December 2020, Reddit announced that it had acquired Dubsmash.
The target of this research was the Dubsmash iOS application and its GraphQL backend. The feature under examination was soundtrack management: uploading a sound, and later editing its title. The endpoint that performs the edit is UpdateSound, served through the gateway at gateway-production.dubsmash.com.
Setup
The captured request identifies the client as the Dubsmash iOS application, version 5.20.0, build 45431, on iOS 14.0.1. Requests were captured and replayed with Burp Suite. The researcher needed a normal account able to upload a soundtrack under the "My Sounds" section, and an authenticated session, represented in the captured request by a bearer token.
The application identifies the client through a set of custom headers, including the app version, build number, platform, device ID, device language, country and timezone. The GraphQL call is made over HTTPS to the gateway host with a query string carrying build_number and platform.
Finding it
While researching the Dubsmash iOS application, the researcher found that the UpdateSound GraphQL API endpoint was vulnerable to Broken Object Level Authorization (BOLA). BOLA occurs when an application provides direct access to objects based on user-supplied input, letting an attacker bypass authorization and reach resources in the system directly. It is commonly referred to as an insecure direct object reference, or IDOR.
The specific observation was that the server did not check whether the uuid value supplied in the UpdateSound GraphQL call belonged to the logged-in user. Because the soundtrack UUID is publicly known, and is disclosed in the responses of multiple APIs, an attacker who knows a soundtrack's UUID can address that object directly through the mutation.
Exploitation
Step 1: create an object you own
The researcher uploaded a soundtrack in the Dubsmash iOS app under the "My Sounds" section. This provides a legitimate object and a legitimate editing flow to observe.
Step 2: capture the edit request
The soundtrack title was edited in the app, and the resulting GraphQL HTTP request was captured in Burp Suite. The captured request is the vulnerable one:
curl -i -s -k -X $'POST' \-H $'Host: gateway-production.dubsmash.com' -H $'X-Dmac: ' -H $'X-Remote-Config-Values: []' -H $'X-Time: 1613158267' -H $'User-Agent: Dopesmash/5.20.0 (com.mobilemotion.dubsmash; build:45431; iOS 14.0.1) Alamofire/5.4.0' -H $'X-Accept-Content-Language: en_IN' -H $'X-Device-Timezone: 19800' -H $'X-Device-Language: en' -H $'X-Device-Country: IN' -H $'X-Build-Number: 45431' -H $'Content-Length: 676' -H $'X-App-Version: 5.20.0' -H $'X-Platform: ios' -H $'Connection: close' -H $'Authorization: Bearer XXXXXX' -H $'X-Dubsmash-Device-Id: 0675382B-668E-4EB7-8313-ED96BC132DC9' -H $'Accept-Language: en-IN;q=1.0, hi-IN;q=0.9' -H $'Accept: application/json' -H $'Content-Type: application/json' -H $'X-Dmac-Version: 2' -H $'If-None-Match: W/\"88-IVjhmW06Njcacim4nwHnJNviYsE\"' \-b $'cfduid=' \--data-binary $'{\"query\":\"mutation UpdateSound($input: UpdateSoundInput!) {\n updateSound(input: $input) {\n typename\n sound {\n typename\n ...SoundFragment\n }\n }\n}\nfragment SoundFragment on Sound {\n typename\n uuid\n created_at\n sound\n name\n waveform_raw_data\n liked\n soundStatus: status\n creator {\n typename\n ...ContentCreatorFragment\n }\n share_link\n num_likes\n num_videos\n}\nfragment ContentCreatorFragment on User {\n typename\n username\n uuid\n date_joined\n followed\n has_invite_badge\n badges\n profile_picture\n}\",\"variables\":{\"input\":{\"uuid\":\"[redacted]\",\"name\":\"test12355556777\"}}}' $'https://gateway-production.dubsmash.com/graphql?build_number=45431&platform=ios'
The important parts of this request are:
- The
Authorization: Bearerheader, which carries the session of the logged-in user. - The GraphQL
mutation UpdateSound($input: UpdateSoundInput!), which takes an input object. - The
variablesobject, whoseinputcontains the object identifieruuidand the newnamefor the soundtrack. - The selection set, which asks the server to return the updated sound with its
uuid,created_at,sound,name,waveform_raw_data,liked,status,share_link,num_likes,num_videosand its creator'susername,uuid,date_joined,followed,has_invite_badge,badgesandprofile_picture.
Step 3: swap the identifier
The uuid parameter value was replaced with the UUID of another soundtrack. Soundtrack UUIDs are disclosed in the responses of multiple APIs, so obtaining one for a soundtrack the attacker does not own is straightforward.
Step 4: replay the request
The modified request was forwarded to the server, and the soundtrack title was changed. The server accepted the mutation against an object belonging to a different user, because it never verified ownership of the supplied uuid against the session token.
Root cause
The UpdateSound mutation trusts the client-supplied uuid as the object to modify and performs no ownership check against the authenticated user. Authorization is effectively reduced to authentication: a valid bearer token is enough to invoke the mutation, and the object reference inside the input decides which record is written. Since the identifier is not secret and appears in responses from multiple APIs, the missing check is the only barrier, and it is absent.
Impact
An attacker could change any soundtrack's title by supplying its UUID, because the UUID is publicly known. Beyond individual tracks, it was possible to change the titles of the entire music library's soundtracks using an automated script. The effect is an integrity compromise of shared content in the Dubsmash music library.
Fix
The recommendation was to implement an authorization check on the uuid parameter of the vulnerable UpdateSound API endpoint, by verifying the uuid value against the logged-in user's session token on the server side. Reddit's team confirmed the issue was resolved, and the report was rewarded with a $3000 bounty.
Timeline
| Date | Event |
|---|---|
| 13 Feb 2021 | Report submitted on Reddit's bug bounty program |
| 22 Feb 2021 | Reddit's security team requested more information |
| 22 Feb 2021 | Additional details shared with Reddit's security team |
| 24 Feb 2021 | Reddit's security team triaged the submission |
| 1 Mar 2021 | Reddit's team confirmed resolution and rewarded $3000 |
What happened, in plain words
Dubsmash is a video-sharing app for iOS and Android, first released in 2014 and based in New York. People use it to record themselves lip-syncing over soundtracks, which can be parts of songs, films or famous quotes. The soundtracks come from a large music library that Dubsmash manages, and users can also upload their own soundtracks. On 13 December 2020, Reddit announced that it had acquired Dubsmash.
The researcher looked at the Dubsmash iOS app and the server behind it. The feature in question was soundtrack management: uploading a sound, then later editing its title. The server endpoint that performs the edit is called UpdateSound, and it is reached through a gateway at gateway-production.dubsmash.com.
The problem was that the server let anyone edit the title of any soundtrack, not just their own. To do this, a person only needed the soundtrack's identifier, called a uuid, and that identifier was not secret: it appeared in responses from several APIs. The researcher could take a soundtrack they owned, capture the edit request, swap in someone else's soundtrack identifier, and the server would change that other soundtrack's title.
This kind of flaw is called Broken Object Level Authorization, or BOLA. It is also commonly called an insecure direct object reference, or IDOR. In plain terms: the app checks that you are logged in, but it does not check that the thing you are asking to change actually belongs to you.
Background: the product and the feature
Dubsmash lets users record short videos while lip-syncing over soundtracks. A soundtrack is the audio clip that plays under the video. Users pick soundtracks from a big library managed by Dubsmash, and they can also upload their own.
When you upload a soundtrack, it appears under a section called "My Sounds". From there you can edit its title. That edit is what the researcher focused on, because editing is a write action: it changes data on the server. If the server does not check who owns the thing being edited, anyone who can name it can change it.
Setup: what the researcher needed
To study this, the researcher used:
- The Dubsmash iOS application, as identified in the captured request by version 5.20.0, build 45431, on iOS 14.0.1.
- A normal Dubsmash account, able to upload a soundtrack under "My Sounds".
- A tool called Burp Suite, which sits between the phone and the server and lets you see and replay the requests the app sends.
- An authenticated session, represented in the captured request by a bearer token.
A few of those terms deserve a plain explanation.
An API (Application Programming Interface) is the set of addresses and rules a program uses to talk to a server. Think of it as a restaurant menu: the app orders a dish by name, and the kitchen (the server) prepares it. The app does not go into the kitchen itself; it just sends an order.
GraphQL is a particular style of API. Instead of many separate addresses, there is usually one address (here, /graphql), and the app sends a description of exactly what it wants: which operation to run and which fields to return. That description is called a query, or a mutation when it changes data.
A bearer token is a short string that proves who you are, a bit like a wristband at an event. Anyone holding the wristband is treated as the person who was given it. The app sends it in an Authorization: Bearer ... header on each request, so the server knows which account is asking.
A header is a small labelled line of extra information attached to a request, such as the app version, the device language or the token. A cookie is a similar idea, a small piece of data the browser or app stores and sends back; in this request the cookie line is present but empty.
A UUID is a long random-looking identifier, such as [redacted]. It is used to name a specific object, in this case a specific soundtrack. It is not a password: it is just a name, and names can be seen by other people.
Finding the flaw
While researching the Dubsmash iOS application, the researcher found that the UpdateSound GraphQL API endpoint was vulnerable to Broken Object Level Authorization (BOLA). BOLA happens when an application gives direct access to objects based on input supplied by the user. As a result, an attacker can bypass authorization and reach resources in the system directly. It is generally referred to as an insecure direct object reference, or IDOR.
The specific observation was that the server did not check whether the uuid value supplied in the UpdateSound GraphQL call belonged to the logged-in user. Because the soundtrack UUID is publicly known, and is disclosed in the responses of multiple APIs, an attacker who knows a soundtrack's UUID can address that object directly through the mutation.
A useful everyday comparison: imagine a cloakroom where you hand in your coat and get a numbered ticket. If the attendant hands back whatever coat matches the number you say, without checking that the ticket is yours, then anyone who guesses or sees a number can collect someone else's coat. The number is the uuid; the missing check is the vulnerability.
Exploitation, step by step
Step 1: create an object you own
The researcher uploaded a soundtrack in the Dubsmash iOS app under the "My Sounds" section. This provides a legitimate object and a legitimate editing flow to observe.
Why this step matters: to prove that a server lets you edit someone else's object, you first need to see what a normal, allowed edit looks like. Your own soundtrack gives you a known-good example, and it gives you a request you are definitely authorised to send.
Step 2: capture the edit request
The soundtrack title was edited in the app, and the resulting GraphQL HTTP request was captured in Burp Suite. The captured request is the vulnerable one:
curl -i -s -k -X $'POST' \-H $'Host: gateway-production.dubsmash.com' -H $'X-Dmac: ' -H $'X-Remote-Config-Values: []' -H $'X-Time: 1613158267' -H $'User-Agent: Dopesmash/5.20.0 (com.mobilemotion.dubsmash; build:45431; iOS 14.0.1) Alamofire/5.4.0' -H $'X-Accept-Content-Language: en_IN' -H $'X-Device-Timezone: 19800' -H $'X-Device-Language: en' -H $'X-Device-Country: IN' -H $'X-Build-Number: 45431' -H $'Content-Length: 676' -H $'X-App-Version: 5.20.0' -H $'X-Platform: ios' -H $'Connection: close' -H $'Authorization: Bearer XXXXXX' -H $'X-Dubsmash-Device-Id: 0675382B-668E-4EB7-8313-ED96BC132DC9' -H $'Accept-Language: en-IN;q=1.0, hi-IN;q=0.9' -H $'Accept: application/json' -H $'Content-Type: application/json' -H $'X-Dmac-Version: 2' -H $'If-None-Match: W/\"88-IVjhmW06Njcacim4nwHnJNviYsE\"' \-b $'cfduid=' \--data-binary $'{"query":"mutation UpdateSound($input: UpdateSoundInput!) {\n updateSound(input: $input) {\n typename\n sound {\n typename\n ...SoundFragment\n }\n }\n}\nfragment SoundFragment on Sound {\n typename\n uuid\n created_at\n sound\n name\n waveform_raw_data\n liked\n soundStatus: status\n creator {\n typename\n ...ContentCreatorFragment\n }\n share_link\n num_likes\n num_videos\n}\nfragment ContentCreatorFragment on User {\n typename\n username\n uuid\n date_joined\n followed\n has_invite_badge\n badges\n profile_picture\n}","variables":{"input":{"uuid":"[redacted]","name":"test12355556777"}}}' $'https://gateway-production.dubsmash.com/graphql?build_number=45431&platform=ios'
This is a curl command: a way to send an HTTP request from a terminal instead of from the app. Burp Suite can produce such a command from a captured request, so the researcher can replay it and change parts of it.
Line by line, in plain words:
curl -i -s -k -X $'POST': send a request, show the response headers (-i), stay quiet about progress (-s), skip certificate checks (-k), and use the POST method (-X $'POST'), which is the method used to send data to a server.-H $'Host: gateway-production.dubsmash.com': the server name the request is addressed to.-H $'X-Dmac: 'and-H $'X-Remote-Config-Values: []': app-specific headers, one empty and one carrying an empty list.-H $'X-Time: 1613158267': a timestamp header.-H $'User-Agent: Dopesmash/5.20.0 (com.mobilemotion.dubsmash; build:45431; iOS 14.0.1) Alamofire/5.4.0': tells the server which app and version is calling. The app identifies itself as Dopesmash here, with build 45431 on iOS 14.0.1, using a networking library called Alamofire.-H $'X-Accept-Content-Language: en_IN',-H $'X-Device-Language: en',-H $'X-Device-Country: IN',-H $'X-Device-Timezone: 19800': language, country and timezone settings of the device.-H $'X-Build-Number: 45431'and-H $'X-App-Version: 5.20.0': the build number and app version.-H $'X-Platform: ios': the operating system.-H $'Content-Length: 676': the size of the body being sent.-H $'Connection: close': close the connection after this request.-H $'Authorization: Bearer XXXXXX': the session token. This is the wristband that says which account is asking. The value is redacted here.-H $'X-Dubsmash-Device-Id: 0675382B-668E-4EB7-8313-ED96BC132DC9': an identifier for the device.-H $'Accept-Language: en-IN;q=1.0, hi-IN;q=0.9': which languages the client prefers.-H $'Accept: application/json': the client expects JSON back. JSON is a text format for structured data, made of names and values in curly braces.-H $'Content-Type: application/json': the body being sent is JSON.-H $'X-Dmac-Version: 2': another app-specific header.-H $'If-None-Match: W/\"88-IVjhmW06Njcacim4nwHnJNviYsE\"': a caching header, used to avoid resending data that has not changed.-b $'cfduid=': a cookie line, empty here.--data-binary $'...': the body of the request, which is the GraphQL document plus its variables.- The final URL
https://gateway-production.dubsmash.com/graphql?build_number=45431&platform=ios: the address being called, with two values in the query string.
The body is the interesting part. It contains a GraphQL document and a variables object:
mutation UpdateSound($input: UpdateSoundInput!)names the operation: a mutation calledUpdateSound, which takes one input object. A mutation is a GraphQL operation that changes data, as opposed to a query that only reads.updateSound(input: $input) { ... }says: run the update with that input, and return the fields listed inside the braces....SoundFragmentand...ContentCreatorFragmentare fragments, reusable lists of fields. TheSoundFragmentasks foruuid,created_at,sound,name,waveform_raw_data,liked,soundStatus: status,creator,share_link,num_likesandnum_videos. TheContentCreatorFragmentasks for the creator'susername,uuid,date_joined,followed,has_invite_badge,badgesandprofile_picture.- The
variablesobject supplies the actual values:"input"contains"uuid":"[redacted]"and"name":"test12355556777". In other words: change the soundtrack with that identifier so its title becomestest12355556777.
So the request says two separate things: who is asking (the bearer token) and which object to change (the uuid). The vulnerability is that the server only really checks the first.
Step 3: swap the identifier
The uuid parameter value was replaced with the UUID of another soundtrack. Soundtrack UUIDs are disclosed in the responses of multiple APIs, so obtaining one for a soundtrack the attacker does not own is straightforward.
Why this step matters: the request is otherwise completely valid. The token still belongs to the researcher's account. Only the name of the object changes, from one the researcher owns to one they do not. If the server had checked ownership, this request should have been refused.
Step 4: replay the request
The modified request was forwarded to the server, and the soundtrack title was changed. The server accepted the mutation against an object belonging to a different user, because it never verified ownership of the supplied uuid against the session token.
That is the whole proof: a normal edit request, with only the object identifier changed, succeeded on someone else's soundtrack.
Why it worked
The UpdateSound mutation trusts the client-supplied uuid as the object to modify and performs no ownership check against the authenticated user. Authorization is effectively reduced to authentication: a valid bearer token is enough to invoke the mutation, and the object reference inside the input decides which record is written. Since the identifier is not secret and appears in responses from multiple APIs, the missing check is the only barrier, and it is absent.
Authentication and authorization are easy to confuse. Authentication answers "who are you?" and is handled by the token. Authorization answers "are you allowed to do this to this thing?" and must be checked separately for every object. Here the first question was answered and the second was never asked.
Impact
An attacker could change any soundtrack's title by supplying its UUID, because the UUID is publicly known. Beyond individual tracks, it was possible to change the titles of the entire music library's soundtracks using an automated script. The effect is an integrity compromise of shared content in the Dubsmash music library.
"Integrity" here means the data is correct and unaltered. Nobody's account was taken over and no private data was read, but shared content could be renamed at will, which is still a serious problem for a platform whose product is a music library.
The fix
The recommendation was to implement an authorization check on the uuid parameter of the vulnerable UpdateSound API endpoint, by verifying the uuid value against the logged-in user's session token on the server side. In other words, before writing, the server should look up who owns that soundtrack and compare it with the account behind the token. Reddit's team confirmed the issue was resolved, and the report was rewarded with a $3000 bounty.
Timeline
| Date | Event |
|---|---|
| 13 Feb 2021 | Report submitted on Reddit's bug bounty program |
| 22 Feb 2021 | Reddit's security team requested more information |
| 22 Feb 2021 | Additional details shared with Reddit's security team |
| 24 Feb 2021 | Reddit's security team triaged the submission |
| 1 Mar 2021 | Reddit's team confirmed resolution and rewarded $3000 |
"Triaged" means the security team accepted the report as a real, valid issue and put it into their workflow.
Glossary
- API: the set of addresses and rules one program uses to talk to another, like a menu you order from.
- Authentication: proving who you are, usually with a token or password.
- Authorization: deciding whether you are allowed to perform a specific action on a specific object.
- Bearer token: a string sent with requests that proves which account is asking; whoever holds it is treated as that account.
- BOLA (Broken Object Level Authorization): a flaw where the server lets a user act on objects that do not belong to them, because it does not check ownership of the object identifier.
- Burp Suite: a tool that sits between an app and a server so you can capture, inspect and replay requests.
- Cookie: a small piece of data stored by a browser or app and sent back with requests.
- curl: a command-line tool for sending HTTP requests.
- Endpoint: a specific address on a server that performs a specific operation.
- Fragment (GraphQL): a reusable list of fields that can be included in a query or mutation.
- GraphQL: an API style where the client sends one document describing the operation and the exact fields it wants back.
- Header: a labelled line of extra information attached to an HTTP request or response.
- HTTP: the protocol browsers and apps use to exchange requests and responses with servers.
- IDOR (Insecure Direct Object Reference): another name for the same idea as BOLA, where an object is referenced directly by an identifier the user supplies.
- Integrity: the property that data is correct and has not been altered by someone who should not be able to alter it.
- JSON: a text format for structured data, made of names and values.
- Mutation (GraphQL): an operation that changes data, as opposed to a query that only reads.
- Query string: the part of a URL after the
?, carrying extra values. - Session: the state of being logged in, represented by a token or cookie.
- Token: a string that stands in for your identity or permission.
- Triaged: accepted by a security team as a valid issue and entered into their workflow.
- UUID: a long, random-looking identifier used to name a specific object; it is not a secret.
- Variables (GraphQL): the values supplied separately from the query text, such as the object identifier and the new title.
- Write action: an operation that changes data on the server, such as editing a title.