Never Trust the Client: como consegui manipular uma aplicação com sistema antifraude
The application calculated match scores in the browser and sent them to the server, which accepted them after some antifraud checks. An attacker could alter their own score before sending it, using the opponent's score as a reference to stay within plausible values, and win matches without actually performing better.
Cybersecurity
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
The target was one of those sites where two people appear on camera and receive a score, the kind of application built around "beating" the other participant. The flow is simple: two people join a quick match using their webcam and, over a few seconds, the browser itself analyses information from the camera and calculates each participant's score.
The application also had mechanisms intended to detect fraud, such as static image detection, motion analysis and other camera-related checks. Despite those protections, there was an important problem in how the system had been built: the browser calculated the score and then told the server what the result had been.
The author notes that the tests were carried out exclusively for research and learning, with no intention of harming the service, its users or their data. Some details were simplified and the code used in the tests is not published; the goal is to share the discovery process and discuss the flaw from a security perspective, not to provide a ready-made exploit against the service.
Setup
The write-up does not describe accounts, roles, versions or a specific program. The tools used were the browser console and Burp Suite for intercepting traffic. The precondition for the whole exercise is a live match between two participants, where the browser computes the scores and sends them to the backend at the end of the round.
Finding it
Analysing the application's traffic through Burp Suite, the author found the request sent at the end of each match:
POST /api/match/finalize HTTP/2Content-Type: application/json
Among the data sent were fields such as:
{ "selfScore": 7.4, "opponentScore": 6.8}
Besides the score, there was an object called selfScanValidity, containing information generated by the camera analysis:
{ "selfScanValidity": { "microMotionScore": "...", "staticImageSuspicion": "...", "sampledFrames": "...", "landmarkStability": "..." }}
The field that drew most attention was selfScore. If that value represented the author's score and was being sent by the browser, the question was inevitable: what would happen if that value were simply changed before it reached the server?
Exploitation
Step 1: manual interception in Burp Suite
The first attempt was the most obvious path: intercept the request in Burp Suite and change selfScore by hand.
The problem is that matches happen in real time. While the request was held in Burp, the JSON edited and the send released, the other participant had already sent their result:
Minha requisição → parada no Burp para edição
Requisição do oponente → chega primeiro ao servidor ↓ partida finalizada
When the modified request finally arrived, it was too late. The problem did not seem to be the change itself, but the time taken to make it. A way had to be found to alter the value automatically.
Step 2: moving the change into the browser
The solution was to move the test to the browser console. Instead of waiting for the request to reach Burp for manual modification, a script was created that identified the end of the match and changed the data before it was sent:
Aplicação termina a partida ↓Prepara os dados ↓Script identifica a requisição ↓Altera a pontuação ↓Requisição é enviada ↓Servidor
To do this, the behaviour of fetch() was temporarily overwritten. Simplified:
const originalFetch = window.fetch;
window.fetch = function (...args) { // identifica a requisição de finalização // e altera os dados antes do envio return originalFetch.apply(this, args);};
There was no longer the delay caused by manual editing in Burp, and the modified request finally reached the server at the right moment. But the result was not what was expected. A score close to 10 was submitted, and the final grade became:
Step 3: the antifraud reacted to the camera data
At first it looked as if the server was simply ignoring the change. But an important detail emerged: while the focus was on the script and the requests, in some tests the webcam was covered or practically without movement. That directly affected the selfScanValidity data. Two fields in particular stood out:
staticImageSuspicion → muito altomicroMotionScore → praticamente zero
In other words, something like this was being sent:
Pontuação: 9.8Movimento na câmera: praticamente nenhumSuspeita de imagem estática: muito alta
To the system, that clearly did not look like a normal match. The 1.0 score was probably not an error: it was the antifraud reacting to the suspicious result.
Step 4: keeping the camera data intact
The test was repeated appearing normally in front of the webcam, leaving the camera data completely untouched. Now there was movement, blinking, small lighting changes and all the normal variation of a person in front of the camera. But there was another problem: even with the camera working normally, forcing very high values still made the score drop to 1.0. Something was still missing.
Step 5: not everything went through fetch()
During the tests, some finalisations were not being captured by the script. The reason was navigator.sendBeacon(). The Beacon API lets the browser send data in the background, including when the user is leaving the page or closing a tab. In some situations the application used that path to finalise the match, so watching only fetch() was not enough. After adapting the test to also identify those finalisations, it became possible to consistently follow what was being sent to the server.
Step 6: using the opponent's score as a reference
The remaining question was why a very high score was rejected even when the camera data was normal. The suspicion was that the backend also compared the information sent by the two participants. That made sense: if one person reports a score of 9.9 against an opponent's 5.2, but the data sent by the other participant does not match such a large difference, there is good reason to distrust that result. This explained why simply putting 9.8, 9.9 or 10 did not work: the higher the score, the easier it probably became to notice that something was wrong.
The strategy changed. The JSON already contained opponentScore, so instead of choosing a fixed score, the score the application had calculated for the opponent could be used as a reference. The logic went from:
Minha pontuação = 9.9
to:
Minha pontuação = pontuação do oponente + pequena diferença
For example, instead of turning a match like:
Oponente: 5.4Eu: 10
into something obviously out of the ordinary, the change could stay close to the values of that match:
Oponente: 6.xEu: 7.x
The values are only examples. The important point was realising that there was no need to force an absurd score: it was enough to use the match's own result as a reference and change the score just enough to stay above the opponent. Keeping the real camera data and making only that change, the result started to be accepted.
Root cause
The most interesting part is that there was no need to break the camera analysis system, nor to work out exactly how each antifraud rule worked. The match continued normally:
Pessoa real diante da câmera ↓Aplicação analisa a partida ↓Dados reais da câmera são mantidos ↓Pontuações são calculadas ↓Minha pontuação é alterada antes do envio ↓Servidor recebe o resultado
The system had several protections to work out whether the submitted score looked genuine, but the score still came from a place controlled by the user. That is the central point of the vulnerability.
In the browser, practically everything can be changed by the user: JavaScript can be modified, functions can be overwritten and requests can be altered before they reach the server. Hence the well-known rule: never trust the client. Here the browser could do all the work of analysing the camera and calculating match information, but it was also allowed to have direct influence over something as important as the score the server would use.
The antifraud checks did work: very high scores were rejected, strange camera data was identified, and incompatible results were apparently also treated as suspicious. But all of those protections were trying to answer the question "does this score the browser sent me look genuine?", when the ideal would be not to depend only on the answer sent by the browser to decide the result. The comparison between participants described above is presented as a suspicion, not as something confirmed from the server side.
Impact
Under the conditions described, a participant in a live match could change their own score before submission so that it stayed just above the opponent's, while keeping the real camera data, and have the result accepted. The write-up does not describe the ranking or reward mechanics beyond the score itself, so the concrete consequence for standings or prizes is not stated. The author frames the issue as a design flaw: an important value is calculated in the browser, sent by the user and used by the server to determine the outcome.
Fix
The fix is not simply to hide the JavaScript better or make the request harder to change. Blocking DevTools, obfuscating the code or hiding the endpoint does not help either, because all of that happens on the user's device. A safer approach is to let the browser be responsible mainly for collecting the data the match needs, and leave the final decision to the server:
Navegador ↓Envia os dados necessários da partida ↓Servidor ↓Valida as informações ↓Calcula ou confirma o resultado ↓Atualiza o ranking
The more important a piece of information is to how the application works, the less sense it makes to trust the client to deliver its final value without independent validation on the server.
Variants to test
- Score or result fields in the finalisation request. Intercept the end-of-match request and look for numeric fields the client sends, such as
selfScoreandopponentScore. A positive result is a change that the server accepts. - Client-computed validity objects. Look for objects like
selfScanValiditywith fields such asmicroMotionScore,staticImageSuspicion,sampledFramesandlandmarkStability. If the server accepts a request where these are present but inconsistent with the score, the trust boundary is on the wrong side. - Alternative transport paths. Hook not only
fetch()but alsoXMLHttpRequestandnavigator.sendBeacon(). A positive result is a finalisation that appears through the Beacon API, which afetch()-only hook would miss. - Relative rather than absolute manipulation. Instead of submitting an extreme value, derive your score from the opponent's score in the same payload plus a small margin. A positive result is acceptance where a fixed high value was rejected.
- Cross-participant consistency. Compare what each side submits for the same match. If the server rejects large divergences but accepts small ones, it may be comparing the two submissions.
- Timing sensitivity. Hold the finalisation request and observe whether a late submission is discarded because the match has already been finalised by the other side. A positive result is a late request that still affects the match.
What happened, in plain words
Imagine a game show where two people sit in front of a webcam, and after a few seconds the show gives each of them a score. The person with the higher score wins. That is the kind of site described here: two people join a quick match, the camera looks at them, and a number appears for each participant.
The interesting part is where that number was calculated. It was not calculated by the company's computers (the "server"). It was calculated inside the participant's own web browser, on their own laptop, and then the browser simply told the server: "my score is 7.4, the other person's score is 6.8".
The application had several anti-cheating checks, called antifraud mechanisms. For example, it tried to notice when the camera image was a still photo instead of a living person, and it looked at how much movement there was. Those checks were real and they worked. But the fundamental problem remained: the score itself came from the browser, and the browser belongs to the player.
The author of the write-up found that by changing the score inside the browser, just before it was sent, the server would accept the altered result. The trick was not to send an absurd score like 10, because the antifraud checks noticed that. The trick was to send a score only slightly above the opponent's, so the result still looked like a normal match.
A note on ethics, which the author makes explicitly: the tests were done only for research and learning, with no intention of harming the service, its users or their data. Some details were simplified, and the code used in the tests is not published. The goal is to explain the discovery and discuss the flaw from a security point of view, not to hand anyone a ready-made exploit against the service.
The setup: what tools were used
Before the details, a few words on the tools, because they appear throughout.
- Burp Suite is a program that sits between your browser and a website. Normally your browser talks directly to the site. With Burp in the middle, every message your browser sends can be paused, read and edited before it continues on its way. Think of it as a postal worker who is allowed to open your letters, read them, change a word and then seal them again before delivery.
- The browser console is a panel built into every browser (usually opened with F12 or a right-click and "Inspect"). It lets you type JavaScript, the programming language of web pages, and run it directly in the page you are looking at. It is like being allowed to reach into the page and rearrange things while it is running.
- JavaScript is the language that makes web pages interactive. Everything that happens inside your browser, from a button changing colour to a score being calculated, is done by JavaScript running on your own machine.
The write-up does not describe accounts, roles, software versions or a specific bug bounty program. The only precondition for the whole exercise is a live match between two participants, where the browser computes the scores and sends them to the server at the end of the round.
Finding the score in the request
What a request is
When your browser needs something from a website, it sends a request. When you open a page, your browser asks the server for it. When you click "submit", your browser sends the data you typed to the server. A request has a few parts: a method (like GET to fetch something or POST to send something), an address (the URL), some headers (extra information, like the format of the data), and sometimes a body (the actual data).
The author used Burp Suite to watch the traffic of the application, meaning all the requests the browser was sending. At the end of each match, one request stood out:
POST /api/match/finalize HTTP/2Content-Type: application/json
Line by line:
POSTis the method. It means "I am sending data to the server", as opposed toGET, which means "give me something"./api/match/finalizeis the address of the feature being called.apiis short for Application Programming Interface, which is just a way for two programs to talk to each other. Here it is the browser talking to the game's server.match/finalizereads like "the match, finalise it", so this is the request that closes a match and records the result.HTTP/2is the version of the language used for the conversation between browser and server. You can think of it as the grammar both sides agree to use.Content-Type: application/jsonis a header that tells the server what format the data is in. JSON is a simple text format for structured data, using curly braces, names in quotes and values. It looks like{"name": "value"}and is the standard way web applications exchange data.
Inside that request, among the data sent, were fields such as:
{ "selfScore": 7.4, "opponentScore": 6.8}
Line by line:
- The outer curly braces
{ }mark the start and end of one JSON object, which is a bundle of named values. "selfScore": 7.4means there is a field calledselfScore(the author's own score) with the value 7.4. The name is in quotes, the value is a number."opponentScore": 6.8is the same idea for the other participant: the score the application calculated for the opponent.- The comma between the two separates the fields.
Besides the scores, there was another object called selfScanValidity, containing information generated by the camera analysis:
{ "selfScanValidity": { "microMotionScore": "...", "staticImageSuspicion": "...", "sampledFrames": "...", "landmarkStability": "..." }}
Line by line:
selfScanValidityis a field whose value is itself another object, nested inside the first one. The word "validity" suggests it is about whether the scan looked valid, that is, whether a real person was really there.microMotionScoresounds like a measure of tiny movements, the small shifts a living person makes even when trying to stay still.staticImageSuspicionsounds like a measure of how much the image looks like a still photo rather than a live person.sampledFramessounds like how many individual pictures (frames) from the camera were looked at.landmarkStabilitysounds like how steady the detected points of the face (eyes, nose, mouth) were across those frames.- The
"..."values are placeholders: the write-up shows the field names but not the actual numbers.
The field that drew most attention was selfScore. If that value represented the author's score and was being sent by the browser, the question was inevitable: what would happen if that value were simply changed before it reached the server?
Why ask that question? Because of a basic fact about how the web works. Anything that happens in your browser happens on a machine you control. The page's JavaScript runs on your computer, the data is assembled on your computer, and the request leaves from your computer. Between the moment the score is calculated and the moment it is sent, there is a gap, and in that gap the value can be changed. The author wanted to know whether the server would notice.
Step 1: changing the request by hand in Burp Suite
The first attempt was the most obvious path: intercept the request in Burp Suite and change selfScore by hand. "Intercept" means telling Burp to pause the request so it can be edited before it continues.
The problem is that matches happen in real time. While the request was held in Burp, the JSON edited and the send released, the other participant had already sent their result:
Minha requisição → parada no Burp para edição
This line says: "my request, stopped in Burp for editing". The arrow shows the request going from the browser towards Burp, where it waits.
Requisição do oponente → chega primeiro ao servidor ↓ partida finalizada
This says: "the opponent's request arrives at the server first", and then, below, "match finalised". The downward arrow shows the moment the match is closed.
When the modified request finally arrived, it was too late. The problem did not seem to be the change itself, but the time taken to make it. A way had to be found to alter the value automatically.
Why does timing matter? Because a match is a shared event between two people. The server is waiting for both results. If one side is slow, the other side's result may already have closed the match, and a late arrival is simply ignored. This is a common pattern in any live system: a message that arrives after the deadline is worthless, no matter how correct it is. So the author learned something useful from a failed attempt: the edit was probably fine, the delay was the problem.
Step 2: moving the change into the browser
The solution was to move the test to the browser console. Instead of waiting for the request to reach Burp for manual modification, a script was created that identified the end of the match and changed the data before it was sent:
Aplicação termina a partida ↓Prepara os dados ↓Script identifica a requisição ↓Altera a pontuação ↓Requisição é enviada ↓Servidor
This diagram reads, step by step, top to bottom:
- "Aplicação termina a partida": the application ends the match.
- "Prepara os dados": it prepares the data.
- "Script identifica a requisição": the script spots the request.
- "Altera a pontuação": it changes the score.
- "Requisição é enviada": the request is sent.
- "Servidor": the server receives it.
The key difference from step 1 is that the change now happens inside the browser, in the same instant the request is created, with no human in the middle and no pause. It is the difference between intercepting a letter at the post office and rewriting it as it comes out of the printer.
To do this, the behaviour of fetch() was temporarily overwritten. fetch() is the built-in JavaScript function that browsers use to send requests to a server. It is like a standard courier service: you hand it an address and a package, and it delivers. If you replace the courier with your own version, you can inspect and modify every package before it goes out.
Simplified, the first line was:
const originalFetch = window.fetch;
Line by line:
constdeclares a constant, a name that will hold a value.originalFetchis the name chosen for that constant.=assigns the value on the right to the name on the left.window.fetchis the original courier function, as provided by the browser.windowis the global object that represents the browser window; everything built into the page lives on it.- The semicolon ends the statement.
In plain words: "remember the original courier, so I can still use it later". This is essential, because the plan is to replace fetch with a custom version, and that custom version still needs to hand the package to the real courier at the end.
Then the replacement:
window.fetch = function (...args) { // identifica a requisição de finalização // e altera os dados antes do envio return originalFetch.apply(this, args);};
Line by line:
window.fetch =replaces the browser's courier with a new function.function (...args)defines that new function....argsmeans "accept any number of arguments and collect them in a list calledargs". The arguments are whatever the page passes when it callsfetch: the address, the options, the data.- The two lines starting with
//are comments, notes for humans that the browser ignores. They say "identifies the finalisation request" and "and changes the data before sending". In the published version they mark where the author's logic sat; the actual code is not shown. return originalFetch.apply(this, args);calls the original courier with the same arguments and returns its result.applyis a way of calling a function while specifying whatthisshould be inside it;thisis a special keyword meaning "the current context", and passing it through keeps the original behaviour intact.- The final
};closes the function and the assignment.
In plain words: "every time the page tries to send something, my function runs first, can look at it and change it, and then passes it to the real sender".
There was no longer the delay caused by manual editing in Burp, and the modified request finally reached the server at the right moment. But the result was not what was expected. A score close to 10 was submitted, and the final grade became:
Why is this surprising? Because the author had done exactly what they intended: the modified value reached the server on time. If the server simply believed whatever the browser said, the score should have been near 10. Instead it came back as 1.0. Something in the server had looked at the request and decided it was not trustworthy. That something is the antifraud system.
Step 3: the antifraud reacted to the camera data
At first it looked as if the server was simply ignoring the change. But an important detail emerged: while the focus was on the script and the requests, in some tests the webcam was covered or practically without movement. That directly affected the selfScanValidity data. Two fields in particular stood out:
staticImageSuspicion → muito altomicroMotionScore → praticamente zero
This reads: "static image suspicion, very high" and "micro motion score, practically zero". In other words, the camera analysis was reporting that the picture looked like a still image and that there was almost no movement.
So something like this was being sent:
Pontuação: 9.8Movimento na câmera: praticamente nenhumSuspeita de imagem estática: muito alta
Line by line:
- "Pontuação: 9.8": score 9.8, a very high value.
- "Movimento na câmera: praticamente nenhum": camera movement, practically none.
- "Suspeita de imagem estática: muito alta": suspicion of a static image, very high.
To the system, that clearly did not look like a normal match. A real person sitting in front of a camera moves, blinks and shifts slightly. A score of 9.8 combined with a frozen image is a contradiction. The 1.0 score was probably not an error: it was the antifraud reacting to the suspicious result.
This is an important lesson about how antifraud systems work. They do not just check one value in isolation; they check whether the values make sense together. A high score is not suspicious by itself. A high score next to a frozen camera is. It is like a shop assistant who does not question a large purchase, but does question a large purchase made by someone wearing a mask at three in the morning.
Step 4: keeping the camera data intact
The test was repeated appearing normally in front of the webcam, leaving the camera data completely untouched. Now there was movement, blinking, small lighting changes and all the normal variation of a person in front of the camera.
Why do this? Because the previous failure had shown that the camera data was part of the decision. If the camera data was the reason for the rejection, then fixing the camera data should remove that reason. The author was isolating one variable at a time, which is the basic method of any experiment: change one thing, keep everything else the same, see what happens.
But there was another problem: even with the camera working normally, forcing very high values still made the score drop to 1.0. Something was still missing.
So the camera data was not the only check. There was at least one more rule that a very high score was breaking. The author had to find out what it was.
Step 5: not everything went through fetch()
During the tests, some finalisations were not being captured by the script. The reason was navigator.sendBeacon().
What is that? The Beacon API lets the browser send data in the background, including when the user is leaving the page or closing a tab. The name is a good comparison: a beacon is a small signal sent out without expecting a reply. Ordinary fetch() requests can be cancelled if the page is closing, because the browser stops caring about a page that is going away. sendBeacon() exists precisely for the case where you want a last message to get out even as the page disappears.
In some situations the application used that path to finalise the match, so watching only fetch() was not enough. After adapting the test to also identify those finalisations, it became possible to consistently follow what was being sent to the server.
Why does this matter for a beginner? Because it shows that a web application can have more than one road to the server. If you only watch the front door, you will miss the parcels going out the back. In security testing, this is a recurring theme: the same action can be performed through several mechanisms, and a check that covers only one of them leaves the others open.
Step 6: using the opponent's score as a reference
The remaining question was why a very high score was rejected even when the camera data was normal. The suspicion was that the server also compared the information sent by the two participants.
That made sense: if one person reports a score of 9.9 against an opponent's 5.2, but the data sent by the other participant does not match such a large difference, there is good reason to distrust that result. This explained why simply putting 9.8, 9.9 or 10 did not work: the higher the score, the easier it probably became to notice that something was wrong.
Think of two people describing the same football match. If one says the final score was 5-0 and the other says 1-1, you do not need to have watched the match to know that at least one of them is wrong. A server can do the same reasoning with two participants' submissions.
The strategy changed. The JSON already contained opponentScore, so instead of choosing a fixed score, the score the application had calculated for the opponent could be used as a reference. The logic went from:
Minha pontuação = 9.9
which reads "my score = 9.9", a fixed number chosen in advance, to:
Minha pontuação = pontuação do oponente + pequena diferença
which reads "my score = opponent's score + a small difference". The score is now derived from the match itself rather than invented.
For example, instead of turning a match like:
Oponente: 5.4Eu: 10
which reads "opponent: 5.4, me: 10", a gap of 4.6 points, into something obviously out of the ordinary, the change could stay close to the values of that match:
Oponente: 6.xEu: 7.x
which reads "opponent: 6.x, me: 7.x", a gap of about one point. The x stands for an unspecified digit; the point is that the numbers are close to each other.
The values are only examples. The important point was realising that there was no need to force an absurd score: it was enough to use the match's own result as a reference and change the score just enough to stay above the opponent. Keeping the real camera data and making only that change, the result started to be accepted.
Why did this work? Because the change now looked like a plausible match. The camera data was real, the opponent's score was real, and the author's score was only slightly higher than the opponent's. Every individual value was believable, and the relationships between them were believable too. The antifraud checks were looking for things that did not add up, and nothing in this request failed to add up. The only false thing was the one number that mattered, and it was false by a small enough amount to hide.
The root cause
The most interesting part is that there was no need to break the camera analysis system, nor to work out exactly how each antifraud rule worked. The match continued normally:
Pessoa real diante da câmera ↓Aplicação analisa a partida ↓Dados reais da câmera são mantidos ↓Pontuações são calculadas ↓Minha pontuação é alterada antes do envio ↓Servidor recebe o resultado
Step by step:
- "Pessoa real diante da câmera": a real person in front of the camera.
- "Aplicação analisa a partida": the application analyses the match.
- "Dados reais da câmera são mantidos": the real camera data is kept.
- "Pontuações são calculadas": the scores are calculated.
- "Minha pontuação é alterada antes do envio": my score is changed before sending.
- "Servidor recebe o resultado": the server receives the result.
The system had several protections to work out whether the submitted score looked genuine, but the score still came from a place controlled by the user. That is the central point of the vulnerability.
In the browser, practically everything can be changed by the user: JavaScript can be modified, functions can be overwritten and requests can be altered before they reach the server. Hence the well-known rule: never trust the client. Here the browser could do all the work of analysing the camera and calculating match information, but it was also allowed to have direct influence over something as important as the score the server would use.
The antifraud checks did work: very high scores were rejected, strange camera data was identified, and incompatible results were apparently also treated as suspicious. But all of those protections were trying to answer the question "does this score the browser sent me look genuine?", when the ideal would be not to depend only on the answer sent by the browser to decide the result. The comparison between participants described above is presented as a suspicion, not as something confirmed from the server side.
A useful comparison: a bouncer checking IDs at a club is doing real work. But if the club lets each guest print their own ID at home, the bouncer is only checking whether the fake ID looks convincing. The problem is not the bouncer's eyesight; it is that the document was produced by the person being checked.
Impact
Under the conditions described, a participant in a live match could change their own score before submission so that it stayed just above the opponent's, while keeping the real camera data, and have the result accepted. The write-up does not describe the ranking or reward mechanics beyond the score itself, so the concrete consequence for standings or prizes is not stated. The author frames the issue as a design flaw: an important value is calculated in the browser, sent by the user and used by the server to determine the outcome.
In plain words: the person could have an altered score accepted, without faking the camera and without breaking any of the antifraud checks. They simply told the server a slightly better number than the truth, and the server believed it.
How to fix it
The fix is not simply to hide the JavaScript better or make the request harder to change. Blocking DevTools, obfuscating the code or hiding the endpoint does not help either, because all of that happens on the user's device.
Why not? Because the user's device is under the user's control. Hiding the code is like putting a lock on a door that the user can simply remove from its hinges. Obfuscation, meaning making code hard to read, only slows someone down; it does not stop them. Blocking the developer tools can be bypassed, and hiding the endpoint does not help because the browser still has to call it, and whatever the browser calls can be observed.
A safer approach is to let the browser be responsible mainly for collecting the data the match needs, and leave the final decision to the server:
Navegador ↓Envia os dados necessários da partida ↓Servidor ↓Valida as informações ↓Calcula ou confirma o resultado ↓Atualiza o ranking
Step by step:
- "Navegador": the browser.
- "Envia os dados necessários da partida": sends the data the match needs.
- "Servidor": the server.
- "Valida as informações": validates the information.
- "Calcula ou confirma o resultado": calculates or confirms the result.
- "Atualiza o ranking": updates the ranking.
The more important a piece of information is to how the application works, the less sense it makes to trust the client to deliver its final value without independent validation on the server.
A comparison: a restaurant does not let customers write their own bill. The customer orders, the kitchen prepares, and the restaurant calculates the total. The customer can still say what they want, but the number that matters is produced by the side that controls the money.
Variants to test
These are the general lessons the author draws, phrased as things to try on other applications with a similar design.
- Score or result fields in the finalisation request. Intercept the end-of-match request and look for numeric fields the client sends, such as
selfScoreandopponentScore. A positive result is a change that the server accepts. In plain words: find the number that decides who wins, and see whether the server checks it. - Client-computed validity objects. Look for objects like
selfScanValiditywith fields such asmicroMotionScore,staticImageSuspicion,sampledFramesandlandmarkStability. If the server accepts a request where these are present but inconsistent with the score, the trust boundary is on the wrong side. In plain words: if the anti-cheat evidence is also produced by the browser, the browser can produce convenient evidence. - Alternative transport paths. Hook not only
fetch()but alsoXMLHttpRequestandnavigator.sendBeacon(). A positive result is a finalisation that only appears through the Beacon API, which afetch()-only hook would miss. In plain words: watch every road out of the browser, not just the main one.XMLHttpRequestis the older way of sending requests from JavaScript;fetch()is the newer one;sendBeacon()is the one designed for messages sent as the page closes. - Relative rather than absolute manipulation. Instead of submitting an extreme value, derive your score from the opponent's score in the same payload plus a small margin. A positive result is acceptance where a fixed high value was rejected. In plain words: a small lie is harder to spot than a big one.
- Cross-participant consistency. Compare what each side submits for the same match. If the server rejects large divergences but accepts small ones, it may be comparing the two submissions. In plain words: check whether the server is comparing the two stories instead of checking the facts itself.
- Timing sensitivity. Hold the finalisation request and observe whether a late submission is discarded because the match has already been finalised by the other side. A positive result is a late request that still affects the match. In plain words: find out whether being slow is itself a defence, and whether that defence can be relied on.
Glossary
- API (Application Programming Interface): a defined way for two programs to talk to each other; here, the set of addresses and data formats the browser uses to talk to the game's server.
- Antifraud: automatic checks a service uses to spot cheating or fake activity, such as noticing a frozen camera image.
- Beacon API /
navigator.sendBeacon(): a browser feature for sending a small amount of data in the background, even as the page is closing. - Browser console: a panel in the browser where you can run JavaScript in the page you are viewing.
- Burp Suite: a tool that sits between browser and server so requests can be paused, read and edited.
- Client: the program on the user's side, normally the browser. The opposite of the server.
Content-Type: a request header that says what format the data is in, for example JSON.fetch(): the built-in JavaScript function browsers use to send requests to a server.- Header: extra information attached to a request or response, separate from the main data.
- HTTP/2: the version of the protocol browsers and servers use to exchange requests and responses.
- Intercept: to pause a request in a tool so it can be inspected and changed before it continues.
- JavaScript: the programming language that runs inside web pages and makes them interactive.
- JSON: a text format for structured data, using curly braces, quoted names and values.
- Method (
GET,POST): the verb of a request;GETasks for something,POSTsends something. - Never trust the client: the security rule that anything coming from the user's device must be treated as untrusted until the server checks it.
- Obfuscation: making code deliberately hard to read, without changing what it does.
- Request: a message from the browser to a server asking for something or sending data.
- Root cause: the underlying reason a vulnerability exists, as opposed to the individual symptoms it produces.
- Server: the computer that runs the application and holds the data, controlled by the service, not the user.
selfScore/opponentScore: the JSON fields carrying the author's score and the other participant's score in the finalisation request.selfScanValidity: the JSON object carrying the camera analysis results, with fields such asmicroMotionScore,staticImageSuspicion,sampledFramesandlandmarkStability.- Trust boundary: the line between what the system controls and what the user controls; data crossing it must be validated.
XMLHttpRequest: the older JavaScript mechanism for sending requests, still used by many pages.- Webcam: the camera built into or attached to a computer, used here to film each participant during a match.