René's URL Explorer Experiment


Title: Piping streams into SHA3 without end: false crashes · Issue #28245 · nodejs/node · GitHub

Open Graph Title: Piping streams into SHA3 without end: false crashes · Issue #28245 · nodejs/node

X Title: Piping streams into SHA3 without end: false crashes · Issue #28245 · nodejs/node

Description: Version: 12.4.0 Platform: Windows 10 x64 and Linux 4.4.0-042stab138.1 Subsystem: crypto or deps This code causes a segmentation fault in 12.4.0: const crypto = require('crypto'); const fs = require('fs'); const myOwnCode = fs.createReadS...

Open Graph Description: Version: 12.4.0 Platform: Windows 10 x64 and Linux 4.4.0-042stab138.1 Subsystem: crypto or deps This code causes a segmentation fault in 12.4.0: const crypto = require('crypto'); const fs = require...

X Description: Version: 12.4.0 Platform: Windows 10 x64 and Linux 4.4.0-042stab138.1 Subsystem: crypto or deps This code causes a segmentation fault in 12.4.0: const crypto = require('crypto'); const fs =...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Piping streams into SHA3 without end: false crashes","articleBody":"\u003c!--\r\nThank you for reporting a possible bug in Node.js.\r\n\r\nPlease fill in as much of the template below as you can.\r\n\r\nVersion: output of `node -v`\r\nPlatform: output of `uname -a` (UNIX), or version and 32 or 64-bit (Windows)\r\nSubsystem: if known, please specify the affected core module name\r\n\r\nIf possible, please provide code that demonstrates the problem, keeping it as\r\nsimple and free of external dependencies as you can.\r\n-->\r\n\r\n* **Version**: 12.4.0\r\n* **Platform**: Windows 10 x64 and Linux 4.4.0-042stab138.1\r\n* **Subsystem**: crypto or deps\r\n\r\n\u003c!-- Please provide more details below this comment. -->\r\n\r\nThis code causes a segmentation fault in 12.4.0:\r\n\r\n```javascript\r\nconst crypto = require('crypto');\r\nconst fs = require('fs');\r\n\r\nconst myOwnCode = fs.createReadStream(__filename);\r\nconst copy = fs.createWriteStream(`${__filename}.copy`);\r\nconst hash = crypto.createHash('sha3-512');\r\nmyOwnCode.pipe(hash);\r\nmyOwnCode.pipe(copy).on('finish', () => {\r\n  hash.digest();\r\n});\r\n```\r\n\r\nThis seems to be caused by `pipe` calling `hash._flush` when `end` is not set to `false`. This code also causes a segmentation fault:\r\n\r\n```javascript\r\nconst crypto = require('crypto');\r\n\r\nconst hash = crypto.createHash('sha3-512');\r\nhash._flush(() => console.log('Flushed'));\r\nhash.digest();\r\n```\r\n\r\nThis seems to be at least partially caused by the implementation of `_flush`:\r\n\r\nhttps://github.com/nodejs/node/blob/908292cf1f551c614a733d858528ffb13fb3a524/lib/internal/crypto/hash.js#L54-L57\r\n\r\nIt bypasses the `this[kState][kFinalized]` safeguard:\r\n\r\nhttps://github.com/nodejs/node/blob/908292cf1f551c614a733d858528ffb13fb3a524/lib/internal/crypto/hash.js#L79-L91\r\n\r\nNote that this bug only happens when using SHA3, `sha256` seems to be working just fine, so there might also be some weirdness in OpenSSL.\r\n\r\ncc @mcollina @nodejs/crypto @nodejs/streams","author":{"url":"https://github.com/tniessen","@type":"Person","name":"tniessen"},"datePublished":"2019-06-15T13:03:21Z","url":"https://github.com/nodejs/node/issues/28245"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:55e88d20-9c8a-90e9-b9f1-35b359e7fc2d
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA864:5463F:5462B3:7267AB:6AED1F5E
html-safe-nonce0371efd165a9c029521070b65cc4c7f9fcee01f11ffd5730cb0379ef9afae95e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBODY0OjU0NjNGOjU0NjJCMzo3MjY3QUI6NkFFRDFGNUUiLCJ2aXNpdG9yX2lkIjoiNDQ5MjI3ODI2NzE3MDg1Njc5OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmaceb18c727c70778eb0c66a9be17eafd2e9f4fdd7fab3dba8a6a7cbd5316354baa
hovercard-subject-tagissue:456535688
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/28245/issue_layout
twitter:imagehttps://opengraph.githubassets.com/55f31c20a72be26668d26fe28407d0dae98ae81a2d998ecc22e5a3f3256b5c3c/nodejs/node/issues/28245
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/55f31c20a72be26668d26fe28407d0dae98ae81a2d998ecc22e5a3f3256b5c3c/nodejs/node/issues/28245
og:image:altVersion: 12.4.0 Platform: Windows 10 x64 and Linux 4.4.0-042stab138.1 Subsystem: crypto or deps This code causes a segmentation fault in 12.4.0: const crypto = require('crypto'); const fs = require...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernametniessen
hostnamegithub.com
expected-hostnamegithub.com
Nonee3e0f7f63e50c6fe879198a93a0a023a648ecc0a5e9bc3b5e033ac57172237e6
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
release707a24b346ac8a82878b9c084efaa38a997660cb
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/nodejs/node/issues/28245#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F28245
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%2F28245
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/28245
Reloadhttps://github.com/nodejs/node/issues/28245
Reloadhttps://github.com/nodejs/node/issues/28245
nodejshttps://github.com/nodejs
nodehttps://github.com/nodejs/node
Codehttps://github.com/nodejs/node
Issues655 (655)https://github.com/nodejs/node/issues
Pull requests666 (666)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/28245
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/28245
Piping streams into SHA3 without end: false crasheshttps://github.com/nodejs/node/issues/28245#top
confirmed-bugIssues and PRs for confirmed bugs.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22confirmed-bug%22
cryptoIssues and PRs related to the crypto subsystem.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22crypto%22
opensslIssues and PRs related to the OpenSSL dependency.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22openssl%22
streamIssues and PRs related to Node.js streams.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22stream%22
https://github.com/tniessen
tniessenhttps://github.com/tniessen
on Jun 15, 2019https://github.com/nodejs/node/issues/28245#issue-456535688
node/lib/internal/crypto/hash.jshttps://github.com/nodejs/node/blob/908292cf1f551c614a733d858528ffb13fb3a524/lib/internal/crypto/hash.js#L54-L57
908292chttps://github.com/nodejs/node/commit/908292cf1f551c614a733d858528ffb13fb3a524
node/lib/internal/crypto/hash.jshttps://github.com/nodejs/node/blob/908292cf1f551c614a733d858528ffb13fb3a524/lib/internal/crypto/hash.js#L79-L91
908292chttps://github.com/nodejs/node/commit/908292cf1f551c614a733d858528ffb13fb3a524
@mcollinahttps://github.com/mcollina
tniessenhttps://github.com/tniessen
cryptoIssues and PRs related to the crypto subsystem.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22crypto%22
opensslIssues and PRs related to the OpenSSL dependency.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22openssl%22
streamIssues and PRs related to Node.js streams.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22stream%22
confirmed-bugIssues and PRs for confirmed bugs.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22confirmed-bug%22
on Jun 15, 2019https://github.com/nodejs/node/issues/28245#event-2415403098
https://github.com/tniessen
tniessenhttps://github.com/tniessen
on Jun 15, 2019https://github.com/nodejs/node/issues/28245#issuecomment-502365355
https://github.com/addaleax
addaleaxhttps://github.com/addaleax
on Jun 16, 2019https://github.com/nodejs/node/issues/28245#issuecomment-502410949
tniessenhttps://github.com/tniessen
completedhttps://github.com/nodejs/node/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
fc50e6bhttps://github.com/nodejs/node/commit/fc50e6bcc81e4b34f4f3f3fe494b79200ae22efb
on Jun 18, 2019https://github.com/nodejs/node/issues/28245#event-2421558786
targoshttps://github.com/targos
on Jul 2, 2019https://github.com/nodejs/node/issues/28245#event-2453429442
crypto: fix crash when calling digest after pipinghttps://github.com/nodejs/node/commit/990feafcb60d2516cfeb36449759087517b8ff8d
990feafhttps://github.com/nodejs/node/commit/990feafcb60d2516cfeb36449759087517b8ff8d
evanlucashttps://github.com/evanlucas
on Feb 4, 2021https://github.com/nodejs/node/issues/28245#event-4290401894
crypto: fix crash when calling digest after pipinghttps://github.com/evanlucas/node/commit/2a0571a6b42d62d689769a1c4d891e3323dd81c2
2a0571ahttps://github.com/evanlucas/node/commit/2a0571a6b42d62d689769a1c4d891e3323dd81c2
Sunrisepeakhttps://github.com/Sunrisepeak
on Jul 25, 2026https://github.com/nodejs/node/issues/28245#event-28483257764
fix(node:crypto): hash digest survives piping; AEAD tag-length + setA…https://github.com/Sunrisepeak/mbun/commit/3b472c116128c831860dd95915d41853b6936be7
3b472c1https://github.com/Sunrisepeak/mbun/commit/3b472c116128c831860dd95915d41853b6936be7
sjarmakhttps://github.com/sjarmak
on Jul 27, 2026https://github.com/nodejs/node/issues/28245#event-28561264799
crypto: fix crash when calling digest after pipinghttps://github.com/sg-evals/nodejs-node/commit/fc50e6bcc81e4b34f4f3f3fe494b79200ae22efb
fc50e6bhttps://github.com/sg-evals/nodejs-node/commit/fc50e6bcc81e4b34f4f3f3fe494b79200ae22efb
mcollinahttps://github.com/mcollina
on Aug 17, 2026https://github.com/nodejs/node/issues/28245#event-29570366153
crypto: prevent Hmac.digest() from returning uninitialized memoryhttps://github.com/mcollina/node/commit/e41218a02e3948ff6491abaf65b0e5d185b10981
e41218ahttps://github.com/mcollina/node/commit/e41218a02e3948ff6491abaf65b0e5d185b10981
crypto: prevent Hmac.digest() from returning uninitialized memoryhttps://github.com/mcollina/node/commit/49e88cebaddc7e012c3989e2d8bcdb064d56e905
49e88cehttps://github.com/mcollina/node/commit/49e88cebaddc7e012c3989e2d8bcdb064d56e905
nodejs-github-bothttps://github.com/nodejs-github-bot
on Aug 26, 2026https://github.com/nodejs/node/issues/28245#event-30059773755
crypto: prevent Hmac.digest() from returning uninitialized memoryhttps://github.com/nodejs/node/commit/6737aa35b8e28b7af5ea57261a46090857f77b36
6737aa3https://github.com/nodejs/node/commit/6737aa35b8e28b7af5ea57261a46090857f77b36
aduh95https://github.com/aduh95
on Aug 29, 2026https://github.com/nodejs/node/issues/28245#event-30208025193
crypto: prevent Hmac.digest() from returning uninitialized memoryhttps://github.com/nodejs/node/commit/b272bc9b0b2f98b615fc5cd0e2e499f03347dd35
b272bc9https://github.com/nodejs/node/commit/b272bc9b0b2f98b615fc5cd0e2e499f03347dd35
crypto: prevent Hmac.digest() from returning uninitialized memoryhttps://github.com/nodejs/node/commit/a7524cbfaf44844ec8395756a4131dbf14890199
a7524cbhttps://github.com/nodejs/node/commit/a7524cbfaf44844ec8395756a4131dbf14890199
Jarred-Sumnerhttps://github.com/Jarred-Sumner
on Sep 10, 2026https://github.com/nodejs/node/issues/28245#event-30934361271
node:crypto: make Hash update()/copy() after end() throw instead of r…https://github.com/oven-sh/bun/commit/e5f9986a4c185adc02260bc469a4c661b806e2ec
e5f9986https://github.com/oven-sh/bun/commit/e5f9986a4c185adc02260bc469a4c661b806e2ec
aduh95https://github.com/aduh95
on Sep 15, 2026https://github.com/nodejs/node/issues/28245#event-31161506047
crypto: prevent Hmac.digest() from returning uninitialized memoryhttps://github.com/nodejs/node/commit/656504ffc0648bda37f57bb2def1dc6f27ac2fb6
656504fhttps://github.com/nodejs/node/commit/656504ffc0648bda37f57bb2def1dc6f27ac2fb6
crypto: prevent Hmac.digest() from returning uninitialized memoryhttps://github.com/nodejs/node/commit/98ca5e9358448f7524f2d69df4f5ad4f9799f8a5
98ca5e9https://github.com/nodejs/node/commit/98ca5e9358448f7524f2d69df4f5ad4f9799f8a5
Sign up for freehttps://github.com/signup?return_to=https://github.com/nodejs/node/issues/28245
Sign in to commenthttps://github.com/login?return_to=https://github.com/nodejs/node/issues/28245
confirmed-bugIssues and PRs for confirmed bugs.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22confirmed-bug%22
cryptoIssues and PRs related to the crypto subsystem.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22crypto%22
opensslIssues and PRs related to the OpenSSL dependency.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22openssl%22
streamIssues and PRs related to Node.js streams.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22stream%22
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.