It looks like the AI hype has reached further than we thought. Help us shut down this poor alien attempt at Machine Learning, we found their website with a restricted admin dashboard can you exploit it?
The application supports authentication, but it's just hardcoded to default values which are randomly generated 32 characters.
Why_Lambda-1.png
The heart of the application seems to be the model. We are allowed a "demo" version where we draw a number and model guesses the number.
Why_Lambda-2.png
The model is somewhat terrible at it's job, so we are allowed to submit complaints. Our complaint is saved into a json file, the bot visits /dashboard with Chromium, stays there for 10 seconds and leaves.
Vue on frontend takes the JSON data (complaints) and renders each item on /dashboard. The bot logins with admin credentials so XSS/CSRF seems likely.
Why_Lambda-3.png
Only CSRF would work, because HTTPONLY is set for cookies, meaning they cannot be transmitted over network, no cookies for us 😟
App does have CSRF protection, but from source we know it's easily bypassable with simple header 💀
We are also allowed to submit our own models, but only with "internal" API
CSRF is possible from prediction value in compaint.
challenge/frontend/src/views/Dashboard.vue
Payload for prediction:
The pastebin version didn't work, because it needs Content-Type: text/javascript. Luckily pipedream platform supports different hooks for free! and we can take advantage of that. (I was lazy to open ngrok, lol)
Why_Lambda-5.png
New payload:
We create a script, give it a source of our payload, type=module because await/async kept complaining and lastly append the script to html. Bot should trigger the XSS in few seconds.