mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-21 20:18:06 +02:00
[pitboss] phase 13: Track B — JavaScript + TypeScript harness emitter shapes
This commit is contained in:
parent
96eb37500c
commit
34a5879459
51 changed files with 2556 additions and 440 deletions
19
tests/dynamic_fixtures/javascript/browser_event/benign.js
Normal file
19
tests/dynamic_fixtures/javascript/browser_event/benign.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
// 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 };
|
||||
Loading…
Add table
Add a link
Reference in a new issue