# A 4-Line HTML File Stole the Admin’s Secret — Intigriti Lea
The /share endpoint lacked CSRF protection and the session cookie was set with SameSite=None, so a cross-site form could make the admin share their private recipe box with the attacker. The attacker hosted an auto-submitting form and submitted its URL to the admin bot, which visited it and shared the box, revealing the flag.
The challenge gave me a “cookie recipe” web app and one goal: read the Master Baker’s private recipe box. The flag was inside it.
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.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The /share endpoint had no CSRF token or Origin/Referer validation, and the session cookie used SameSite=None, so browsers sent it on cross-site POSTs.
Impact
The admin's private recipe box, containing the flag, was shared with the attacker without any user interaction.
What the attacker needed
Attacker account; public HTTPS page hosting the form; admin bot visits the URL
The fix
Add a per-session anti-CSRF token, set the session cookie to SameSite=Lax, and validate Origin/Referer on state-changing POSTs.
How it was found
- Register an attacker account.
- Build an HTML page that auto-submits a POST to /share with the attacker's username.
- Host the page on a public HTTPS service that executes JavaScript.
- Submit the hosted URL to /submit so the admin bot visits it.
- Log in as the attacker and open the shared vault to read the flag.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A CSRF attack tricks a logged-in user's browser into sending a request the user did not intend. Here, the site's session cookie was sent even on requests from other websites, and the share form had no secret token to prove the request came from the real site. So a page on another site could make the admin share their private recipes with the attacker.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.