🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
build(docker): install Red Hat's nodejs:24 again instead of the patched RPMs (#19581)
Steffen Reuther426ba058eb16
diff --git a/.github/workflows/nodejs-rpm.yml b/.github/workflows/nodejs-rpm.ymlindex 0b9d943086..e263e36717 100644--- a/.github/workflows/nodejs-rpm.yml+++ b/.github/workflows/nodejs-rpm.yml@@ -1,8 +1,11 @@name: Build nodejs RPM-# TEMPORARY(node-24.22.1-security): builds Red Hat's nodejs:24 RPMs with fixes-# from Node 24.22.1 (scripts/docker/nodejs-rpm/) and publishes them as a multi-arch image for-# web/Dockerfile and worker/Dockerfile. Delete together with that directory.+# Builds Red Hat's nodejs:24 RPMs with backported Node security fixes+# (scripts/docker/nodejs-rpm/) and publishes them as a multi-arch image for+# web/Dockerfile and worker/Dockerfile.+#+# Disabled: only manual runs start it. To revive, uncomment the triggers below+# (scripts/docker/nodejs-rpm/README.md).## Pull requests build and verify without publishing. Pushes to main and manual# runs publish ghcr.io/langfuse/langfuse-nodejs-rpm; pin the digest from the@@ -10,16 +13,16 @@ name: Build nodejs RPMon:workflow_dispatch:- pull_request:- paths:- - scripts/docker/nodejs-rpm/**- - .github/workflows/nodejs-rpm.yml- push:- branches:- - main- paths:- - scripts/docker/nodejs-rpm/**- - .github/workflows/nodejs-rpm.yml+ # pull_request:+ # paths:+ # - scripts/docker/nodejs-rpm/**+ # - .github/workflows/nodejs-rpm.yml+ # push:+ # branches:+ # - main+ # paths:+ # - scripts/docker/nodejs-rpm/**+ # - .github/workflows/nodejs-rpm.ymlpermissions: {}diff --git a/scripts/docker/nodejs-rpm/0002-deps-brotli-CVE-2026-111497-block-switch.patch b/scripts/docker/nodejs-rpm/0002-deps-brotli-CVE-2026-111497-block-switch.patchdeleted file mode 100644index c9adb0a9e0..0000000000--- a/scripts/docker/nodejs-rpm/0002-deps-brotli-CVE-2026-111497-block-switch.patch+++ /dev/null@@ -1,237 +0,0 @@-From 49dff6f57aa72cbbe13e480cd41ff4e46837c8fc Mon Sep 17 00:00:00 2001-From: Evgenii Kliuchnikov <[email protected]>-Date: Fri, 27 Feb 2026 05:10:32 -0800-Subject: [PATCH] deps: brotli: cherry-pick 0ed4268a4401abcb44720963--Original commit message:-- Detect and report invalid stream earlier.-- PiperOrigin-RevId: 876198329--PR-URL: https://github.com/nodejs-private/node-private/pull/1002-Reviewed-By: Matteo Collina <[email protected]>-CVE-ID: CVE-2026-111497----- deps/brotli/c/dec/decode.c | 87 ++++++++++++++++++---------- deps/brotli/c/include/brotli/decode.h | 4 +-- 2 files changed, 59 insertions(+), 32 deletions(-)--diff --git a/deps/brotli/c/dec/decode.c b/deps/brotli/c/dec/decode.c-index e87e7f5ea0f9..19c7e0283faa 100644---- a/deps/brotli/c/dec/decode.c-+++ b/deps/brotli/c/dec/decode.c-@@ -1176,7 +1176,7 @@ static BrotliDecoderErrorCode DecodeContextMap(brotli_reg_t context_map_size,-- /* Decodes a command or literal and updates block type ring-buffer.- Reads 3..54 bits. */--static BROTLI_INLINE BROTLI_BOOL DecodeBlockTypeAndLength(-+static BROTLI_INLINE BrotliDecoderErrorCode DecodeBlockTypeAndLength(- int safe, BrotliDecoderState* s, int tree_type) {- brotli_reg_t max_block_type = s->num_block_types[tree_type];- const HuffmanCode* type_tree = &s->block_type_trees[-@@ -1187,7 +1187,7 @@ static BROTLI_INLINE BROTLI_BOOL DecodeBlockTypeAndLength(- brotli_reg_t* ringbuffer = &s->block_type_rb[tree_type * 2];- brotli_reg_t block_type;- if (max_block_type <= 1) {-- return BROTLI_FALSE;-+ return BROTLI_DECODER_ERROR_FORMAT_BLOCK_SWITCH;- }-- /* Read 0..15 + 3..39 bits. */-@@ -1197,11 +1197,13 @@ static BROTLI_INLINE BROTLI_BOOL DecodeBlockTypeAndLength(- } else {- BrotliBitReaderState memento;- BrotliBitReaderSaveState(br, &memento);-- if (!SafeReadSymbol(type_tree, br, &block_type)) return BROTLI_FALSE;-+ if (!SafeReadSymbol(type_tree, br, &block_type)) {-+ return BROTLI_DECODER_NEEDS_MORE_INPUT;-+ }- if (!SafeReadBlockLength(s, &s->block_length[tree_type], len_tree, br)) {- s->substate_read_block_length = BROTLI_STATE_READ_BLOCK_LENGTH_NONE;- BrotliBitReaderRestoreState(br, &memento);-- return BROTLI_FALSE;-+ return BROTLI_DECODER_NEEDS_MORE_INPUT;- }- }--@@ -1217,7 +1219,7 @@ static BROTLI_INLINE BROTLI_BOOL DecodeBlockTypeAndLength(- }- ringbuffer[0] = ringbuffer[1];- ringbuffer[1] = block_type;-- return BROTLI_TRUE;-+ return BROTLI_DECODER_SUCCESS;- }-- static BROTLI_INLINE void DetectTrivialLiteralBlockTypes(-@@ -1254,59 +1256,65 @@ static BROTLI_INLINE void PrepareLiteralDecoding(BrotliDecoderState* s) {-- /* Decodes the block type and updates the state for literal context.- Reads 3..54 bits. */--static BROTLI_INLINE BROTLI_BOOL DecodeLiteralBlockSwitchInternal(-+static BROTLI_INLINE BrotliDecoderErrorCode DecodeLiteralBlockSwitchInternal(- int safe, BrotliDecoderState* s) {-- if (!DecodeBlockTypeAndLength(safe, s, 0)) {-- return BROTLI_FALSE;-+ BrotliDecoderErrorCode result = DecodeBlockTypeAndLength(safe, s, 0);-+ if (result != BROTLI_DECODER_SUCCESS) {-+ return result;- }- PrepareLiteralDecoding(s);-- return BROTLI_TRUE;-+ return BROTLI_DECODER_SUCCESS;- }---static void BROTLI_NOINLINE DecodeLiteralBlockSwitch(BrotliDecoderState* s) {-- DecodeLiteralBlockSwitchInternal(0, s);-+static BROTLI_NOINLINE BrotliDecoderErrorCode-+DecodeLiteralBlockSwitch(BrotliDecoderState* s) {-+ return DecodeLiteralBlockSwitchInternal(0, s);- }---static BROTLI_BOOL BROTLI_NOINLINE SafeDecodeLiteralBlockSwitch(-+static BROTLI_NOINLINE BrotliDecoderErrorCode SafeDecodeLiteralBlockSwitch(- BrotliDecoderState* s) {- return DecodeLiteralBlockSwitchInternal(1, s);- }-- /* Block switch for insert/copy length.- Reads 3..54 bits. */--static BROTLI_INLINE BROTLI_BOOL DecodeCommandBlockSwitchInternal(-+static BROTLI_INLINE BrotliDecoderErrorCode DecodeCommandBlockSwitchInternal(- int safe, BrotliDecoderState* s) {-- if (!DecodeBlockTypeAndLength(safe, s, 1)) {-- return BROTLI_FALSE;-+ BrotliDecoderErrorCode result = DecodeBlockTypeAndLength(safe, s, 1);-+ if (result != BROTLI_DECODER_SUCCESS) {-+ return result;- }- s->htree_command = s->insert_copy_hgroup.htrees[s->block_type_rb[3]];-- return BROTLI_TRUE;-+ return BROTLI_DECODER_SUCCESS;- }---static void BROTLI_NOINLINE DecodeCommandBlockSwitch(BrotliDecoderState* s) {-- DecodeCommandBlockSwitchInternal(0, s);-+static BROTLI_NOINLINE BrotliDecoderErrorCode-+DecodeCommandBlockSwitch(BrotliDecoderState* s) {-+ return DecodeCommandBlockSwitchInternal(0, s);- }---static BROTLI_BOOL BROTLI_NOINLINE SafeDecodeCommandBlockSwitch(-- BrotliDecoderState* s) {-+static BROTLI_NOINLINE BrotliDecoderErrorCode-+SafeDecodeCommandBlockSwitch(BrotliDecoderState* s) {- return DecodeCommandBlockSwitchInternal(1, s);- }-- /* Block switch for distance codes.- Reads 3..54 bits. */--static BROTLI_INLINE BROTLI_BOOL DecodeDistanceBlockSwitchInternal(-+static BROTLI_INLINE BrotliDecoderErrorCode DecodeDistanceBlockSwitchInternal(- int safe, BrotliDecoderState* s) {-- if (!DecodeBlockTypeAndLength(safe, s, 2)) {-- return BROTLI_FALSE;-+ BrotliDecoderErrorCode result = DecodeBlockTypeAndLength(safe, s, 2);-+ if (result != BROTLI_DECODER_SUCCESS) {-+ return result;- }- s->dist_context_map_slice = s->dist_context_map +- (s->block_type_rb[5] << BROTLI_DISTANCE_CONTEXT_BITS);- s->dist_htree_index = s->dist_context_map_slice[s->distance_context];-- return BROTLI_TRUE;-+ return BROTLI_DECODER_SUCCESS;- }---static void BROTLI_NOINLINE DecodeDistanceBlockSwitch(BrotliDecoderState* s) {-- DecodeDistanceBlockSwitchInternal(0, s);-+static BROTLI_NOINLINE BrotliDecoderErrorCode-+DecodeDistanceBlockSwitch(BrotliDecoderState* s) {-+ return DecodeDistanceBlockSwitchInternal(0, s);- }-- static BROTLI_BOOL BROTLI_NOINLINE SafeDecodeDistanceBlockSwitch(-@@ -1940,6 +1948,9 @@ static BROTLI_INLINE BROTLI_BOOL CheckInputAmount(- return BrotliCheckInputAmount(br);- }--+/* NB: METHOD should return BROTLI_FALSE only in case there is not enough input;-+ in case of "unsafe" execution, when input is guaranteed to be sufficient,-+ result is ignored. */- #define BROTLI_SAFE(METHOD) \- { \- if (safe) { \-@@ -1952,6 +1963,22 @@ static BROTLI_INLINE BROTLI_BOOL CheckInputAmount(- } \- }--+/* NB: METHOD should return BROTLI_DECODER_SUCCESS, BROTLI_DECODER_ERROR_*, or-+ BROTLI_DECODER_NEEDS_MORE_INPUT; the later two break the processing. */-+#define BROTLI_SAFE_WITH_STATUS(METHOD) \-+ { \-+ BrotliDecoderErrorCode status; \-+ if (safe) { \-+ status = Safe##METHOD; \-+ } else { \-+ status = METHOD; \-+ } \-+ if (status != BROTLI_DECODER_SUCCESS) { \-+ result = status; \-+ goto saveStateAndReturn; \-+ } \-+ }-+- static BROTLI_INLINE BrotliDecoderErrorCode ProcessCommandsInternal(- int safe, BrotliDecoderState* s) {- int pos = s->pos;-@@ -1991,7 +2018,7 @@ static BROTLI_INLINE BrotliDecoderErrorCode ProcessCommandsInternal(- goto saveStateAndReturn;- }- if (BROTLI_PREDICT_FALSE(s->block_length[1] == 0)) {-- BROTLI_SAFE(DecodeCommandBlockSwitch(s));-+ BROTLI_SAFE_WITH_STATUS(DecodeCommandBlockSwitch(s));- goto CommandBegin;- }- /* Read the insert/copy length in the command. */-@@ -2136,7 +2163,7 @@ static BROTLI_INLINE BrotliDecoderErrorCode ProcessCommandsInternal(- } else {- /* Read distance code in the command, unless it was implicitly zero. */- if (BROTLI_PREDICT_FALSE(s->block_length[2] == 0)) {-- BROTLI_SAFE(DecodeDistanceBlockSwitch(s));-+ BROTLI_SAFE_WITH_STATUS(DecodeDistanceBlockSwitch(s));- }- BROTLI_SAFE(ReadDistance(s, br));- }-@@ -2330,7 +2357,7 @@ static BROTLI_INLINE BrotliDecoderErrorCode ProcessCommandsInternal(- }-- NextLiteralBlock:-- BROTLI_SAFE(DecodeLiteralBlockSwitch(s));-+ BROTLI_SAFE_WITH_STATUS(DecodeLiteralBlockSwitch(s));- goto CommandInner;-- saveStateAndReturn:-@@ -2552,6 +2579,8 @@ BrotliDecoderResult BrotliDecoderDecompressStream(- if (result != BROTLI_DECODER_SUCCESS) {- break;- }-+ BROTLI_DCHECK(s->meta_block_remaining_len <=-+ (int)BROTLI_BLOCK_SIZE_CAP);- BROTLI_LOG_UINT(s->is_last_metablock);- BROTLI_LOG_UINT(s->meta_block_remaining_len);- BROTLI_LOG_UINT(s->is_metadata);-diff --git a/deps/brotli/c/include/brotli/decode.h b/deps/brotli/c/include/brotli/decode.h-index 8d436db733c9..10d01e3658b5 100644---- a/deps/brotli/c/include/brotli/decode.h-+++ b/deps/brotli/c/include/brotli/decode.h-@@ -85,9 +85,7 @@ typedef enum {- BROTLI_ERROR_CODE(_ERROR_FORMAT_, PADDING_1, -14) SEPARATOR \- BROTLI_ERROR_CODE(_ERROR_FORMAT_, PADDING_2, -15) SEPARATOR \- BROTLI_ERROR_CODE(_ERROR_FORMAT_, DISTANCE, -16) SEPARATOR \-- \-- /* -17 code is reserved */ \-- \-+ BROTLI_ERROR_CODE(_ERROR_FORMAT_, BLOCK_SWITCH, -17) SEPARATOR \- BROTLI_ERROR_CODE(_ERROR_, COMPOUND_DICTIONARY, -18) SEPARATOR \- BROTLI_ERROR_CODE(_ERROR_, DICTIONARY_NOT_SET, -19) SEPARATOR \- BROTLI_ERROR_CODE(_ERROR_, INVALID_ARGUMENTS, -20) SEPARATOR \diff --git a/scripts/docker/nodejs-rpm/0002-placeholder.patch b/scripts/docker/nodejs-rpm/0002-placeholder.patchnew file mode 100644index 0000000000..64e31292cf--- /dev/null+++ b/scripts/docker/nodejs-rpm/0002-placeholder.patch@@ -0,0 +1,9 @@+Placeholder for the upstream Node fixes that build.sh backports. Replace it+with one file per fix, each a nodejs/node commit from the release line's+branch (for example v24.x), vendored verbatim:++ git -C <node checkout> format-patch -1 --start-number 2 <commit>++List the files in PATCHES in build.sh, in upstream order, and add a check per+fix to test-node-security-fixes.js. git am rejects this file, so the build+fails until it is replaced. See README.md.diff --git a/scripts/docker/nodejs-rpm/0003-tls-CVE-2026-105483-ip-normalization-regression.patch b/scripts/docker/nodejs-rpm/0003-tls-CVE-2026-105483-ip-normalization-regression.patchdeleted file mode 100644index 23e99a023e..0000000000--- a/scripts/docker/nodejs-rpm/0003-tls-CVE-2026-105483-ip-normalization-regression.patch+++ /dev/null@@ -1,113 +0,0 @@-From de49c913f232fd9c216bf164818c87c0cb645b7b Mon Sep 17 00:00:00 2001-From: James M Snell <[email protected]>-Date: Sat, 19 Sep 2026 20:56:11 +0000-Subject: [PATCH] tls: fix ip normalization regression-MIME-Version: 1.0-Content-Type: text/plain; charset=UTF-8-Content-Transfer-Encoding: 8bit--The regression is a low-severity bug that's not easy to-exploit. Basically it just means the hostname check can-be bypassed.--Signed-off-by: James M Snell <[email protected]>-PR-URL: https://github.com/nodejs-private/node-private/pull/985-Reviewed-By: Robert Nagy <[email protected]>-Reviewed-By: Rich Trott <[email protected]>-Reviewed-By: Ulises Gascón <[email protected]>-CVE-ID: CVE-2026-105483----- lib/tls.js | 26 ++++++++----- .../test-tls-check-server-identity.js | 41 +++++++++++++++++++- 2 files changed, 60 insertions(+), 7 deletions(-)--diff --git a/lib/tls.js b/lib/tls.js-index a1d978c50f27..42562108eaa7 100644---- a/lib/tls.js-+++ b/lib/tls.js-@@ -456,14 +456,26 @@ exports.checkServerIdentity = function checkServerIdentity(hostname, cert) {- let valid = false;- let reason = 'Unknown reason';--- // An IP literal must not be IDNA-normalized: domainToASCII() returns '' for-- // an IPv6 literal (it is not a domain), so matching against the normalized-- // host would skip IP-SAN matching for IPv6 entirely. Match IP hosts against-- // the original hostname (net.isIP() rejects non-ASCII, so there is no IDNA-- // confusion to guard against here); the normalized form is kept for the-- // DNS-name path below.-+ // Decide whether the host is an IP address by checking both forms of it,-+ // because neither form is enough on its own:-+ //-+ // - The original hostname is needed for IPv6. domainToASCII() returns '' for-+ // an IPv6 literal such as '::1' (it is not a domain).-+ // - The normalized hostname is needed for hosts that net.isIP() rejects but-+ // that normalize to an IPv4 address: '\uFF11\uFF12\uFF17.0.0.1' (fullwidth-+ // digits), '127\u30020.0.1' (ideographic full stop) and '127.1' all become-+ // '127.0.0.1'. The resolver treats them as that address too, so they must-+ // be matched against IP SANs. Letting them fall through to the DNS-name-+ // path would match an IP address against DNS names and the CN instead.-+ let ip = '';- if (net.isIP(hostname)) {-- valid = ips.includes(canonicalizeIP(hostname));-+ ip = hostname;-+ } else if (net.isIP(hostnameASCIIWithoutFQDN)) {-+ ip = hostnameASCIIWithoutFQDN;-+ }-+-+ if (ip) {-+ valid = ips.includes(canonicalizeIP(ip));- if (!valid) {- reason =- `IP: ${hostname} is not in the cert's list: ` + ips.join(', ');-diff --git a/test/parallel/test-tls-check-server-identity.js b/test/parallel/test-tls-check-server-identity.js-index e21f39ccc763..61a2513f81d7 100644---- a/test/parallel/test-tls-check-server-identity.js-+++ b/test/parallel/test-tls-check-server-identity.js-@@ -394,6 +394,47 @@ const tests = [- },- error: 'IP: 127.0.0.1 is not in the cert\'s list: '- },-+ // A host that net.isIP() rejects but that normalizes to an IPv4 address is-+ // an IP address, not a DNS name: it is matched against "IP Address:" SANs,-+ // never against DNS names or the CN.-+ {-+ host: '\uFF11\uFF12\uFF17.0.0.1', // "127.0.0.1" with fullwidth digits.-+ cert: { subjectaltname: 'DNS:127.0.0.1', subject: {} },-+ error: 'IP: \uFF11\uFF12\uFF17.0.0.1 is not in the cert\'s list: '-+ },-+ {-+ host: '\uFF11\uFF12\uFF17.0.0.1',-+ cert: { subjectaltname: 'DNS:*.0.0.1', subject: {} },-+ error: 'IP: \uFF11\uFF12\uFF17.0.0.1 is not in the cert\'s list: '-+ },-+ {-+ host: '\uFF11\uFF12\uFF17.0.0.1',-+ cert: { subject: { CN: '127.0.0.1' } },-+ error: 'IP: \uFF11\uFF12\uFF17.0.0.1 is not in the cert\'s list: '-+ },-+ {-+ host: '\uFF11\uFF12\uFF17.0.0.1',-+ cert: { subjectaltname: 'IP Address:127.0.0.1', subject: {} }-+ },-+ {-+ host: '\uFF11\uFF12\uFF17.0.0.1',-+ cert: { subjectaltname: 'IP Address:127.0.0.2', subject: {} },-+ error: 'IP: \uFF11\uFF12\uFF17.0.0.1 is not in the cert\'s list: 127.0.0.2'-+ },-+ {-+ host: '127\u30020.0.1', // "127.0.0.1" with an ideographic full stop.-+ cert: { subjectaltname: 'DNS:127.0.0.1', subject: {} },-+ error: 'IP: 127\u30020.0.1 is not in the cert\'s list: '-+ },-+ {-+ host: '127.1',-+ cert: { subjectaltname: 'DNS:127.0.0.1', subject: {} },-+ error: 'IP: 127.1 is not in the cert\'s list: '-+ },-+ {-+ host: '127.1',-+ cert: { subjectaltname: 'IP Address:127.0.0.1', subject: {} }-+ },- {- host: 'localhost', cert: {- subjectaltname: 'DNS:a.com',diff --git a/scripts/docker/nodejs-rpm/0004-tls-CVE-2026-106069-reject-non-canonical-ip.patch b/scripts/docker/nodejs-rpm/0004-tls-CVE-2026-106069-reject-non-canonical-ip.patchdeleted file mode 100644index 9d90c564d0..0000000000--- a/scripts/docker/nodejs-rpm/0004-tls-CVE-2026-106069-reject-non-canonical-ip.patch+++ /dev/null@@ -1,288 +0,0 @@-From 935918e3427911f2bef315638d68308dfecc61ba Mon Sep 17 00:00:00 2001-From: Matteo Collina <[email protected]>-Date: Tue, 15 Sep 2026 10:58:38 +0200-Subject: [PATCH] tls: reject non-canonical IP addresses--TLS identity checks normalized non-canonical numeric hosts before-matching certificates. Platform resolvers can interpret the original-host as a different address.--Reject hosts that become IP addresses only after domainToASCII()-normalization.--Assisted-by: Pi-Signed-off-by: Matteo Collina <[email protected]>-PR-URL: https://github.com/nodejs-private/node-private/pull/982-Reviewed-By: Antoine du Hamel <[email protected]>-CVE-ID: CVE-2026-106069----- lib/tls.js | 38 +++++------- test/fixtures/keys/Makefile | 24 +++++++- .../keys/non-canonical-ip-dns-cert.pem | 19 ++++++- .../keys/non-canonical-ip-dns-key.pem | 5 ++- .../test-tls-check-server-identity.js | 67 +++++++++----------- .../test-tls-connect-non-canonical-ip.js | 33 +++++++++- 6 files changed, 131 insertions(+), 55 deletions(-)- create mode 100644 test/fixtures/keys/non-canonical-ip-dns-cert.pem- create mode 100644 test/fixtures/keys/non-canonical-ip-dns-key.pem- create mode 100644 test/parallel/test-tls-connect-non-canonical-ip.js--diff --git a/lib/tls.js b/lib/tls.js-index 42562108eaa7..ba395be5eb33 100644---- a/lib/tls.js-+++ b/lib/tls.js-@@ -439,6 +439,8 @@ exports.checkServerIdentity = function checkServerIdentity(hostname, cert) {- // Remove trailing dots for error messages and matching.- hostname = unfqdn(hostname);- const hostnameASCIIWithoutFQDN = unfqdn(hostnameASCII);-+ const hostnameIsIP = net.isIP(hostname);-+ const hostnameASCIIIsIP = net.isIP(hostnameASCIIWithoutFQDN);-- if (altNames) {- const splitAltNames = altNames.includes('"') ?-@@ -453,29 +455,25 @@ exports.checkServerIdentity = function checkServerIdentity(hostname, cert) {- });- }--+ // Non-canonical IP address spellings can be interpreted differently by-+ // domainToASCII() and the operating system resolver. Reject them instead of-+ // validating a certificate against an address that may not be the peer.-+ if (!hostnameIsIP && hostnameASCIIIsIP) {-+ return new ERR_TLS_CERT_ALTNAME_INVALID(-+ 'Host is a non-canonical IP address', hostname, cert);-+ }-+- let valid = false;- let reason = 'Unknown reason';--- // Decide whether the host is an IP address by checking both forms of it,-- // because neither form is enough on its own:-- //-- // - The original hostname is needed for IPv6. domainToASCII() returns '' for-- // an IPv6 literal such as '::1' (it is not a domain).-- // - The normalized hostname is needed for hosts that net.isIP() rejects but-- // that normalize to an IPv4 address: '\uFF11\uFF12\uFF17.0.0.1' (fullwidth-- // digits), '127\u30020.0.1' (ideographic full stop) and '127.1' all become-- // '127.0.0.1'. The resolver treats them as that address too, so they must-- // be matched against IP SANs. Letting them fall through to the DNS-name-- // path would match an IP address against DNS names and the CN instead.-- let ip = '';-- if (net.isIP(hostname)) {-- ip = hostname;-- } else if (net.isIP(hostnameASCIIWithoutFQDN)) {-- ip = hostnameASCIIWithoutFQDN;-- }---- if (ip) {-- valid = ips.includes(canonicalizeIP(ip));-+ // An IP literal must not be IDNA-normalized: domainToASCII() returns '' for-+ // an IPv6 literal (it is not a domain), so matching against the normalized-+ // host would skip IP-SAN matching for IPv6 entirely. Match IP hosts against-+ // the original hostname (net.isIP() rejects non-ASCII, so there is no IDNA-+ // confusion to guard against here); the normalized form is kept for the-+ // DNS-name path below.-+ if (hostnameIsIP) {-+ valid = ips.includes(canonicalizeIP(hostname));- if (!valid) {- reason =- `IP: ${hostname} is not in the cert's list: ` + ips.join(', ');-diff --git a/test/fixtures/keys/Makefile b/test/fixtures/keys/Makefile-index ac3a01780c7f..c633b12fd7b6 100644---- a/test/fixtures/keys/Makefile-+++ b/test/fixtures/keys/Makefile-@@ -105,6 +105,8 @@ all: \- incorrect_san_correct_subject-key.pem \- irrelevant_san_correct_subject-cert.pem \- irrelevant_san_correct_subject-key.pem \-+ non-canonical-ip-dns-cert.pem \-+ non-canonical-ip-dns-key.pem \- ml_dsa_44_private.pem \- ml_dsa_44_private_seed_only.pem \- ml_dsa_44_private_priv_only.pem \-@@ -1258,6 +1260,28 @@ irrelevant_san_correct_subject-cert.pem: irrelevant_san_correct_subject-key.pem- irrelevant_san_correct_subject-key.pem:- openssl ecparam -name prime256v1 -genkey -noout -out irrelevant_san_correct_subject-key.pem--+non-canonical-ip-dns-cert.pem: non-canonical-ip-dns-key.pem ca1-cert.pem ca1-key.pem-+ openssl req -new \-+ -key non-canonical-ip-dns-key.pem \-+ -out non-canonical-ip-dns-cert.csr \-+ -sha256 \-+ -subj "/CN=Example Operator" \-+ -addext "subjectAltName = DNS:87.0.0.1"-+ openssl x509 -req \-+ -in non-canonical-ip-dns-cert.csr \-+ -CA ca1-cert.pem \-+ -CAkey ca1-key.pem \-+ -passin "pass:password" \-+ -set_serial 0x1001 \-+ -out non-canonical-ip-dns-cert.pem \-+ -days 99999 \-+ -copy_extensions copy \-+ -sha256-+ rm non-canonical-ip-dns-cert.csr-+-+non-canonical-ip-dns-key.pem:-+ openssl ecparam -name prime256v1 -genkey -noout -out non-canonical-ip-dns-key.pem-+- clean:- rm -f *.pfx *.pem *.srl ca2-database.txt ca2-crl-agent3-database.txt* ca2-crl-agent3.cnf ca2-serial fake-startcom-root-serial *.print *.old fake-startcom-root-issued-certs/*.pem- @> fake-startcom-root-database.txt-diff --git a/test/fixtures/keys/non-canonical-ip-dns-cert.pem b/test/fixtures/keys/non-canonical-ip-dns-cert.pem-new file mode 100644-index 000000000000..8d074ee5e159---- /dev/null-+++ b/test/fixtures/keys/non-canonical-ip-dns-cert.pem-@@ -0,0 +1,19 @@-+-----BEGIN CERTIFICATE------+MIIDJDCCAgygAwIBAgICEAEwDQYJKoZIhvcNAQELBQAwejELMAkGA1UEBhMCVVMx-+CzAJBgNVBAgMAkNBMQswCQYDVQQHDAJTRjEPMA0GA1UECgwGSm95ZW50MRAwDgYD-+VQQLDAdOb2RlLmpzMQwwCgYDVQQDDANjYTExIDAeBgkqhkiG9w0BCQEWEXJ5QHRp-+bnljbG91ZHMub3JnMCAXDTI2MDkxNTA4MjM0MloYDzIzMDAwNjMwMDgyMzQyWjAb-+MRkwFwYDVQQDDBBFeGFtcGxlIE9wZXJhdG9yMFkwEwYHKoZIzj0CAQYIKoZIzj0D-+AQcDQgAEtZoLwubUMsMLAtfUgQc7W5WzBW9Y1nq9DTma/F5tUnS7E9nZdnaFd5bj-+hofRf5qjd5FyduDgJU0ABKYHVph8/KOB2zCB2DATBgNVHREEDDAKggg4Ny4wLjAu-+MTAdBgNVHQ4EFgQUUlN/+oxGG+tfBUkKQX1RBmAl0DwwgaEGA1UdIwSBmTCBlqF+-+pHwwejELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQswCQYDVQQHDAJTRjEPMA0G-+A1UECgwGSm95ZW50MRAwDgYDVQQLDAdOb2RlLmpzMQwwCgYDVQQDDANjYTExIDAe-+BgkqhkiG9w0BCQEWEXJ5QHRpbnljbG91ZHMub3JnghRKsWyN/Wp9DS38q9+cSw6S-+xq0CKTANBgkqhkiG9w0BAQsFAAOCAQEApYHYIBczeRxLk1RO1uQICIXtiO1stPu+-+Q7PuFAJsv3n8+jp93kBXQn/p7HsstEC0xZfgJ5AFepkBL+r4Nf6rj7+owhDCDpSI-+2zV62t8Rmh7gbSj2C6O7vUMowXK0RrLlAl9kWJBGAlQ9huLDdtPrbcv6LBEnuTZ2-+B/hJ02I2dVALwuei41R1Omd/mAn1dWozXqlRgF39EUUXWXK/Fd/d44J2cpokLxfs-+3OcMrXWY0dXUdPLCvmOB97egcnpy7APOVDXCRmYEzJktiaESkCgeoXMxXPE6oexz-+OFzMLtMAAPCh3orw06x9kfaZ/BXecWSbtsza8odbQlaQx9ZBBn8eew==-+-----END CERTIFICATE------diff --git a/test/fixtures/keys/non-canonical-ip-dns-key.pem b/test/fixtures/keys/non-canonical-ip-dns-key.pem-new file mode 100644-index 000000000000..a33bd0e27706---- /dev/null-+++ b/test/fixtures/keys/non-canonical-ip-dns-key.pem-@@ -0,0 +1,5 @@-+-----BEGIN EC PRIVATE KEY------+MHcCAQEEICA0HmHFMqxNucO30myyMnWxrGy6kXnfP2hNyOhOvylJoAoGCCqGSM49-+AwEHoUQDQgAEtZoLwubUMsMLAtfUgQc7W5WzBW9Y1nq9DTma/F5tUnS7E9nZdnaF-+d5bjhofRf5qjd5FyduDgJU0ABKYHVph8/A==-+-----END EC PRIVATE KEY------diff --git a/test/parallel/test-tls-check-server-identity.js b/test/parallel/test-tls-check-server-identity.js-index 61a2513f81d7..2097081816ee 100644---- a/test/parallel/test-tls-check-server-identity.js-+++ b/test/parallel/test-tls-check-server-identity.js-@@ -394,46 +394,43 @@ const tests = [- },- error: 'IP: 127.0.0.1 is not in the cert\'s list: '- },-- // A host that net.isIP() rejects but that normalizes to an IPv4 address is-- // an IP address, not a DNS name: it is matched against "IP Address:" SANs,-- // never against DNS names or the CN.-- {-- host: '\uFF11\uFF12\uFF17.0.0.1', // "127.0.0.1" with fullwidth digits.-- cert: { subjectaltname: 'DNS:127.0.0.1', subject: {} },-- error: 'IP: \uFF11\uFF12\uFF17.0.0.1 is not in the cert\'s list: '-- },-- {-- host: '\uFF11\uFF12\uFF17.0.0.1',-- cert: { subjectaltname: 'DNS:*.0.0.1', subject: {} },-- error: 'IP: \uFF11\uFF12\uFF17.0.0.1 is not in the cert\'s list: '-- },-- {-- host: '\uFF11\uFF12\uFF17.0.0.1',-- cert: { subject: { CN: '127.0.0.1' } },-- error: 'IP: \uFF11\uFF12\uFF17.0.0.1 is not in the cert\'s list: '-- },-- {-- host: '\uFF11\uFF12\uFF17.0.0.1',-- cert: { subjectaltname: 'IP Address:127.0.0.1', subject: {} }-- },-- {-- host: '\uFF11\uFF12\uFF17.0.0.1',-- cert: { subjectaltname: 'IP Address:127.0.0.2', subject: {} },-- error: 'IP: \uFF11\uFF12\uFF17.0.0.1 is not in the cert\'s list: 127.0.0.2'-- },-+ // Non-canonical IP addresses are rejected instead of being matched against-+ // an address produced by domainToASCII().-+ ...[-+ ['0127.0.0.1', '87.0.0.1'],-+ ['0177.0.0.1', '127.0.0.1'],-+ ['0x7f.0.0.1', '127.0.0.1'],-+ ['2130706433', '127.0.0.1'],-+ ['127.1', '127.0.0.1'],-+ ['\uFF11\uFF12\uFF17.0.0.1', '127.0.0.1'], // Fullwidth digits.-+ ['127\u30020.0.1', '127.0.0.1'], // Ideographic full stop.-+ ].map(([host, normalized]) => ({-+ host,-+ cert: {-+ subjectaltname: `DNS:${normalized}`,-+ subject: {},-+ },-+ error: 'Host is a non-canonical IP address',-+ })),- {-- host: '127\u30020.0.1', // "127.0.0.1" with an ideographic full stop.-- cert: { subjectaltname: 'DNS:127.0.0.1', subject: {} },-- error: 'IP: 127\u30020.0.1 is not in the cert\'s list: '-+ host: '0127.0.0.1', cert: {-+ subjectaltname: 'IP Address:87.0.0.1',-+ subject: { CN: '87.0.0.1' },-+ },-+ error: 'Host is a non-canonical IP address',- },- {-- host: '127.1',-- cert: { subjectaltname: 'DNS:127.0.0.1', subject: {} },-- error: 'IP: 127.1 is not in the cert\'s list: '-+ host: '0127.0.0.1', cert: {-+ subjectaltname: 'IP Address:87.0.0.1',-+ subject: { CN: 'Example Operator' },-+ },-+ error: 'Host is a non-canonical IP address',- },- {-- host: '127.1',-- cert: { subjectaltname: 'IP Address:127.0.0.1', subject: {} }-+ host: '1.2.3.example', cert: {-+ subjectaltname: 'DNS:1.2.3.example',-+ subject: {},-+ },- },- {- host: 'localhost', cert: {-diff --git a/test/parallel/test-tls-connect-non-canonical-ip.js b/test/parallel/test-tls-connect-non-canonical-ip.js-new file mode 100644-index 000000000000..27a924ada519---- /dev/null-+++ b/test/parallel/test-tls-connect-non-canonical-ip.js-@@ -0,0 +1,33 @@-+'use strict';-+-+const common = require('../common');-+if (!common.hasCrypto)-+ common.skip('missing crypto');-+-+const assert = require('assert');-+const tls = require('tls');-+const fixtures = require('../common/fixtures');-+-+const key = fixtures.readKey('non-canonical-ip-dns-key.pem');-+const cert = fixtures.readKey('non-canonical-ip-dns-cert.pem');-+const ca = fixtures.readKey('ca1-cert.pem');-+const server = tls.createServer({ key, cert }, (socket) => socket.end());-+-+server.listen(0, '127.0.0.1', common.mustCall(() => {-+ const client = tls.connect({-+ host: '0127.0.0.1',-+ port: server.address().port,-+ ca,-+ rejectUnauthorized: true,-+ lookup: common.mustCall((hostname, options, callback) => {-+ assert.strictEqual(hostname, '0127.0.0.1');-+ assert.strictEqual(options.all, true);-+ callback(null, [{ address: '127.0.0.1', family: 4 }]);-+ }),-+ }, common.mustNotCall());-+-+ client.on('error', common.mustCall((error) => {-+ assert.strictEqual(error.code, 'ERR_TLS_CERT_ALTNAME_INVALID');-+ server.close();-+ }));-+}));diff --git a/scripts/docker/nodejs-rpm/0005-dns-CVE-2026-105482-reject-null-bytes.patch b/scripts/docker/nodejs-rpm/0005-dns-CVE-2026-105482-reject-null-bytes.patchdeleted file mode 100644index 690d2dc31b..0000000000--- a/scripts/docker/nodejs-rpm/0005-dns-CVE-2026-105482-reject-null-bytes.patch+++ /dev/null@@ -1,189 +0,0 @@-From 843a1627dce1d1cbb7cf91489a89dbf837044b3f Mon Sep 17 00:00:00 2001-From: James M Snell <[email protected]>-Date: Fri, 18 Sep 2026 21:58:43 +0000-Subject: [PATCH] dns: validate resolve inputs for null bytes--Signed-off-by: James M Snell <[email protected]>-Assisted-by: Opencode-PR-URL: https://github.com/nodejs-private/node-private/pull/984-Reviewed-By: Antoine du Hamel <[email protected]>-CVE-ID: CVE-2026-105482----- lib/internal/dns/callback_resolver.js | 4 +-- lib/internal/dns/promises.js | 2 +-- lib/internal/dns/utils.js | 5 +-- test/parallel/test-dns-resolve-null-bytes.js | 75 ++++++++++++++++++++- test/parallel/test-dns-setlocaladdress.js | 21 ++++++- 5 files changed, 102 insertions(+), 5 deletions(-)- create mode 100644 test/parallel/test-dns-resolve-null-bytes.js--diff --git a/lib/internal/dns/callback_resolver.js b/lib/internal/dns/callback_resolver.js-index f634f452e913..68822ea291b6 100644---- a/lib/internal/dns/callback_resolver.js-+++ b/lib/internal/dns/callback_resolver.js-@@ -20,7 +20,7 @@ const {-- const {- validateFunction,-- validateString,-+ validateStringWithoutNullBytes,- } = require('internal/validators');-- const {-@@ -59,7 +59,7 @@ function resolver(bindingName) {- callback = arguments[2];- }--- validateString(name, 'name');-+ validateStringWithoutNullBytes(name, 'name');- validateFunction(callback, 'callback');-- const req = new QueryReqWrap();-diff --git a/lib/internal/dns/promises.js b/lib/internal/dns/promises.js-index 0a67e2e196f4..90c8b9811dfb 100644---- a/lib/internal/dns/promises.js-+++ b/lib/internal/dns/promises.js-@@ -340,7 +340,7 @@ function createResolverPromise(resolver, bindingName, hostname, ttl) {-- function resolver(bindingName) {- function query(name, options) {-- validateString(name, 'name');-+ validateStringWithoutNullBytes(name, 'name');-- const ttl = !!(options?.ttl);- return createResolverPromise(this, bindingName, name, ttl);-diff --git a/lib/internal/dns/utils.js b/lib/internal/dns/utils.js-index 09e554ff5af3..4b78ed91fb2f 100644---- a/lib/internal/dns/utils.js-+++ b/lib/internal/dns/utils.js-@@ -26,6 +26,7 @@ const {- validateOneOf,- validatePort,- validateString,-+ validateStringWithoutNullBytes,- validateUint32,- } = require('internal/validators');- let binding;-@@ -178,10 +179,10 @@ class ResolverBase {--- setLocalAddress(ipv4, ipv6) {-- validateString(ipv4, 'ipv4');-+ validateStringWithoutNullBytes(ipv4, 'ipv4');-- if (ipv6 !== undefined) {-- validateString(ipv6, 'ipv6');-+ validateStringWithoutNullBytes(ipv6, 'ipv6');- }-- this._handle.setLocalAddress(ipv4, ipv6);-diff --git a/test/parallel/test-dns-resolve-null-bytes.js b/test/parallel/test-dns-resolve-null-bytes.js-new file mode 100644-index 000000000000..ef091d06a0d4---- /dev/null-+++ b/test/parallel/test-dns-resolve-null-bytes.js-@@ -0,0 +1,75 @@-+'use strict';-+const common = require('../common');-+-+// Names containing null bytes must be rejected by the resolver methods.-+// c-ares receives the name as a C string, so everything after the first-+// null byte would otherwise be silently dropped, e.g. resolving-+// 'example.com\0.trusted.corp' would actually query 'example.com'.-+-+const assert = require('assert');-+const dns = require('dns');-+const dnsPromises = dns.promises;-+-+const name = 'example.com\u0000.trusted.corp';-+const ip = '127.0.0.1\u0000.trusted.corp';-+-+const err = {-+ code: 'ERR_INVALID_ARG_VALUE',-+ name: 'TypeError',-+ message: /^The argument 'name' must be a string without null bytes\. Received /,-+};-+-+const methods = [-+ 'resolve',-+ 'resolve4',-+ 'resolve6',-+ 'resolveAny',-+ 'resolveCaa',-+ 'resolveCname',-+ 'resolveMx',-+ 'resolveNaptr',-+ 'resolveNs',-+ 'resolvePtr',-+ 'resolveSoa',-+ 'resolveSrv',-+ 'resolveTlsa',-+ 'resolveTxt',-+];-+-+const rrtypes = [-+ 'A',-+ 'AAAA',-+ 'ANY',-+ 'CAA',-+ 'CNAME',-+ 'MX',-+ 'NAPTR',-+ 'NS',-+ 'PTR',-+ 'SOA',-+ 'SRV',-+ 'TLSA',-+ 'TXT',-+];-+-+// Callback-based API: the default resolver and a Resolver instance.-+for (const resolver of [dns, new dns.Resolver()]) {-+ for (const method of methods) {-+ assert.throws(() => resolver[method](name, common.mustNotCall()), err);-+ }-+ for (const rrtype of rrtypes) {-+ assert.throws(() => resolver.resolve(name, rrtype, common.mustNotCall()), err);-+ }-+ assert.throws(() => resolver.reverse(ip, common.mustNotCall()), err);-+}-+-+// Promise-based API: the default resolver and a Resolver instance.-+for (const resolver of [dnsPromises, new dnsPromises.Resolver()]) {-+ for (const method of methods) {-+ assert.throws(() => resolver[method](name), err);-+ }-+ for (const rrtype of rrtypes) {-+ assert.throws(() => resolver.resolve(name, rrtype), err);-+ }-+ assert.throws(() => resolver.reverse(ip), err);-+}-diff --git a/test/parallel/test-dns-setlocaladdress.js b/test/parallel/test-dns-setlocaladdress.js-index 25bece328f4a..b47916115a26 100644---- a/test/parallel/test-dns-setlocaladdress.js-+++ b/test/parallel/test-dns-setlocaladdress.js-@@ -38,3 +38,24 @@ const promiseResolver = new dns.promises.Resolver();- promiseResolver.setLocalAddress();- }, Error);- }-+-+// Verify that setLocalAddress rejects addresses containing null bytes instead-+// of silently truncating them at the first null byte-+{-+ for (const r of [resolver, promiseResolver]) {-+ assert.throws(() => {-+ r.setLocalAddress('127.0.0.1\u0000junk');-+ }, {-+ code: 'ERR_INVALID_ARG_VALUE',-+ name: 'TypeError',-+ message: /^The argument 'ipv4' must be a string without null bytes\. Received /,-+ });-+ assert.throws(() => {-+ r.setLocalAddress('127.0.0.1', '::1\u0000junk');-+ }, {-+ code: 'ERR_INVALID_ARG_VALUE',-+ name: 'TypeError',-+ message: /^The argument 'ipv6' must be a string without null bytes\. Received /,-+ });-+ }-+}diff --git a/scripts/docker/nodejs-rpm/Dockerfile b/scripts/docker/nodejs-rpm/Dockerfileindex 8f555d4c9e..63aa09e652 100644--- a/scripts/docker/nodejs-rpm/Dockerfile+++ b/scripts/docker/nodejs-rpm/Dockerfile@@ -1,4 +1,4 @@-# TEMPORARY(node-24.22.1-security): see build.sh.+# Disabled; see README.md.## Builds the patched nodejs:24 RPMs and publishes them as a scratch image of# /rpms, which web/Dockerfile and worker/Dockerfile pull by digest. Built anddiff --git a/scripts/docker/nodejs-rpm/README.md b/scripts/docker/nodejs-rpm/README.mdnew file mode 100644index 0000000000..de5a7fe60f--- /dev/null+++ b/scripts/docker/nodejs-rpm/README.md@@ -0,0 +1,83 @@+# Patched nodejs RPMs (disabled)++The web and worker images install Node from Red Hat's `nodejs:24` module RPMs,+because only that build links the system OpenSSL and its FIPS provider. When+Red Hat lags behind a Node security release, this directory rebuilds Red Hat's+signed source RPM with the upstream fixes, and the images install the result+until Red Hat ships its own errata.++It is currently disabled: Red Hat's `nodejs:24` passes every check in+`test-node-security-fixes.js`, and the images install it straight from the UBI+repos.++| File | Role |+| ----------------------------- | ----------------------------------------------------------------------------------------------------------------- |+| `build.sh` | Rebuilds Red Hat's source RPM with the files in `PATCHES`; the header lists each patch and its CVE. |+| `0002-placeholder.patch` | Stands in for the upstream fix commits; replace it with one `git format-patch` file per fix. |+| `Dockerfile` | Builds the RPMs, verifies the fixes and FIPS mode, and packs them into a scratch image. |+| `install-nodejs.sh` | Installs the patched RPMs while they are newer than the repos' `nodejs`, otherwise Red Hat's. |+| `test-node-security-fixes.js` | Fails unless the installed Node has every fix. Runs in this image, and in the web and worker images once revived. |++`.github/workflows/nodejs-rpm.yml` builds the image for amd64 and arm64 and+publishes it to `ghcr.io/langfuse/langfuse-nodejs-rpm`. For a worked example,+`git show f0f65b838a -- scripts/docker/nodejs-rpm/` has the last patch set:+four Node 24.22.1 fixes on Red Hat's `nodejs-24.21.0-1`.++## Reviving it++1. **Rebase the build.** In `build.sh`, point `SRPM_NAME`, `SRPM_SHA256` and+ `DIST` at Red Hat's current `nodejs:24` source RPM (keep the `.lf1` suffix+ on `DIST`), replace `0002-placeholder.patch` with the new upstream fixes,+ and list them in `PATCHES` and the header. Update the version in the+ `%changelog` line and the `TAG` in the workflow.+2. **Extend the test.** Add a check to `test-node-security-fixes.js` per fix+ that fails on Red Hat's build and passes on the patched one.+3. **Publish.** Uncomment the `pull_request` and `push` triggers in+ `nodejs-rpm.yml`. A pull request builds and verifies (a cold build takes+ about 70 minutes); merging publishes and prints the digest to pin in the+ job summary.+4. **Install it in both `web/Dockerfile` and `worker/Dockerfile`.** After+ the `MICRO_BASE_IMAGE` arg, add the image line the job summary printed and+ a stage for it:++ ```dockerfile+ ARG NODEJS_RPM_IMAGE=ghcr.io/langfuse/langfuse-nodejs-rpm:<TAG>@sha256:<digest>+ FROM ${NODEJS_RPM_IMAGE} AS nodejs-rpm+ ```++ In the `base` stage, replace the `nodejs` install with this one, which+ installs the patched RPMs and fails the build if Node lacks any fix:++ ```dockerfile+ COPY scripts/docker/nodejs-rpm/install-nodejs.sh scripts/docker/nodejs-rpm/test-node-security-fixes.js /opt/nodejs-rpm/+ RUN --mount=type=bind,from=nodejs-rpm,source=/rpms,target=/tmp/nodejs-rpms \+ dnf -y upgrade && \+ bash /opt/nodejs-rpm/install-nodejs.sh /tmp/nodejs-rpms \+ nodejs nodejs-libs npm nodejs-full-i18n openssl-fips-provider openssl-fips-provider-so && \+ dnf clean all && \+ node /opt/nodejs-rpm/test-node-security-fixes.js+ ```++ In the `rpm-installer` stage, replace the `RUN` with the two+ `dnf --installroot /mnt/rootfs` calls with this one. `install-nodejs.sh`+ only swaps in patched RPMs for packages named on its command line, and+ needs them all in one call; the `rpm --root` check fails the build if the+ runtime image got a different `nodejs` than the tested one:++ ```dockerfile+ RUN --mount=type=bind,from=nodejs-rpm,source=/rpms,target=/tmp/nodejs-rpms \+ NODEJS_INSTALLROOT=/mnt/rootfs bash /opt/nodejs-rpm/install-nodejs.sh /tmp/nodejs-rpms \+ nodejs nodejs-libs npm nodejs-full-i18n openssl-fips-provider openssl-fips-provider-so \+ bash coreutils-single sed \+ tzdata ca-certificates crypto-policies wget && \+ test "$(rpm --root /mnt/rootfs -q nodejs)" = "$(rpm -q nodejs)" && \+ dnf --installroot /mnt/rootfs clean all && \+ rm -rf /mnt/rootfs/var/cache /mnt/rootfs/var/log/dnf*+ ```++## Disabling it again++Once Red Hat ships a newer `nodejs:24`, `install-nodejs.sh` installs it and+logs `Red Hat's nodejs ... is newer than the patched ...`. If the image build+still passes `test-node-security-fixes.js`, undo steps 3 and 4 and keep the+new checks in the test.diff --git a/scripts/docker/nodejs-rpm/build.sh b/scripts/docker/nodejs-rpm/build.shindex 103bdd04b0..1cd9434471 100644--- a/scripts/docker/nodejs-rpm/build.sh+++ b/scripts/docker/nodejs-rpm/build.sh@@ -1,16 +1,12 @@#!/usr/bin/env bash-# TEMPORARY(node-24.22.1-security): remove scripts/docker/nodejs-rpm/ once Red-# Hat ships a nodejs:24 errata for RHEL 9 that passes test-node-security-fixes.js.+# Disabled; see README.md.## Rebuilds Red Hat's nodejs:24 module RPMs from their source RPM with these-# fixes from Node 24.22.1, vendored verbatim from its v24.x branch:-# 0002 nodejs/node@49dff6f57aa7 CVE-2026-111497 bundled Brotli decoder-# (in libnode, so the system brotli package-# does not fix it)-# 0003 nodejs/node@de49c913f232 CVE-2026-105483 tls: IP normalization-# 0004 nodejs/node@935918e34279 CVE-2026-106069 tls: non-canonical IPs-# 0005 nodejs/node@843a1627dce1 CVE-2026-105482 dns: null bytes in names-# 0004 rewrites the code 0003 adds, so they apply in that (upstream) order.+# fixes from a newer Node release, vendored verbatim from its release branch:+# 0002 placeholder: replace with one row per patch, e.g.+# nodejs/node@<commit> CVE-<id> <what it fixes>+# Patches apply in the order listed, which must follow upstream's when one+# rewrites code another adds.## Everything else is Red Hat's: spec, patches (including the FIPS patch),# configure flags and compiler flags. Node keeps linking the system OpenSSL, so@@ -33,10 +29,7 @@ readonly SRPM_SHA256=3f5b2604c4b8391235ab4bc3de0e1e2e847fe9cca2167f7b8612fda7874readonly SRPM_URL="https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi9/9/x86_64/appstream/source/SRPMS/Packages/n/${SRPM_NAME}"readonly DIST=.module+el9.8.0+24924+cd677006.lf1readonly -a PATCHES=(- 0002-deps-brotli-CVE-2026-111497-block-switch.patch- 0003-tls-CVE-2026-105483-ip-normalization-regression.patch- 0004-tls-CVE-2026-106069-reject-non-canonical-ip.patch- 0005-dns-CVE-2026-105482-reject-null-bytes.patch+ 0002-placeholder.patch)readonly SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"readonly TOPDIR=/build/rpmbuild@@ -67,7 +60,7 @@ done# Apply after Red Hat's FIPS patch; %autosetup -S git_am applies %patchlist in# order with git am, which fails on any patch that does not apply exactly.sed -i "s|^0001-fips-disable-options.patch\$|&$(printf '\\n%s' "${PATCHES[@]}")|" "$SPEC"-sed -i "s|^%changelog\$|&\n* $(LC_ALL=C date -u '+%a %b %d %Y') gage-clickhouse <[email protected]> - 1:24.21.0-1${DIST}\n- Backport fixes from Node 24.22.1 for CVE-2026-111497 (bundled Brotli),\n CVE-2026-105483 and CVE-2026-106069 (tls), CVE-2026-105482 (dns)\n|" "$SPEC"+sed -i "s|^%changelog\$|&\n* $(LC_ALL=C date -u '+%a %b %d %Y') gage-clickhouse <[email protected]> - 1:24.21.0-1${DIST}\n- Backport upstream Node security fixes: ${PATCHES[*]}\n|" "$SPEC"for patch in "${PATCHES[@]}"; dogrep -qx "$patch" "$SPEC" || { echo "Failed to add ${patch} to ${SPEC}" >&2; exit 1; }donediff --git a/scripts/docker/nodejs-rpm/install-nodejs.sh b/scripts/docker/nodejs-rpm/install-nodejs.shindex 27fcb47a5c..5c0ad5eae7 100644--- a/scripts/docker/nodejs-rpm/install-nodejs.sh+++ b/scripts/docker/nodejs-rpm/install-nodejs.sh@@ -1,13 +1,13 @@#!/usr/bin/env bash-# TEMPORARY(node-24.22.1-security): see build.sh.+# Disabled; see README.md.## Enables the nodejs:24 module and installs the given packages in one dnf# transaction, taking nodejs, nodejs-libs, nodejs-full-i18n and npm from the# patched RPMs built by build.sh only while those are newer than what Red Hat's# repos offer. Once Red Hat ships a newer nodejs, this installs theirs instead,# and test-node-security-fixes.js (run by the Dockerfiles right after) decides-# whether it also has every fix: if it does, delete scripts/docker/nodejs-rpm/;-# if not, rebase the patches onto Red Hat's new source RPM.+# whether it also has every fix: if it does, disable the patched RPMs again+# (README.md); if not, rebase the patches onto Red Hat's new source RPM.## Usage: install-nodejs.sh RPM_DIR PACKAGE...# NODEJS_INSTALLROOT install into this root instead of /. Pass every package@@ -46,8 +46,9 @@ if [ "$(rpm --eval "%{lua: print(rpm.vercmp('${vendored}', '${available}'))}")"packages[$i]="$file"doneelse- echo "Red Hat's nodejs ${available} is not older than the patched ${vendored};" \- "installing it. If the security fix checks pass, remove scripts/docker/nodejs-rpm/."+ echo "Red Hat's nodejs ${available} is newer than the patched ${vendored};" \+ "installing it. If the security fix checks pass, disable the patched RPMs" \+ "again (scripts/docker/nodejs-rpm/README.md)."fi# The patched RPMs are built in CI from Red Hat's signed source RPM and pulleddiff --git a/scripts/docker/nodejs-rpm/test-node-security-fixes.js b/scripts/docker/nodejs-rpm/test-node-security-fixes.jsindex ac82d67d7f..e9bcb481a2 100644--- a/scripts/docker/nodejs-rpm/test-node-security-fixes.js+++ b/scripts/docker/nodejs-rpm/test-node-security-fixes.js@@ -1,4 +1,4 @@-// TEMPORARY(node-24.22.1-security): see build.sh.+// Disabled; see README.md.//// Fails unless the installed Node has every fix that build.sh patches in. Each// check calls the affected API directly and needs no network or certificates.diff --git a/web/Dockerfile b/web/Dockerfileindex 960af4f5f9..73c40b33f5 100644--- a/web/Dockerfile+++ b/web/Dockerfile@@ -14,13 +14,6 @@ARG BASE_IMAGE=registry.access.redhat.com/ubi9/ubi:9.8ARG MICRO_BASE_IMAGE=registry.access.redhat.com/ubi9/ubi-micro:9.8-# TEMPORARY(node-24.22.1-security): Red Hat's nodejs:24 RPMs rebuilt with-# security fixes from Node 24.22.1 (scripts/docker/nodejs-rpm/). install-nodejs.sh-# uses them only while they are newer than the repos' nodejs, and the check-# below fails the build if the installed Node lacks any of the fixes.-ARG NODEJS_RPM_IMAGE=ghcr.io/langfuse/langfuse-nodejs-rpm:24.21.0-1.lf1@sha256:a64b46f8d92f11dacba52f2d10fc52be62944b5a992d00681a2e9cfa105e9637-FROM ${NODEJS_RPM_IMAGE} AS nodejs-rpm-FROM --platform=${TARGETPLATFORM:-linux/amd64} ${BASE_IMAGE} AS base# nodejs:24 and openssl (incl. the FIPS provider) come from the freely@@ -28,13 +21,10 @@ FROM --platform=${TARGETPLATFORM:-linux/amd64} ${BASE_IMAGE} AS base# nodejs-full-i18n is required: the RPM Node is a small-ICU build and V8# segfaults in Intl.Segmenter (used e.g. by the prisma CLI's output# formatting) without the full ICU data.-COPY scripts/docker/nodejs-rpm/install-nodejs.sh scripts/docker/nodejs-rpm/test-node-security-fixes.js /opt/nodejs-rpm/-RUN --mount=type=bind,from=nodejs-rpm,source=/rpms,target=/tmp/nodejs-rpms \- dnf -y upgrade && \- bash /opt/nodejs-rpm/install-nodejs.sh /tmp/nodejs-rpms \- nodejs nodejs-libs npm nodejs-full-i18n openssl-fips-provider openssl-fips-provider-so && \- dnf clean all && \- node /opt/nodejs-rpm/test-node-security-fixes.js+RUN dnf -y upgrade && \+ dnf -y module enable nodejs:24 && \+ dnf -y install --setopt=install_weak_deps=0 nodejs npm nodejs-full-i18n && \+ dnf clean allFROM --platform=${TARGETPLATFORM:-linux/amd64} base AS build-base# Pin turbo to avoid nondeterministic prune output from future patch releases.@@ -59,14 +49,14 @@ ARG GID=1001# wget keeps exec-style container health checks working (e.g. `wget --spider# http://127.0.0.1:<port>/...` in ECS task definitions); it links GnuTLS,# which follows the host's FIPS mode like OpenSSL does.-# The rpmdb check fails the build if the rootfs resolved a different nodejs-# than the build stages.-RUN --mount=type=bind,from=nodejs-rpm,source=/rpms,target=/tmp/nodejs-rpms \- NODEJS_INSTALLROOT=/mnt/rootfs bash /opt/nodejs-rpm/install-nodejs.sh /tmp/nodejs-rpms \- nodejs nodejs-libs npm nodejs-full-i18n openssl-fips-provider openssl-fips-provider-so \- bash coreutils-single sed \+RUN dnf -y --installroot /mnt/rootfs --releasever 9 --setopt=install_weak_deps=0 \+ --disableexcludes=all \+ module enable nodejs:24 && \+ dnf -y --installroot /mnt/rootfs --releasever 9 \+ --setopt=install_weak_deps=0 --setopt=tsflags=nodocs \+ --disableexcludes=all \+ install nodejs nodejs-full-i18n bash coreutils-single sed \tzdata ca-certificates crypto-policies wget && \- test "$(rpm --root /mnt/rootfs -q nodejs)" = "$(rpm -q nodejs)" && \dnf --installroot /mnt/rootfs clean all && \rm -rf /mnt/rootfs/var/cache /mnt/rootfs/var/log/dnf*diff --git a/worker/Dockerfile b/worker/Dockerfileindex b48de78395..302604e7ac 100644--- a/worker/Dockerfile+++ b/worker/Dockerfile@@ -14,13 +14,6 @@ARG BASE_IMAGE=registry.access.redhat.com/ubi9/ubi:9.8ARG MICRO_BASE_IMAGE=registry.access.redhat.com/ubi9/ubi-micro:9.8-# TEMPORARY(node-24.22.1-security): Red Hat's nodejs:24 RPMs rebuilt with-# security fixes from Node 24.22.1 (scripts/docker/nodejs-rpm/). install-nodejs.sh-# uses them only while they are newer than the repos' nodejs, and the check-# below fails the build if the installed Node lacks any of the fixes.-ARG NODEJS_RPM_IMAGE=ghcr.io/langfuse/langfuse-nodejs-rpm:24.21.0-1.lf1@sha256:a64b46f8d92f11dacba52f2d10fc52be62944b5a992d00681a2e9cfa105e9637-FROM ${NODEJS_RPM_IMAGE} AS nodejs-rpm-FROM --platform=${TARGETPLATFORM:-linux/amd64} ${BASE_IMAGE} AS base# nodejs:24 and openssl (incl. the FIPS provider) come from the freely@@ -28,13 +21,10 @@ FROM --platform=${TARGETPLATFORM:-linux/amd64} ${BASE_IMAGE} AS base# nodejs-full-i18n is required: the RPM Node is a small-ICU build and V8# segfaults in Intl.Segmenter (used e.g. by the prisma CLI's output# formatting) without the full ICU data.-COPY scripts/docker/nodejs-rpm/install-nodejs.sh scripts/docker/nodejs-rpm/test-node-security-fixes.js /opt/nodejs-rpm/-RUN --mount=type=bind,from=nodejs-rpm,source=/rpms,target=/tmp/nodejs-rpms \- dnf -y upgrade && \- bash /opt/nodejs-rpm/install-nodejs.sh /tmp/nodejs-rpms \- nodejs nodejs-libs npm nodejs-full-i18n openssl-fips-provider openssl-fips-provider-so && \- dnf clean all && \- node /opt/nodejs-rpm/test-node-security-fixes.js+RUN dnf -y upgrade && \+ dnf -y module enable nodejs:24 && \+ dnf -y install --setopt=install_weak_deps=0 nodejs npm nodejs-full-i18n && \+ dnf clean allFROM --platform=${TARGETPLATFORM:-linux/amd64} base AS build-base# Pin turbo to avoid nondeterministic prune output from future patch releases.@@ -59,14 +49,14 @@ ARG GID=1001# wget keeps exec-style container health checks working (e.g. `wget --spider# http://127.0.0.1:<port>/...` in ECS task definitions); it links GnuTLS,# which follows the host's FIPS mode like OpenSSL does.-# The rpmdb check fails the build if the rootfs resolved a different nodejs-# than the build stages.-RUN --mount=type=bind,from=nodejs-rpm,source=/rpms,target=/tmp/nodejs-rpms \- NODEJS_INSTALLROOT=/mnt/rootfs bash /opt/nodejs-rpm/install-nodejs.sh /tmp/nodejs-rpms \- nodejs nodejs-libs npm nodejs-full-i18n openssl-fips-provider openssl-fips-provider-so \- bash coreutils-single sed \+RUN dnf -y --installroot /mnt/rootfs --releasever 9 --setopt=install_weak_deps=0 \+ --disableexcludes=all \+ module enable nodejs:24 && \+ dnf -y --installroot /mnt/rootfs --releasever 9 \+ --setopt=install_weak_deps=0 --setopt=tsflags=nodocs \+ --disableexcludes=all \+ install nodejs nodejs-full-i18n bash coreutils-single sed \tzdata ca-certificates crypto-policies wget && \- test "$(rpm --root /mnt/rootfs -q nodejs)" = "$(rpm -q nodejs)" && \dnf --installroot /mnt/rootfs clean all && \rm -rf /mnt/rootfs/var/cache /mnt/rootfs/var/log/dnf*