Beg-o-Matic 3000

Description

Ever wish someone would just GIVE you the flag if you asked nicely?

Source: beg-o-matic.ziparrow-up-right

Author: @tsutoarrow-up-right

Solution

As the name suggest we have to beg for flags 🤣

Beg-o-Matic_3000.png

From given source quick glance at middleware.js gives us attack vector idea: XSS

utils/bot.js is used to emulate the admin

/api/list endpoint returns the flag only if the post is approved by the bot, so if we manage to approve the post can leak the flag.

Beg-o-Matic_3000-1.png

app/admin/[id]/page.js:

When bot views our submission React uses dangerouslySetInnerHTMLarrow-up-right to render our message, exposing bot to XSS attack as long as we can bypass the CSP.

This might not be so easy as it sounds...

Beg-o-Matic_3000-2.png

Similar challenges (research~):

The solution was easier then expected, I was just overthinking about leaking the tokens with CSS, but you just needed header that bot head 💀. Dont overthink.

Solution by other players: USCG Beg-o-matic 3000 (CSRF)arrow-up-right by FlagHoardersarrow-up-right

@clovismint solution:

Beg-o-Matic_3000-3.png

Last updated