Challenge Info
Spoiler
Speednet is an ISP platform. Join our bug bounty to find vulnerabilities and retrieve the hidden flag. Test using the email service at http://IP:PORT/emails/ with address [email protected]
Artifacts Provided
- Application source — none (black box)
- Live web instance —
http://VICTIM-IP:PORT - Test mailbox —
http://VICTIM-IP:PORT/emails/([email protected])
Analysis
Reconnaissance
We register an account with [email protected] and browse the site. The requests go to /graphql. Fingerprint it first:
| |
GraphQL Introspection
Types:
| |
| |
Queries with their arguments:
| |
| |
Mutations with their arguments and return types:
| |
| |
forgotPassword, resetPassword and the OTP pair (verifyTwoFactor, resendOTP) all have a page in the app. devForgotPassword is the odd one out: nothing in the UI uses a “dev” variant.
IntrospectionQuery saved to introspection.graphql and sent with jq, then loaded in Voyager for the visual: | |

Account Takeover
Both reset mutations take an email and return a string. For forgotPassword, an unknown address and our own address answer differently:
| |
| |
| |
| |
That is a user enumeration oracle. The token of the normal flow only arrives in the mailbox, which we only have for [email protected]. devForgotPassword returns the token inline:
| |
| |
Both tokens work with resetPassword, on our own account:
| |
| |
speednet.htb (the welcome email in the mailbox comes from [email protected]), so we fuzz the local part against the oracle and filter out the not-found answer: | |
userProfile(userId: Int!) for the logged-in user (userId 2 for the account we registered). Changing it to 1 returns the admin’s profile, email included: an IDOR. We never needed it, because the forgotPassword error difference leaks which addresses exist. Both routes end at [email protected].Now devForgotPassword for the admin, then resetPassword with the returned token:
| |
| |
| |
| |
Logging in as the admin does not return a session. It stops at 2FA, and the token for the next step comes back inside the error message:
| |
| |
| |

2FA Brute Force
The OTP is mailed to the admin, whose mailbox we cannot read. verifyTwoFactor returns an object (AuthResponse), so it needs a selection set:
| |
| |
| |
| |
| |
| |
How long is the OTP? We enabled 2FA on our own account through updateProfile and ran the flow there, since we control that mailbox ([email protected]):

Four digits: 10000 candidates.
verifyTwoFactor per request with ffuf. nginx answers with 429 once the request rate is too high, and ffuf does not retry, so every 429 is a candidate that was never tested. The official writeup measured the limit at about 40 requests per minute, and the mailed code expires after 5 minutes, so one request per guess covers only a fraction of the 10000 candidates before the code is gone.The rate limit counts HTTP requests, so we pack many guesses into one request with GraphQL alias batching: one operation, many aliased verifyTwoFactor calls. The script sends batches of aliases, retries a batch after a 429 instead of skipping it, and stops at the first alias that returns a non-null result.
otf-bf.py
| |
| |
Batch size: 200 aliases per request worked here (the official script uses 100). Above roughly 500 aliases the request was rejected as too large.
A wrong guess and an expired code give the same answer, Invalid or expired OTP, so a sweep that outlives the 5-minute code looks exactly like a miss. Log in again right before the sweep to get a fresh token and OTP, and run it straight away.
Reaching the Flag
The JWT goes in the Authorization header as the bare token, without a Bearer prefix. With it, userProfile(userId: 1) returns the admin’s own profile:
| |
| |
The flag is on the Billing page, so we request what it loads:
| |
Spoiler
| |
Full Chain
- Register an account (
[email protected], mailbox provided) and browse the site: all requests go to/graphql. - Introspection is enabled. The schema shows
devForgotPassword,resetPassword,verifyTwoFactorandresendOTP. forgotPasswordanswersUser not foundfor unknown addresses. Fuzzing the local part againstspeednet.htbfinds[email protected].devForgotPasswordreturns the reset token inline.resetPasswordwith that token sets a new password on the admin account.- Logging in as the admin returns
2FA_REQUIRED:<token>. The OTP goes to the admin’s mailbox, which we cannot read. - The OTP length (4 digits) comes from running the 2FA flow on our own account.
- One request per guess hits the nginx
429limit and outlives the 5-minute OTP. GraphQL alias batching (200 guesses per request,429s retried) finds the OTP and returns the admin JWT. - With the admin JWT,
userProfile(userId: 1)confirms the account andinvoiceHistory(the Billing page) holds the flag.
