Comment board
The public guestbook of SamCorp company has been found — anyone can leave a comment here. The admin opens this page every minute with their special token, and there is a cookie named FLAG_COOKIE in their browser — the flag is exactly inside this cookie.
The comment text seems to be properly sanitized on the page with htmlspecialchars() — a simple <script>alert(1)</script> will not work. But there is another place on the page: a quick preview block called "latest comment" inserts it again into the page in a different way.
Goal: write such a comment that when the admin views it, your JavaScript code runs in the admin's browser and sends the document.cookie value to the /?action=leak&c=... address. Then read the stolen flag from the /?action=leaks page.