DEV Community

Shadrach Adongo
Shadrach Adongo

Posted on

TryHackMe Fools Mate Walkthrough Easy Client-Side Validation Bypass

๐ŸŽฏ Room Info

Room Fools Mate
Difficulty ๐ŸŸข Easy
Category Client-side validation bypass, request tampering
Link tryhackme.com/room/foolsmate

๐Ÿ“– What This Room Is About

Fools Mate is a small, focused room built around one lesson that trips up a lot of junior developers: anything enforced only in the browser is not actually enforced.

The app has a form (or feature) that looks locked down โ€” greyed-out buttons, JavaScript checks, "you're not allowed to do that" messages โ€” but none of it is backed up on the server side. This room walks through:

  1. ๐ŸŒ Finding the restricted feature
  2. ๐Ÿ” Understanding why it's blocked (client-side JS, not server logic)
  3. ๐Ÿ› ๏ธ Bypassing the restriction by editing the request directly
  4. ๐Ÿšฉ Reaching the flag the "locked" feature was hiding

๐Ÿง  Skills You'll Practice

  • Reading and editing JavaScript in browser dev tools
  • Intercepting and modifying HTTP requests (Burp Suite)
  • Recognizing client-side-only validation
  • Understanding why server-side validation is non-negotiable

๐Ÿ› ๏ธ Step-by-Step Walkthrough

1๏ธโƒฃ Scan and browse the target

nmap -sC -sV -oN nmap-initial.txt <TARGET_IP>
Enter fullscreen mode Exit fullscreen mode

HTTP is open. Load the site and look for the restricted feature โ€” often a button, form field, or action that's disabled, hidden, or gated behind a message like "not available" or "access denied."

2๏ธโƒฃ Inspect the page source

Open dev tools (F12 or Ctrl+Shift+I) and look at the Elements and Sources tabs.

Common patterns you'll find in a room like this:

  • A button with disabled in its HTML attribute
  • A JavaScript function that checks a condition client-side before allowing a submit
  • A hidden form field controlling access (e.g. <input type="hidden" name="isAdmin" value="false">)

๐Ÿ’ก Why this matters: anything visible in your browser's dev tools is fully under your control, not the server's. If the only thing stopping an action is JavaScript running on your machine, it's not a real security control.

3๏ธโƒฃ Try the easy bypass first

Sometimes simply removing the disabled attribute in the Elements panel, or flipping a hidden field's value, is enough:

<!-- Before -->
<input type="hidden" name="isAdmin" value="false">

<!-- After (edited live in dev tools) -->
<input type="hidden" name="isAdmin" value="true">
Enter fullscreen mode Exit fullscreen mode

Submit the form and see if the server actually re-checks that value โ€” in this room, it usually doesn't.

4๏ธโƒฃ Intercept the request with Burp Suite

If the front-end fix isn't enough (page reloads reset your edits, or JS blocks the submit entirely), intercept the raw HTTP request instead:

  1. Set your browser proxy to Burp Suite (127.0.0.1:8080)
  2. Turn on Intercept in the Proxy tab
  3. Trigger the form submission in the browser
  4. Edit the intercepted request body directly โ€” for example, change a parameter like:
isAdmin=false
Enter fullscreen mode Exit fullscreen mode

to:

isAdmin=true
Enter fullscreen mode Exit fullscreen mode
  1. Forward the request

๐Ÿ’ก Why this matters: the browser only shows you a rendered view of what the server expects. The real conversation happens in raw HTTP requests โ€” Burp lets you see and change that conversation directly, bypassing any client-side restriction entirely.

5๏ธโƒฃ Confirm the bypass worked

After forwarding the modified request, the page should now show the previously restricted content or action succeeding โ€” this is your signal the server trusted the client-supplied value instead of checking its own session/permission state.

6๏ธโƒฃ Grab the flag

The restricted feature typically reveals the flag directly once bypassed, or unlocks a page/download containing it.

cat flag.txt
Enter fullscreen mode Exit fullscreen mode

๐Ÿšฉ Click to reveal: flag

Redacted โ€” swap in your own captured flag if you want to keep a private record.

๐Ÿ“‹ Every Command / Action, In Order

nmap -sC -sV -oN nmap-initial.txt <TARGET_IP>
# Open dev tools -> inspect disabled elements / hidden fields
# Try editing the DOM directly first
# If that fails, route traffic through Burp Suite:
#   Intercept ON -> submit form -> edit parameter (e.g. isAdmin=false -> true) -> Forward
Enter fullscreen mode Exit fullscreen mode

๐ŸŽ“ Key Takeaways

  • Never trust the client. JavaScript validation, disabled buttons, and hidden fields are all UX conveniences โ€” they exist to make the interface feel polished, not to enforce security.
  • Every restriction needs a matching server-side check. If the server doesn't independently verify permissions on every request, the client-side gate is decorative.
  • Burp Suite (or any intercepting proxy) is the real test. If you can't reproduce a restriction bypass by editing the raw request, you haven't actually tested the security control โ€” you've only tested the UI.
  • This exact bug class shows up constantly in real apps โ€” broken access control consistently ranks in the OWASP Top 10 for a reason.

Top comments (0)