You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Proposal: build official Node.js binaries for glibc-based Linux using PIE, enables ASLR, helps prevent RCE #66951
Almost all operating systems enable Address Space Layout Randomisation (ASLR) to help prevent memory-related vulnerabilities from reaching a state where Remote Code Execution (RCE) is possible.
To take full advantage of this protection, an executable must be compiled as a Position Independent Executable (PIE).
The current state of PIE in Node.js is as follows:
✅ Linux using musl libc - PIE is compiler default for all executables
✅ Linux using glibc where node binary is compiled and provided by OS package manager - PIE is default for almost all OS-level package repositories
❌ Linux using glibc where node binary is provided by Node.js - Not PIE
What is the feature you are proposing to solve the problem?
A previous discussion from May 2020 rejected use of PIE on Linux due to a expected performance penalty of 5-10% and, at that point in time, little evidence of RCE within the Node.js ecosystem.
Given many organisations already quite happily use Node.js with PIE/ASLR, be that on macOS, via Alpine Linux based containers or OS-provided packages, is it time to revisit this discussion for those left behind?
The performance impact of PIE is negligible on 64-bit ARM CPUs, which have seen increasing adoption since 2020 e.g. AWS Graviton.
Do the security benefits of PIE now outweigh the performance cost for those still running glibc-based Linux on x64 architecture CPUs?
By way of a recent example, had this change already been in place then it's likely CVE-2026-111497 would have been rated "High" rather than "Critical" severity.
What alternatives have you considered?
If there's still a desire to provide official binaries for a subset of platforms without PIE then perhaps offering a security-hardened alternative with PIE might help raise awareness.
Reacted by Daniel Colascione, saraangelmurphy, Adon Metcalfe, Florian Mayer, chicks, finder, Budi Syahiddin, Ivan Kozik, Dominic Feliton, NichtStudioCode and 27 more
changed the title [-]Proposal: build official Node.js binaries for glibc-based Linux on x64 CPUs using PIE, enables ASLR, helps prevent RCE[/-][+]Proposal: build official Node.js binaries for glibc-based Linux using PIE, enables ASLR, helps prevent RCE[/+]on Oct 26, 2026
node -e 0 (3 alternating rounds of perf stat -r 200)
22.8 ms
23.8 ms (+1.0 ms, +4.2%)
page faults
2,960
3,344
R_X86_64_RELATIVE relocations
0
113,341 (2.7 MB .rela.dyn)
.text
60.1 MB
61.2 MB (+1.9%)
file size
155.6 MB
158.9 MB
Most of the startup cost comes from the dynamic loader applying the relative relocations. -z pack-relative-relocs (DT_RELR) would cut most of it, but it needs glibc >= 2.36 at runtime, which is above the current glibc 2.28 baseline.
Steady state
Negative means PIE is slower. Only results with at least 95% confidence are marked.
On x64 the cost is much lower than the 5–10% quoted in #33425. That figure comes mainly from 32-bit x86, where PIE costs a general-purpose register.
JIT-compiled JavaScript isn't affected. V8 already generates position-independent code, and the embedded builtins are PC-relative.
Code that is mostly C++ (string decoding/encoding, llhttp, the V8 serializer) is 0–3% slower in microbenchmarks. Some results also move in the positive direction by similar amounts, so part of this is code-layout noise.
End-to-end HTTP throughput showed no measurable difference.
The clearest cost is about 1 ms (+4%) of startup per process, which matters mostly for short-lived CLI invocations.
Caveats: one machine, one compiler version (gcc 13 rather than the gcc 14 used for releases), and 15 runs per benchmark. It would be worth repeating the startup and http numbers on newer x64 hardware with the actual release toolchain.
Activity
[-]Proposal: build official Node.js binaries for glibc-based Linux on x64 CPUs using PIE, enables ASLR, helps prevent RCE[/-][+]Proposal: build official Node.js binaries for glibc-based Linux using PIE, enables ASLR, helps prevent RCE[/+]mcollina commentedon Oct 29, 2026
Note
This comment was AI-generated (Claude Code); I reviewed the methodology and numbers before posting.
I measured the cost of PIE on x64 Linux to give the TSC discussion some current data.
Setup
mainat 8587d71CFLAGS=-fno-pie CXXFLAGS=-fno-pie LDFLAGS=-no-pie makelinux-x64binary isET_EXEC(non-PIE). It's built with RHEL 8 gcc-toolset-14, which doesn't default to PIE.benchmark/compare.js --runs 15 --old node-nopie --new node-pieStartup and binary size
node -e 0(3 alternating rounds ofperf stat -r 200)R_X86_64_RELATIVErelocations.rela.dyn).textMost of the startup cost comes from the dynamic loader applying the relative relocations.
-z pack-relative-relocs(DT_RELR) would cut most of it, but it needs glibc >= 2.36 at runtime, which is above the current glibc 2.28 baseline.Steady state
Negative means PIE is slower. Only results with at least 95% confidence are marked.
string_decoder/string-decoder.js(5 encodings)*to***)util/text-encoder.jsencode, len 256–8192*to***)http/bench-parser*.js(llhttp)*, one***)misc/structured-clone.jstype=object**)buffers/buffer-tostring.jsutf8 / hex / latin1streams/iter-creation.jsmisc/object-property-bench.js(pure JIT control)zlib/deflate.js,crypto/hash-stream-throughput.jssha256,buffers/buffer-base64-encode.jsstreams/creation.js,util/inspect.js,url/whatwg-url-parse.jshttp/simple.js(wrk, c=50, len=4/1024)Summary
On x64 the cost is much lower than the 5–10% quoted in #33425. That figure comes mainly from 32-bit x86, where PIE costs a general-purpose register.
Caveats: one machine, one compiler version (gcc 13 rather than the gcc 14 used for releases), and 15 runs per benchmark. It would be worth repeating the startup and http numbers on newer x64 hardware with the actual release toolchain.
richardlau commentedon Oct 29, 2026
FWIW Node.js 26 is built on RHEL 8 with clang 21, not gcc-toolset-14.
node/BUILDING.md
Line 195 in 18b32a3
We've moved Node.js 27 onto RHEL 9, which is glibc 2.34 (still below 2.36).
richardlau commentedon Oct 29, 2026
In case I don't make the TSC meeting next week where this is on the agenda, I'm in favour of turning on PIE for all supported release lines.
mcollina commentedon Oct 29, 2026
It seems the reward is worth the cost.