mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-09 19:45:13 +02:00
19 lines
544 B
JavaScript
19 lines
544 B
JavaScript
// Phase 13 — browser-side event handler, benign control.
|
|
//
|
|
// Uses `textContent` so the payload's `<script>` tag is HTML-escaped before
|
|
// serialisation; the XSS oracle marker cannot appear in stdout because
|
|
// `<` becomes `<`.
|
|
|
|
'use strict';
|
|
// nyx-shape: browser-event
|
|
|
|
function clickHandler(payload) {
|
|
process.stdout.write('__NYX_SINK_HIT__\n');
|
|
const el = document.getElementById('out');
|
|
if (el) {
|
|
el.textContent = String(payload);
|
|
}
|
|
return el ? el.textContent : '';
|
|
}
|
|
|
|
module.exports = { clickHandler };
|