Never Trust the Client: How I Manipulated an Application with Anti-Fraud Logic
A detailed technical breakdown on bypassing client-side anti-fraud checks, tampering with requests, and why server-side validation is indispensable.
Recently, while conducting tests on one of those platforms where two people face each other on camera during a quick match and receive a score, I stumbled upon a flaw that proved to be far more interesting than it initially seemed.
The premise is straightforward: two participants join a match using their webcams, and for a few seconds, the browser itself analyzes the camera feed to calculate each user’s score. The application also implements anti-fraud mechanisms—such as static image detection, movement analysis, and other integrity checks—to prevent cheating.
Despite these protections, there was a fundamental structural flaw in the application’s design: the browser calculated the score and then instructed the server on what the final outcome was.
That was the starting point for testing how far I could control this information.
Note: The security research described in this article was performed strictly for educational and learning purposes. Certain implementation details have been simplified, and exploitation code will not be provided. The goal is to analyze the vulnerability from a software architecture and security perspective.
1. Finding the Score in the Request
By analyzing application traffic with Burp Suite, I identified the request sent upon finishing a match:
POST /api/match/finalize HTTP/2
Host: target-app.com
Content-Type: application/json
{
"selfScore": 7.4,
"opponentScore": 6.8,
"selfScanValidity": {
"microMotionScore": "0.82",
"staticImageSuspicion": "low",
"sampledFrames": 120,
"landmarkStability": "high"
}
}
The selfScore field caught my attention immediately. If that value represented my score and was being sent directly by the browser, an obvious question arose:
What would happen if I simply modified this value before it reached the server?
2. The First Attempt: Interception Latency
I started with the most direct approach: intercepting the request in Burp Suite and manually changing selfScore.
The issue, however, was that matches happen in real-time. While I held the HTTP request in Burp to edit the JSON payload, the opponent had already submitted their result.
My Request ---> [ Paused in Burp Suite for editing ]
Opponent Request ---> [ Arrives at server first ]
↓
Match Finalized
[ My Request Arrives ] ---> Response: Match already closed
By the time my modified request finally arrived, it was too late. The issue wasn’t the payload modification itself, but the time required to edit it manually. I needed to automate the modification directly on the client side.
3. Overriding Functions in the Browser Console
The solution was moving the test into the browser’s own runtime. Instead of waiting for the request to hit Burp for manual editing, I wrote a script to intercept the finalization payload right before transmission.
I temporarily monkey-patched window.fetch:
const originalFetch = window.fetch;
window.fetch = function (...args) {
const [url, config] = args;
if (typeof url === 'string' && url.includes('/api/match/finalize')) {
let body = JSON.parse(config.body);
body.selfScore = 9.8; // Force a high score
config.body = JSON.stringify(body);
}
return originalFetch.apply(this, args);
};
Match Ends -> Data Prepared -> Hook Intercepts -> Modifies Score -> Request Sent -> Server
With the hook active, manual editing delay was eliminated. The tampered request reached the server instantaneously.
However, the outcome wasn’t what I expected. I had set a score close to 10.0, but my final score turned out to be:
1.0
4. Understanding Anti-Fraud Rules
The 1.0 rating wasn’t a generic error: it was the anti-fraud system penalizing the score after detecting inconsistent telemetry.
During my initial script runs, my webcam was essentially still. Inspecting the selfScanValidity fields revealed why:
- staticImageSuspicion: Very High
- microMotionScore: Practically Zero
I was submitting a payload that essentially claimed:
- Claimed score: 9.8
- Camera motion: Zero
- Static image suspicion: High
To the backend, that indicated clear fraud and penalized the score down to 1.0.
Adjusting Camera Integrity Validation
I re-ran the test while standing naturally in front of the camera, ensuring organic movement, blinking, and normal lighting variations. The selfScanValidity metrics became legitimate.
Even so, forcing high absolute numbers like 9.8 or 9.9 still caused the score to drop to 1.0.
5. Capturing Alternative Transports (navigator.sendBeacon)
During testing, I noticed that certain match finalizations bypassed my fetch() hook entirely.
The application was using navigator.sendBeacon() as a fallback to guarantee payload delivery if the user closed the tab or navigated away.
I adapted the script to monkey-patch this API as well:
const originalBeacon = navigator.sendBeacon;
navigator.sendBeacon = function (url, data) {
if (url.includes('/api/match/finalize')) {
// Intercept and modify beacon payload
}
return originalBeacon.apply(this, arguments);
};
Now every transmission path was fully controlled.
6. Relative Manipulation vs. Absolute Values
Why were legitimate camera metrics with high scores still being rejected?
The server was cross-checking data submitted by both participants. If one user submits a result with an absurd disparity (9.9 vs 5.2), but the opponent’s telemetry contradicts that difference, the backend flags the payload as an anomaly.
Instead of forcing unrealistic fixed values, I shifted to a relative manipulation strategy.
The JSON payload already contained the locally calculated opponentScore. I adjusted the logic to calculate my score relative to the opponent’s score:
// Instead of: body.selfScore = 9.9
// Relative adjustment:
body.selfScore = body.opponentScore + 0.8;
Opponent Score: 6.2 ---> My score modified to: 7.0
Opponent Score: 7.1 ---> My score modified to: 7.9
By keeping authentic camera biometric data and applying only this small relative delta, the server accepted the tampered score as legitimate.
7. The Core Vulnerability
The most interesting aspect was that I didn’t need to break computer vision models or reverse-engineer every proprietary anti-fraud rule.
The execution flow remained completely intact:
- Real person in front of the camera.
- Application analyzes the match normally.
- Genuine camera telemetry (
selfScanValidity) is preserved. - Script adjusts only
selfScorerelative toopponentScore. - Server accepts and processes the result.
The core vulnerability was trusting the client to determine the final state of a critical business rule.
[ Untrusted Client ]
└── Processes Metrics & Calculates Score
└── Sends Final Result ---> [ Server ] (Trusts incoming data)
No matter how sophisticated client-side validation or obfuscation is: any code running on the user’s device can be tampered with.
8. How to Fix It?
Remediating this class of vulnerability is not about obfuscating JavaScript code, blocking DevTools, or trying to hide endpoints.
Secure Architecture Pattern:
- Client Only Collects: The browser must be limited to sending raw sensor telemetry data (motion metrics, facial landmark tracking).
- Server Decides: The backend processes incoming metrics, applies anti-fraud algorithms, and computes the final score independently.
- Cross-Validation: The server verifies telemetry from both participants before updating any scores or leaderboards.
Browser (Client)
│
└── Sends Only Raw Telemetry Data
│
▼
Backend Server
├── Validates Camera Telemetry
├── Calculates Match Score
└── Updates Leaderboard in Database
Conclusion
Vulnerabilities don’t always manifest as classic memory corruption or injection flaws. Frequently, the most critical security vulnerabilities stem directly from system architecture and trusted client assumptions.
When designing any application, the fundamental question must always be:
If the browser is telling me what the result is, what stops the user from altering that information before sending it?
Never trust the client.