René's URL Explorer Experiment


Title: Calling crypto.createCipheriv with a key of invalid length can cause errors in other consumers of the OpenSSL error queue · Issue #21281 · nodejs/node · GitHub

Open Graph Title: Calling crypto.createCipheriv with a key of invalid length can cause errors in other consumers of the OpenSSL error queue · Issue #21281 · nodejs/node

X Title: Calling crypto.createCipheriv with a key of invalid length can cause errors in other consumers of the OpenSSL error queue · Issue #21281 · nodejs/node

Description: Version: v9.3.0 (initially discovered on v8.x but seems relevant to later versions too) Platform: Windows 64-bit + ArchLinux 64-bit Subsystem: Crypto N.B. What follows is a naive speculation about what's going wrong since I'm not all too...

Open Graph Description: Version: v9.3.0 (initially discovered on v8.x but seems relevant to later versions too) Platform: Windows 64-bit + ArchLinux 64-bit Subsystem: Crypto N.B. What follows is a naive speculation about ...

X Description: Version: v9.3.0 (initially discovered on v8.x but seems relevant to later versions too) Platform: Windows 64-bit + ArchLinux 64-bit Subsystem: Crypto N.B. What follows is a naive speculation about ...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Calling crypto.createCipheriv with a key of invalid length can cause errors in other consumers of the OpenSSL error queue","articleBody":"* **Version**: v9.3.0 (initially discovered on v8.x but seems relevant to later versions too)\r\n* **Platform**: Windows 64-bit + ArchLinux 64-bit\r\n* **Subsystem**: Crypto\r\n\r\nN.B. What follows is a naive speculation about what's going wrong since I'm not all too familiar with Node.js' internals.\r\n\r\nWhen `crypto.createCipheriv` is called, it sets the key length using `EVP_CIPHER_CTX_set_key_length`. For some ciphers this will fail if it doesn't match a certain length. The crypto module throws a JS error if this is the case. If you look at the OpenSSL code for `EVP_CIPHER_CTX_set_key_length`, this error also goes into the OpenSSL error queue but is never removed by the Crypto module.\r\n\r\nBecause this error queue seems to be thread-global, you can get into situations where other stuff using OpenSSL (such as HTTPS/TLS) can think that the error was caused by its actions, not by a stale error being on the queue. Like so:\r\n\r\n```js\r\n// This example shows how having a invalid key length call to createCipheriv\r\n// caught and ignored while a TLS request is going on can cause the TLS request to fail,\r\n// even though the error is completely separate from the TLS connection.\r\nconst crypto = require('crypto');\r\nconst https = require('https');\r\n\r\nsetInterval(() => {\r\n  // Internally set_key_length is called but the error it produces (using EVPErr) isn't thrown away quick enough.\r\n  try {\r\n      crypto.createCipheriv('aes-256-ctr', 'bad key', crypto.randomBytes(16));\r\n  } catch (err) {\r\n    console.log(err.message);\r\n\r\n    // Do nothing so that we continue with the old error on the OpenSSL error queue.\r\n    // It would be there anyway, but in normal usage it would be more obvious why things are breaking because\r\n    // you would never try/catch the createCipheriv. That's how this issue was discovered.\r\n  }\r\n}, 50);\r\n\r\nconst options = {\r\n  hostname: 'google.com',\r\n  port: 443,\r\n  path: '/',\r\n  method: 'GET'\r\n};\r\n\r\nconst req = https.request(options, (res) => {\r\n  console.log('statusCode:', res.statusCode);\r\n  console.log('headers:', res.headers);\r\n\r\n  res.on('data', (d) => {\r\n    process.stdout.write(d);\r\n  });\r\n});\r\n\r\nreq.on('error', (err) => {\r\n  // throws the EVPErr produces by createCipheriv.\r\n  // At some point the Node.js TLS stack (possibly during TLS read)\r\n  // throws the error off the OpenSSL error queue.\r\n  throw err;\r\n});\r\n\r\nreq.end();\r\n```\r\n\r\nObviously this is a bad way to use `createCipheriv`, but it seems almost certainly wrong for the error to leak outside of the cipher code. Weirdly enough it seems like something else is pulling out the errors on its own, but if you create enough of them (hence the low ms `setInterval`) then it produces the error.","author":{"url":"https://github.com/z0w0","@type":"Person","name":"z0w0"},"datePublished":"2018-06-12T09:40:04Z","url":"https://github.com/nodejs/node/issues/21281"}

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:53095a4e-2bdf-a630-5f58-8d93d0cd322b
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA8CA:373A8C:1F02A7:279C04:6B033DCD
html-safe-nonce4bfd378fb8a6d0a1c4e1859ecfb6b7d31634446ee621bbb62e03196e09b9f6a1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOENBOjM3M0E4QzoxRjAyQTc6Mjc5QzA0OjZCMDMzRENEIiwidmlzaXRvcl9pZCI6IjYxMjM1NTEwMzI4MTY2NDc2MjkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac1ba6160aba2b841de2900672b3168d43c16327b11603717a6ac7bd192ed17a2e
hovercard-subject-tagissue:331512672
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/21281/issue_layout
twitter:imagehttps://opengraph.githubassets.com/8cae552f02746730534302d0421e2139b86a50ded1269591651feb4d0c041e7b/nodejs/node/issues/21281
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/8cae552f02746730534302d0421e2139b86a50ded1269591651feb4d0c041e7b/nodejs/node/issues/21281
og:image:altVersion: v9.3.0 (initially discovered on v8.x but seems relevant to later versions too) Platform: Windows 64-bit + ArchLinux 64-bit Subsystem: Crypto N.B. What follows is a naive speculation about ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamez0w0
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
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
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/nodejs/node/issues/21281#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F21281
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%2F21281
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/21281
Reloadhttps://github.com/nodejs/node/issues/21281
Reloadhttps://github.com/nodejs/node/issues/21281
nodejshttps://github.com/nodejs
nodehttps://github.com/nodejs/node
Codehttps://github.com/nodejs/node
Issues637 (637)https://github.com/nodejs/node/issues
Pull requests667 (667)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/insights
https://github.com/nodejs/node
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/21281
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/21281
Calling crypto.createCipheriv with a key of invalid length can cause errors in other consumers of the OpenSSL error queuehttps://github.com/nodejs/node/issues/21281#top
cryptoIssues and PRs related to the crypto subsystem.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22crypto%22
https://github.com/z0w0
z0w0https://github.com/z0w0
on Jun 12, 2018https://github.com/nodejs/node/issues/21281#issue-331512672
addaleaxhttps://github.com/addaleax
cryptoIssues and PRs related to the crypto subsystem.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22crypto%22
on Jun 12, 2018https://github.com/nodejs/node/issues/21281#event-1675839940
https://github.com/addaleax
addaleaxhttps://github.com/addaleax
on Jun 12, 2018https://github.com/nodejs/node/issues/21281#issuecomment-396530470
https://github.com/ryzokuken
ryzokukenhttps://github.com/ryzokuken
on Jun 12, 2018https://github.com/nodejs/node/issues/21281#issuecomment-396539045
@z0w0https://github.com/z0w0
https://github.com/z0w0
z0w0https://github.com/z0w0
on Jun 12, 2018https://github.com/nodejs/node/issues/21281#issuecomment-396548511
https://github.com/tniessen
tniessenhttps://github.com/tniessen
on Jun 12, 2018https://github.com/nodejs/node/issues/21281#issuecomment-396549596
https://github.com/z0w0
z0w0https://github.com/z0w0
on Jun 12, 2018https://github.com/nodejs/node/issues/21281#issuecomment-396551086
https://github.com/ryzokuken
ryzokukenhttps://github.com/ryzokuken
on Jun 12, 2018https://github.com/nodejs/node/issues/21281#issuecomment-396552405
@tniessenhttps://github.com/tniessen
https://github.com/tniessen
tniessenhttps://github.com/tniessen
on Jun 12, 2018https://github.com/nodejs/node/issues/21281#issuecomment-396557699
@z0w0https://github.com/z0w0
@ryzokukenhttps://github.com/ryzokuken
https://github.com/ryzokuken
ryzokukenhttps://github.com/ryzokuken
on Jun 12, 2018https://github.com/nodejs/node/issues/21281#issuecomment-396564347
@tniessenhttps://github.com/tniessen
https://github.com/jrasanen
jrasanenhttps://github.com/jrasanen
on Jun 12, 2018https://github.com/nodejs/node/issues/21281#issuecomment-396600175
@tniessenhttps://github.com/tniessen
@ryzokukenhttps://github.com/ryzokuken
tniessenhttps://github.com/tniessen
on Jun 12, 2018https://github.com/nodejs/node/issues/21281#event-1676444723
crypto: handle OpenSSL error queue in CipherBasehttps://github.com/tniessen/node/commit/643bc49aada39d54ea0c011456a2b53359955553
643bc49https://github.com/tniessen/node/commit/643bc49aada39d54ea0c011456a2b53359955553
https://github.com/tniessen
tniessenhttps://github.com/tniessen
on Jun 12, 2018https://github.com/nodejs/node/issues/21281#issuecomment-396611088
@jrasanenhttps://github.com/jrasanen
@ryzokukenhttps://github.com/ryzokuken
#21281 (comment)https://github.com/nodejs/node/issues/21281#issuecomment-396564347
#21287https://github.com/nodejs/node/pull/21287
#21288https://github.com/nodejs/node/pull/21288
https://github.com/jrasanen
jrasanenhttps://github.com/jrasanen
on Jun 12, 2018https://github.com/nodejs/node/issues/21281#issuecomment-396616439
https://github.com/ryzokuken
ryzokukenhttps://github.com/ryzokuken
on Jun 12, 2018https://github.com/nodejs/node/issues/21281#issuecomment-396661476
@jrasanenhttps://github.com/jrasanen
tniessenhttps://github.com/tniessen
completedhttps://github.com/nodejs/node/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
85b0f16https://github.com/nodejs/node/commit/85b0f1649d07294afea6cfbb3082c18a3dc2079a
on Jul 12, 2018https://github.com/nodejs/node/issues/21281#event-1730394772
targoshttps://github.com/targos
on Jul 14, 2018https://github.com/nodejs/node/issues/21281#event-1733817192
crypto: handle OpenSSL error queue in CipherBasehttps://github.com/nodejs/node/commit/07cce880bfd6cf6d17a499798d2699617e13750d
07cce88https://github.com/nodejs/node/commit/07cce880bfd6cf6d17a499798d2699617e13750d
sjarmakhttps://github.com/sjarmak
on Jul 27, 2026https://github.com/nodejs/node/issues/21281#event-28560960181
crypto: handle OpenSSL error queue in CipherBasehttps://github.com/sg-evals/nodejs-node/commit/85b0f1649d07294afea6cfbb3082c18a3dc2079a
85b0f16https://github.com/sg-evals/nodejs-node/commit/85b0f1649d07294afea6cfbb3082c18a3dc2079a
Sign up for freehttps://github.com/signup?return_to=https://github.com/nodejs/node/issues/21281
Sign in to commenthttps://github.com/login?return_to=https://github.com/nodejs/node/issues/21281
cryptoIssues and PRs related to the crypto subsystem.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22crypto%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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.