René's URL Explorer Experiment


Title: fs.opendir() and fs.promises.opendir() crash the process on an invalid bufferSize · Issue #67182 · nodejs/node · GitHub

Open Graph Title: fs.opendir() and fs.promises.opendir() crash the process on an invalid bufferSize · Issue #67182 · nodejs/node

X Title: fs.opendir() and fs.promises.opendir() crash the process on an invalid bufferSize · Issue #67182 · nodejs/node

Description: Version v28.0.0-pre (main at 95f3cf0), also v22.20.0 and v20.20.2 Platform Linux 7.0.0-38-generic x86_64 Subsystem fs What steps will reproduce the bug? const fs = require('node:fs'); (async () => { try { await fs.promises.opendir(__dirn...

Open Graph Description: Version v28.0.0-pre (main at 95f3cf0), also v22.20.0 and v20.20.2 Platform Linux 7.0.0-38-generic x86_64 Subsystem fs What steps will reproduce the bug? const fs = require('node:fs'); (async () => ...

X Description: Version v28.0.0-pre (main at 95f3cf0), also v22.20.0 and v20.20.2 Platform Linux 7.0.0-38-generic x86_64 Subsystem fs What steps will reproduce the bug? const fs = require('node:fs'); (asyn...

Opengraph URL: https://github.com/nodejs/node/issues/67182

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"fs.opendir() and fs.promises.opendir() crash the process on an invalid bufferSize","articleBody":"### Version\n\nv28.0.0-pre (main at 95f3cf07), also v22.20.0 and v20.20.2\n\n### Platform\n\n```text\nLinux 7.0.0-38-generic x86_64\n```\n\n### Subsystem\n\nfs\n\n### What steps will reproduce the bug?\n\n```js\nconst fs = require('node:fs');\n\n(async () => {\n  try {\n    await fs.promises.opendir(__dirname, { bufferSize: 0 });\n  } catch (err) {\n    console.log('caught', err.code);\n  }\n  console.log('still running');\n})();\n```\n\nThe callback form behaves the same:\n\n```js\ntry {\n  fs.opendir(__dirname, { bufferSize: 0 }, (err) => console.log('callback', err));\n} catch (err) {\n  console.log('caught', err.code);\n}\n```\n\n### How often does it reproduce? Is there a required condition?\n\nAlways, with any invalid `bufferSize` (`0`, `-1`, `1.5`, `NaN`, `'1'`, `null`, ...).\n\n### What is the expected behavior? Why is that the expected behavior?\n\nThe error reaches the caller: `fs.opendir()` throws (as `fs.readdir()` and `fs.writeFile()` do for invalid options), and `fs.promises.opendir()` rejects. `fs.opendirSync()` already throws a catchable error.\n\n### What do you see instead?\n\nNeither `catch` runs, the callback is never called, and the process exits with code 1:\n\n```text\nRangeError [ERR_OUT_OF_RANGE]: The value of \"options.bufferSize\" is out of range. It must be >= 1 && \u003c= 4294967295. Received 0\n    at new Dir (node:internal/fs/dir:64:7)\n    at FSReqCallback.opendirCallback [as oncomplete] (node:internal/fs/dir:357:22)\n```\n\n### Additional information\n\n`bufferSize` is only validated in the `Dir` constructor, which `fs.opendir()` calls from the completion callback of the native call, so the error is thrown outside the caller's code. The handle is closed before the throw, so nothing leaks. I have a fix and will open a PR.\n","author":{"url":"https://github.com/yohannesjoya","@type":"Person","name":"yohannesjoya"},"datePublished":"2026-11-01T11:59:35Z","url":"https://github.com/nodejs/node/issues/67182"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:5794b8aa-b23c-9e83-4e26-c57867cdd270
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idEC10:26CE3B:ED741C:147F5F4:6AFBF514
html-safe-nonceaceefae3c0e01966d954da7180a69bd8925a09a0015f9a9186dab7dc987ada65
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQzEwOjI2Q0UzQjpFRDc0MUM6MTQ3RjVGNDo2QUZCRjUxNCIsInZpc2l0b3JfaWQiOiIxNTc3NTQzNzQ0NDczNTI3NTcyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac873aae779c10af521e3bc767adcd1aa977a784d41b1dd5772901cb1655d940e5
hovercard-subject-tagissue:6146611241
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/67182/issue_layout
twitter:imagehttps://opengraph.githubassets.com/93244b12918fd8c9490ddc9701826a109acf6498d11068f5272bc07079ef23c6/nodejs/node/issues/67182
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/93244b12918fd8c9490ddc9701826a109acf6498d11068f5272bc07079ef23c6/nodejs/node/issues/67182
og:image:altVersion v28.0.0-pre (main at 95f3cf0), also v22.20.0 and v20.20.2 Platform Linux 7.0.0-38-generic x86_64 Subsystem fs What steps will reproduce the bug? const fs = require('node:fs'); (async () => ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameyohannesjoya
hostnamegithub.com
expected-hostnamegithub.com
Nonefa74413a1d84dac536fcca0740780bcbd3207bafec0e51873b73ff8e8cca032f
turbo-cache-controlno-preview
go-importgithub.com/nodejs/node git https://github.com/nodejs/node.git
octolytics-dimension-user_id9950313
octolytics-dimension-user_loginnodejs
octolytics-dimension-repository_id27193779
octolytics-dimension-repository_nwonodejs/node
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id27193779
octolytics-dimension-repository_network_root_nwonodejs/node
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseb3b5633a74535d9c23385512d534c66c8fde1907
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/nodejs/node/issues/67182#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F67182
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F67182
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://github.com/nodejs/node/issues/67182
Reloadhttps://github.com/nodejs/node/issues/67182
Reloadhttps://github.com/nodejs/node/issues/67182
nodejshttps://github.com/nodejs
nodehttps://github.com/nodejs/node
Codehttps://github.com/nodejs/node
Issues644 (644)https://github.com/nodejs/node/issues
Pull requests679 (679)https://github.com/nodejs/node/pulls
Actionshttps://github.com/nodejs/node/actions
Projectshttps://github.com/nodejs/node/projects
Security and qualityhttps://github.com/nodejs/node/security
Insightshttps://github.com/nodejs/node/pulse
https://github.com/nodejs/node
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/67182
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/67182
#67183https://github.com/nodejs/node/pull/67183
fs.opendir() and fs.promises.opendir() crash the process on an invalid bufferSizehttps://github.com/nodejs/node/issues/67182#top
#67183https://github.com/nodejs/node/pull/67183
https://github.com/yohannesjoya
yohannesjoyahttps://github.com/yohannesjoya
on Nov 1, 2026https://github.com/nodejs/node/issues/67182#issue-6146611241
95f3cf0https://github.com/nodejs/node/commit/95f3cf072e83d94ac90616c86a370b250f44a8d7
yohannesjoyahttps://github.com/yohannesjoya
on Nov 14, 2026https://github.com/nodejs/node/issues/67182#event-36147089488
fs: validate opendir() bufferSize before opening the directoryhttps://github.com/yohannesjoya/node/commit/34050bd2fe2e8d66d6010ff1a1b9ac7e87c77d45
34050bdhttps://github.com/yohannesjoya/node/commit/34050bd2fe2e8d66d6010ff1a1b9ac7e87c77d45
Sign up for freehttps://github.com/signup?return_to=https://github.com/nodejs/node/issues/67182
Sign in to commenthttps://github.com/login?return_to=https://github.com/nodejs/node/issues/67182
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.