Title: `styleText` fast path bypasses `options` and `options.validateStream` validation · Issue #67700 · nodejs/node · GitHub
Open Graph Title: `styleText` fast path bypasses `options` and `options.validateStream` validation · Issue #67700 · nodejs/node
X Title: `styleText` fast path bypasses `options` and `options.validateStream` validation · Issue #67700 · nodejs/node
Description: Version v26.13.0 Platform Microsoft Windows NT 10.0.19045.0 x64 Subsystem util What steps will reproduce the bug? node -e "const { styleText } = require('node:util'); const opts = { validateStream: 0 }; console.log(styleText('red', 'text...
Open Graph Description: Version v26.13.0 Platform Microsoft Windows NT 10.0.19045.0 x64 Subsystem util What steps will reproduce the bug? node -e "const { styleText } = require('node:util'); const opts = { validateStream:...
X Description: Version v26.13.0 Platform Microsoft Windows NT 10.0.19045.0 x64 Subsystem util What steps will reproduce the bug? node -e "const { styleText } = require('node:util'); const opts = { va...
Opengraph URL: https://github.com/nodejs/node/issues/67700
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`styleText` fast path bypasses `options` and `options.validateStream` validation","articleBody":"### Version\n\nv26.13.0\n\n### Platform\n\n```text\nMicrosoft Windows NT 10.0.19045.0 x64\n```\n\n### Subsystem\n\nutil\n\n### What steps will reproduce the bug?\n\n```bash\nnode -e \"const { styleText } = require('node:util'); const opts = { validateStream: 0 }; console.log(styleText('red', 'text', opts)); styleText(['red'], 'text', opts);\"\n```\n\n### How often does it reproduce? Is there a required condition?\n\nalways\n\n### What is the expected behavior? Why is that the expected behavior?\n\nboth `styleText('red', 'text', opts)` and `styleText(['red'], 'text', opts)` should throw a TypeError.\n\naccording to the documentation, options must be an `\u003cObject>` and `options.validateStream` must be a `\u003cboolean>`. the first call should not bypass validation (https://nodejs.org/api/util.html#utilstyletextformat-text-options)\n\n### What do you see instead?\n\nthe first call bypasses validation and prints the styled 'text', while the second call throws `ERR_INVALID_ARG_TYPE`\n\n\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/outslept","@type":"Person","name":"outslept"},"datePublished":"2026-11-22T15:19:44Z","url":"https://github.com/nodejs/node/issues/67700"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:84fe714c-0787-6dbd-a944-7c19ca3453d8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DC24:3E3AC8:3B9F8F:4E329C:6B061975 |
| html-safe-nonce | 6b5ab8607fcc033a904ea00068291bab3e0c308b5cc5318cecd710ead440aa63 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQzI0OjNFM0FDODozQjlGOEY6NEUzMjlDOjZCMDYxOTc1IiwidmlzaXRvcl9pZCI6Ijg3ODY1MjY1NTk4NzczMzk1MDkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 314ef1dd12ab659853568172b70216616ba20c237639b44d77194aa00e6ea5f1 |
| hovercard-subject-tag | issue:6544091249 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/67700/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f4650c402edd7e1fbdc34a1a72d609a8078bc668418b7c97a182d9d3b2180ad1/nodejs/node/issues/67700 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f4650c402edd7e1fbdc34a1a72d609a8078bc668418b7c97a182d9d3b2180ad1/nodejs/node/issues/67700 |
| og:image:alt | Version v26.13.0 Platform Microsoft Windows NT 10.0.19045.0 x64 Subsystem util What steps will reproduce the bug? node -e "const { styleText } = require('node:util'); const opts = { validateStream:... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | outslept |
| hostname | github.com |
| expected-hostname | github.com |
| None | 97d4714e567728e1f85f88b0cf68c89f0f8a3dc41e8869af7aeb8195ad990374 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 866f202ebf7ac5aff8f633417d9fd8a53818a977 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width