$ cat writeup.md…
$ cat writeup.md…
Hack.lu CTF 2026
Task: A Node 26 payload must survive a char whitelist banning () [] backtick, deleted builtins, and `node --permission`; the flag is root-only behind a setuid /readflag. Solution: drive a native ROP chain from bracket-free JS via undici gadget capture and a forged FileHandle on libuv's signal-pipe fd.
$ cat /etc/rate-limit
Rate limit reached (20 reads/hour per IP). Showing preview only — full content returns at the next hour roll-over.
One jail is not enough, so we tripled it. Are you a node god? Solve locally first, then create an instance here: nc nodejailjailjail.flu.xxx 1337
English summary: a Node v26.12.1 process reads one expression from stdin and runs it under three stacked restrictions. The goal is to execute /readflag (setuid-root, execute-only) and print the flag; /flag.txt is mode 400 owned by root, and the process runs as nobody, so the flag can only be obtained by executing the setuid helper.
The deployment (Dockerfile) pins node@sha256:62314d97..., runs as USER nobody, ships /readflag (---s--x--x) and /flag.txt (-r--------), and starts node --permission with no allow flags.
jail.js rejects any character not in:
0-9 A-F u ! " # $ % & ' * + , - . / : ; < = > ? @ \ ^ _ { | } ~ space newline
So ( ) [ ] and ` are gone, and every lowercase letter except u must be written as a \uXXXX escape. Escaped keywords are rejected by V8 (Keyword must not contain escaped characters), so the payload must be a single expression: identifiers, strings/numbers/regexes, object literals, single-parameter arrows, member access, operators, and destructuring assignment. There is no function, no return, no import, no null literal.
delete globalThis.eval; delete eval; for (const k of Reflect.ownKeys(process)) if (typeof process[k] == 'function') delete process[k]; Object.seal(Reflect.getPrototypeOf(Reflect.getPrototypeOf(process))); // EventEmitter.prototype Object.defineProperty(process, 'nextTick', { value: safeNextTick, ... }); delete globalThis.process; delete process; delete globalThis.require; delete require; delete globalThis.Proxy; delete Proxy; // all four of Function / AsyncFunction / GeneratorFunction / AsyncGeneratorFunction // constructors are deleted and replaced with a no-op Object.freeze(Object.prototype);
...
$ grep --similar