
Corrected 16 November 2026: on re-checking, finding 3 was shown wrong and moved to excluded. Before: 0 High, 5 Medium, 9 Low, 2 Info, 0 excluded on review. Now: 0 High, 5 Medium, 8 Low, 2 Info, 1 excluded on review. Only these moves change the figures above; the re-check of the other findings is in the section below.
| Audited | Node.js API reference v24.22.1, addons to module (32 pages), pages fetched 21 October 2026 |
|---|---|
| Date | 22 October 2026 |
| How it ran | local run on our workstation, full audit, Standard review |
| Verdict after review | Pass with notes (Fail if a High finding remains after review, otherwise Pass with notes) |
Related: Node.js API documentation, part 2 of 2 (October 2026) · cloudflare/security-audit-skill (October 2026)
Re-checked 16 November 2026
Every finding of this audit was checked again against today's documentation. Status: Still present = the error is in the current v24 documentation and on main; Fixed on main only = corrected on main, still in the v24 documentation; Already in an open Node.js pull request = still present, and an open pull request makes the fix; Wrong at audit (excluded) = the finding was wrong when we made it and is now listed as excluded; Could not check = the page could not be compared.
Examples were run on Node v24.15.0; documentation compared on v24.22.3 and main.
| # | Finding | Status today | Rating at audit → now |
|---|---|---|---|
| 1 | Server sample answers with a request value and no content type | Still present | Info → Info |
| 2 | Http2 secure server timeout default contradicts the rest of the page | Still present | Low → Low |
| 3 | Minimum for maxHeaderListPairs differs between the three option lists | Wrong at audit (excluded) | Low → excluded |
| 4 | Stray semicolon in an event heading | Still present | Info → Info |
| 5 | Load-hook sample throws away its own source rewrite | Already in an open Node.js pull request | Medium → Medium |
| 6 | Synchronous import-map hook sample calls readFileSync on the promises module | Already in an open Node.js pull request | Medium → Medium |
| 7 | WebAssembly text sample exports an identifier it never defined | Still present | Medium → Medium |
| 8 | Suggested replacement for util.isDate() is never true | Still present | Medium → Medium |
| 9 | Config-file example contains a key the page says is forbidden | Still present | Medium → Medium |
| 10 | traceCallback example uses names that are never defined | Still present | Low → Low |
| 11 | Wasm import example names index.js but runs index.mjs | Still present | Low → Low |
| 12 | Proxy examples pass a callback to fetch() | Still present | Low → Low |
| 13 | Environment-file page claims a file can be sourced by a shell | Still present | Low → Low |
| 14 | keepAliveTimeout default stated twice with different values | Fixed on main only | Low → Low |
| 15 | crypto.verify gives the wrong default PSS salt length | Still present | Low → Info |
| 16 | File-handle sample closes a handle that may be undefined | Still present | Low → Low |
The full record of this re-check: github.com/ondrejdvorak78/nodejs-v24-api-docs-errors.
Each finding keeps the number it has in the audit report. The rating shown first is the one after review; the first automated rating is listed with it. 5 findings were first rated Medium or High; 5 of them are Medium or High after review. Text marked "From the report" is quoted from the audit report; fixes are suggestions and were not tested. Locations are paths inside the fetched copy of the documentation.
Medium after review (5)
module.md:1039From the report
source: source.replace(/foo/g, 'bar'),
...result,
The spread of result comes after the rewritten source, so result.source from nextLoad overwrites it and the documented 'foo' to 'bar' replacement never happens. Reach: any developer copying the synchronous registerHooks load-hook example to transform module source gets unmodified source and no error.
Spread first and override after: return { ...result, source: source.replace(/foo/g, 'bar') };
module.md:1813From the report
import fs from 'node:fs/promises';
...
const { imports } = JSON.parse(fs.readFileSync('import-map.json', 'utf-8'));
node:fs/promises has no readFileSync, so the sample throws TypeError: fs.readFileSync is not a function on every run, before any hook is registered (import at line 1810). Reach: any developer following the Synchronous version of the import-maps example.
Import from 'node:fs' (or import { readFileSync } from 'node:fs').
esm.md:805From the report
(func $getLength (param $str externref) (result i32)
...
(export "getLength" (func $get_length))
The function is declared as $getLength (line 799) but exported through $get_length, so the module does not assemble. The following import examples (lines 810 and 834) cannot be reproduced. Reach: a developer building string-len.wasm from the page.
Export the declared name: (export "getLength" (func $getLength)).
deprecations.md:1147From the report
`Date.prototype.toString.call(arg) === '[object Date]' && !isNaN(arg)`.
Date.prototype.toString returns the formatted date string, never '[object Date]', so the expression is false for every valid Date. The page presents it as the stronger approach to replace the removed util.isDate(). Reach: a developer migrating off util.isDate() who follows this advice silently stops matching dates.
Use Object.prototype.toString.call(arg) === '[object Date]' && !isNaN(arg), or arg instanceof Date alone.
cli.md:1033From the report
"nodeOptions": { ... "watch-preserve-output": true }, ... "watch": { "watch-preserve-output": true }
The only full example puts watch-preserve-output in both nodeOptions (line 1027) and watch (line 1033), while the same page says 'Keys cannot be duplicated within the same or different namespaces' and that the parser throws on invalid keys. Reach: a developer who copies the sample configuration file for --experimental-config-file hits the documented error.
Keep the key in one namespace only and make the equivalent command line match.
Low after review (8)
http2.md:2743From the report
* `msecs` {number} **Default:** `120000` (2 minutes)
server.setTimeout() on the secure server states 120000 ms, while server.timeout on the same page (line 2766) and the changelog note (line 2681) say the default is 0 (no timeout). The same stale figure appears in https.md line 225, against https.md line 241. The correct value is stated nearby, so a reader is misled only if they read the one entry.
State 0 (no timeout) in both setTimeout entries.
diagnostics_channel.md:916From the report
channels.traceCallback((arg1, callback) => {
callback(null, 'result');
}, 1, { some: 'thing' }, thisArg, arg1, callback);
thisArg, arg1 and callback are not declared at the call site, so the sample throws ReferenceError if copied as written. It reads as an illustrative skeleton, which keeps it at LOW.
Declare the values or pass literals, for example traceCallback(fn, 1, ctx, undefined, 'arg', (err, res) => {}).
esm.md:845From the report
For example, an `index.js` containing: ... node index.mjs
The prose says to create index.js, the command runs index.mjs. A reader sees the mismatch at once and the fix is trivial.
Use one file name in the prose and the command.
http.md:4602From the report
fetch('https://www.example.com', (res) => {
// This request will be proxied if HTTPS_PROXY or https_proxy is set
});
fetch() takes (url, init) and never calls a callback; the same pattern repeats at lines 4621, 4645 and 4664. The request is still proxied, so the effect is a misleading sample, not a failure.
Show const res = await fetch('https://www.example.com');
environment_variables.md:131From the report
This is useful so that the file can be sourced, without modifications, in shell terminals.
...
export MY_VAR = my variable
The page's own examples use spaces around = and unquoted multi-word values, which a POSIX shell rejects. The statement is about the optional export prefix, not a step to follow, so impact is limited.
Show export MY_VAR='my variable' or note that Node accepts forms a shell does not.
http.md:3749From the report
**Default:** `65000`. (against line 1993: Default: `5000`)
The createServer option says 65000, the server.keepAliveTimeout entry says 5000. The same page holds both figures; https.md line 251 repeats 5000.
State one default in both places.
crypto.md:6800From the report
`crypto.constants.RSA_PSS_SALTLEN_MAX_SIGN` (default) sets it to the maximum permissible value.
The verify.verify entry (line 2925) gives RSA_PSS_SALTLEN_AUTO as the default for verification; crypto.verify states the signing default instead. The class entry states the correct behaviour.
State RSA_PSS_SALTLEN_AUTO as the default in crypto.verify.
fs.md:9213From the report
let file;
try {
file = await open('/open/some/file.txt', 'r');
...
} finally {
await file.close();
If open() rejects, file is undefined and the finally block throws a TypeError that hides the original error. Other samples on the page use file?.close().
Use await file?.close();
Info after review (2)
async_hooks.md:725From the report
executionAsyncResource()[sym] = { state: req.url };
setTimeout(function() {
res.end(JSON.stringify(executionAsyncResource()[sym]));
The sample writes a value taken from the request URL into the response body without setting a Content-Type or a nosniff header (the same sample is repeated near line 751). The value is JSON-encoded and browsers percent-encode URLs, so a copied sample is not shown to be exploitable; it is a hardening gap in sample code that readers copy.
Add res.setHeader('Content-Type', 'application/json') and X-Content-Type-Options: nosniff to both copies of the sample.
inspector.md:261From the report
#### Event: `<inspector-protocol-method>`;
The callback-API copy of the heading ends with a semicolon; the promise-API copy at line 82 does not.
Remove the trailing semicolon.
Excluded on review (1)
Findings the review showed to be wrong or a repeat of another finding. They are not counted above.
- 3. Minimum for maxHeaderListPairs differs between the three option lists (wrong): Both maxHeaderListPairs minimums are correct: servers enforce at least 4, http2.connect() at least 1.