nyx/tests/dynamic_fixtures/header_injection/js/vuln.js
2026-06-05 10:16:30 -05:00

13 lines
455 B
JavaScript

// Phase 08 (Track J.6) — JavaScript HEADER_INJECTION vuln fixture.
//
// The function assigns the attacker-controlled `value` directly into a
// Node response's `Set-Cookie` header via `http.ServerResponse
// #setHeader`. A payload carrying `\r\nSet-Cookie: nyx-injected=pwn`
// splits the single header into two on the wire.
const http = require('http');
function run(res, value) {
res.setHeader('Set-Cookie', value);
}
module.exports = { run };