-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TLSSocket._tlsOptions undefined during TLSWrap.onerror cause an additional TypeError #41501
Labels
tls
Issues and PRs related to the tls subsystem.
Comments
sigv
added a commit
to sigv/node
that referenced
this issue
Jan 14, 2022
TLSWrap.onerror has a helpful debug() call built in to it. However in case of a malformed TLSSocket object, where the `_tlsOptions` value is an unexpected `undefined`, accessing `_tlsOptions.isServer` causes a TypeError to be thrown. This commit ensures that the debug() call properly logs the state as 'unknown', instead of the two 'server' and 'client' choices previously available. Additionally, onerror branching is adjusted to allow such `undefined` options object, by use of optional chaining. Other methods are not being adjusted, as such a case of `undefined` options is not viable during regular processing of the TLSSocket. Fixes: nodejs#41501
sigv
added a commit
to sigv/node
that referenced
this issue
Jan 14, 2022
TLSWrap.onerror has a helpful debug() call built in to it. However in case of a malformed TLSSocket object, where the `_tlsOptions` value is an unexpected `undefined`, accessing `_tlsOptions.isServer` causes a TypeError to be thrown. This commit ensures that the debug() call properly logs the state as 'unknown', instead of the two 'server' and 'client' choices previously available. Additionally, onerror branching is adjusted to allow such `undefined` options object, by use of optional chaining. Other methods are not being adjusted, as such a case of `undefined` options is not viable during regular processing of the TLSSocket. Fixes: nodejs#41501
sigv
added a commit
to sigv/node
that referenced
this issue
Jan 14, 2022
TLSWrap.onerror has a helpful debug() call built in to it. However in case of a malformed TLSSocket object, where the `_tlsOptions` value is an unexpected `undefined`, accessing `_tlsOptions.isServer` causes a TypeError to be thrown. This commit ensures that the debug() call properly logs the state as 'unknown', instead of the two 'server' and 'client' choices previously available. Additionally, onerror branching is adjusted to allow such `undefined` options object, by use of optional chaining. Other methods are not being adjusted, as such a case of `undefined` options is not viable during regular processing of the TLSSocket. Fixes: nodejs#41501
sigv
added a commit
to sigv/node
that referenced
this issue
Jan 14, 2022
TLSWrap.onerror has a helpful debug() call built in to it. However in case of a malformed TLSSocket object, where the `_tlsOptions` value is an unexpected `undefined`, accessing `_tlsOptions.isServer` causes a TypeError to be thrown. This commit ensures that the debug() call properly logs the state as 'unknown', instead of the two 'server' and 'client' choices previously available. Additionally, onerror branching is adjusted to allow such `undefined` options object, by use of optional chaining. Other methods are not being adjusted, as such a case of `undefined` options is not viable during regular processing of the TLSSocket. Fixes: nodejs#41501
nodejs-github-bot
pushed a commit
that referenced
this issue
Feb 14, 2022
TLSWrap.onerror has a helpful debug() call built in to it. However in case of a malformed TLSSocket object, where the `_tlsOptions` value is an unexpected `undefined`, accessing `_tlsOptions.isServer` causes a TypeError to be thrown. This commit ensures that the debug() call properly logs the state as 'unknown', instead of the two 'server' and 'client' choices previously available. Additionally, onerror branching is adjusted to allow such `undefined` options object, by use of optional chaining. Other methods are not being adjusted, as such a case of `undefined` options is not viable during regular processing of the TLSSocket. Fixes: #41501 PR-URL: #41523 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
bengl
pushed a commit
to bengl/node
that referenced
this issue
Feb 21, 2022
TLSWrap.onerror has a helpful debug() call built in to it. However in case of a malformed TLSSocket object, where the `_tlsOptions` value is an unexpected `undefined`, accessing `_tlsOptions.isServer` causes a TypeError to be thrown. This commit ensures that the debug() call properly logs the state as 'unknown', instead of the two 'server' and 'client' choices previously available. Additionally, onerror branching is adjusted to allow such `undefined` options object, by use of optional chaining. Other methods are not being adjusted, as such a case of `undefined` options is not viable during regular processing of the TLSSocket. Fixes: nodejs#41501 PR-URL: nodejs#41523 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
bengl
pushed a commit
to bengl/node
that referenced
this issue
Feb 21, 2022
TLSWrap.onerror has a helpful debug() call built in to it. However in case of a malformed TLSSocket object, where the `_tlsOptions` value is an unexpected `undefined`, accessing `_tlsOptions.isServer` causes a TypeError to be thrown. This commit ensures that the debug() call properly logs the state as 'unknown', instead of the two 'server' and 'client' choices previously available. Additionally, onerror branching is adjusted to allow such `undefined` options object, by use of optional chaining. Other methods are not being adjusted, as such a case of `undefined` options is not viable during regular processing of the TLSSocket. Fixes: nodejs#41501 PR-URL: nodejs#41523 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
bengl
pushed a commit
that referenced
this issue
Feb 22, 2022
TLSWrap.onerror has a helpful debug() call built in to it. However in case of a malformed TLSSocket object, where the `_tlsOptions` value is an unexpected `undefined`, accessing `_tlsOptions.isServer` causes a TypeError to be thrown. This commit ensures that the debug() call properly logs the state as 'unknown', instead of the two 'server' and 'client' choices previously available. Additionally, onerror branching is adjusted to allow such `undefined` options object, by use of optional chaining. Other methods are not being adjusted, as such a case of `undefined` options is not viable during regular processing of the TLSSocket. Fixes: #41501 PR-URL: #41523 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
danielleadams
pushed a commit
that referenced
this issue
Apr 21, 2022
TLSWrap.onerror has a helpful debug() call built in to it. However in case of a malformed TLSSocket object, where the `_tlsOptions` value is an unexpected `undefined`, accessing `_tlsOptions.isServer` causes a TypeError to be thrown. This commit ensures that the debug() call properly logs the state as 'unknown', instead of the two 'server' and 'client' choices previously available. Additionally, onerror branching is adjusted to allow such `undefined` options object, by use of optional chaining. Other methods are not being adjusted, as such a case of `undefined` options is not viable during regular processing of the TLSSocket. Fixes: #41501 PR-URL: #41523 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
danielleadams
pushed a commit
that referenced
this issue
Apr 24, 2022
TLSWrap.onerror has a helpful debug() call built in to it. However in case of a malformed TLSSocket object, where the `_tlsOptions` value is an unexpected `undefined`, accessing `_tlsOptions.isServer` causes a TypeError to be thrown. This commit ensures that the debug() call properly logs the state as 'unknown', instead of the two 'server' and 'client' choices previously available. Additionally, onerror branching is adjusted to allow such `undefined` options object, by use of optional chaining. Other methods are not being adjusted, as such a case of `undefined` options is not viable during regular processing of the TLSSocket. Fixes: #41501 PR-URL: #41523 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
v16.13.2
Platform
Linux example.com 5.11.0-1025-azure #27~20.04.1-Ubuntu SMP Fri Jan 7 15:02:06 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
There is no clean repro case to provide. We are seeing what we believed to be a connection abort/reset issue caused by local router configuration. Something in our setup causes the
TLSWrap.onerror
to be called whereowner
hasundefined
_tlsOptions
, potentially that TLS negotiation fails. /lib/_tls_wrap.js L411 is relevant, as visible in log below.How often does it reproduce? Is there a required condition?
See above; conditions are not fully understood.
What is the expected behavior?
We expect to see a networking error, that informs up what exactly went wrong.
(Instead of it being suppressed by a TypeError.)
What do you see instead?
Additional information
No response
The text was updated successfully, but these errors were encountered: