Hack.lu CTF 2024 | Buffzone (Web, XSS)

Difficulty: Medium

I participated in Hack.lu this weekend, it has been a very difficult CTF but I managed to solve only the easiest task which wasn't easy by any means.

Let's start by reading the Code :

app.js :

We can see the message passes through 2 phases that change it's contents, the first is that it finds links that start with https:// and transforms them into html anchor tags :

the next thing is that it renders the modified message into markdown :

so we need to create an image using the markdown rendering feature, the problem here is the onerror argument that needs to be put in the image, for that we need to inject it using a fake url in the alt feature of the markdown.

a working payload for us would look like this :

now we can add in our fetch function to get the cookie, but first this challenge only accepts to fetch to https endpoints

so in order to avoid the replaceUrls feature we need to concat the https letters,

After that you report the link to the bot and get the flag.

You need to decode it from base64 though.

Last updated