Skip to content
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

Impossibility to catch error event arising in connections during handshake #76

Closed
belochub opened this issue Feb 20, 2017 · 2 comments
Closed

Comments

@belochub
Copy link
Member

At the moment, when a server is being created and someone sends incorrect first packet (which must be handshake, but can be anything), node will crash with message "Unhandled 'error' event", even if there is an error event listener for this server.
That happens because we forward error event listener from transport to server (as connectionError) only after handshake was processed.
I guess possible fix will be to forward error event to server on connection creation.

@belochub
Copy link
Member Author

belochub commented Feb 20, 2017

This bug seems to be critical, because it can cause server downtime by spamming incorrect packets on connection. Needs to be fixed ASAP.

@aqrln aqrln added the security label Feb 20, 2017
aqrln added a commit that referenced this issue Feb 20, 2017
This commit fixes a critical issue that allowed to crash the server
with an unhandled error event sending an invalid packet that causes
parser error before a handshake.

Fixes: #76
@aqrln
Copy link
Member

aqrln commented Feb 20, 2017

@belochub can you check if #78 fixes the issue?

aqrln added a commit that referenced this issue Feb 20, 2017
This commit forces a connection to close if a transport emits error.
Socket-related errors should have been already doing this, but parse
errors just emitted error events that caused the invalid chunk to be
parsed over and over again if the event was intercepted.

Refs: #76
@aqrln aqrln closed this as completed in c211c66 Feb 20, 2017
aqrln added a commit that referenced this issue Feb 20, 2017
This commit forces a connection to close if a transport emits error.
Socket-related errors should have been already doing this, but parse
errors just emitted error events that caused the invalid chunk to be
parsed over and over again if the event was intercepted.

Refs: #76
PR-URL: #78
aqrln added a commit that referenced this issue Feb 20, 2017
This commit fixes a critical issue that allowed to crash the server
with an unhandled error event sending an invalid packet that causes
parser error before a handshake.

Fixes: #76
PR-URL: #78
aqrln added a commit that referenced this issue Feb 20, 2017
This commit forces a connection to close if a transport emits error.
Socket-related errors should have been already doing this, but parse
errors just emitted error events that caused the invalid chunk to be
parsed over and over again if the event was intercepted.

Refs: #76
PR-URL: #78
aqrln added a commit that referenced this issue Feb 20, 2017
This commit fixes a critical issue that allowed to crash the server
with an unhandled error event sending an invalid packet that causes
parser error before a handshake.

Fixes: #76
PR-URL: #78
aqrln added a commit that referenced this issue Feb 20, 2017
This commit forces a connection to close if a transport emits error.
Socket-related errors should have been already doing this, but parse
errors just emitted error events that caused the invalid chunk to be
parsed over and over again if the event was intercepted.

Refs: #76
PR-URL: #78
aqrln added a commit that referenced this issue Apr 2, 2017
This commit fixes a critical issue that allowed to crash the server
with an unhandled error event sending an invalid packet that causes
parser error before a handshake.

Fixes: #76
Backport-of: #78
aqrln added a commit that referenced this issue Apr 2, 2017
This commit forces a connection to close if a transport emits error.
Socket-related errors should have been already doing this, but parse
errors just emitted error events that caused the invalid chunk to be
parsed over and over again if the event was intercepted.

Refs: #76
PR-URL: #78
aqrln added a commit that referenced this issue Apr 2, 2017
This commit fixes a critical issue that allowed to crash the server
with an unhandled error event sending an invalid packet that causes
parser error before a handshake.

Fixes: #76
Backport-of: #78
PR-URL: #115
Reviewed-by: Mykola Bilochub <nbelochub@gmail.com>
aqrln added a commit that referenced this issue Apr 2, 2017
This commit forces a connection to close if a transport emits error.
Socket-related errors should have been already doing this, but parse
errors just emitted error events that caused the invalid chunk to be
parsed over and over again if the event was intercepted.

Refs: #76
PR-URL: #78
aqrln added a commit that referenced this issue Apr 2, 2017
This commit fixes a critical issue that allowed to crash the server
with an unhandled error event sending an invalid packet that causes
parser error before a handshake.

Fixes: #76
Backport-of: #78
PR-URL: #115
Reviewed-by: Mykola Bilochub <nbelochub@gmail.com>
aqrln added a commit that referenced this issue Apr 3, 2017
This commit forces a connection to close if a transport emits error.
Socket-related errors should have been already doing this, but parse
errors just emitted error events that caused the invalid chunk to be
parsed over and over again if the event was intercepted.

Refs: #76
PR-URL: #78
aqrln added a commit that referenced this issue Apr 3, 2017
This commit fixes a critical issue that allowed to crash the server
with an unhandled error event sending an invalid packet that causes
parser error before a handshake.

Fixes: #76
Backport-of: #78
PR-URL: #115
Reviewed-by: Mykola Bilochub <nbelochub@gmail.com>
belochub pushed a commit that referenced this issue Jan 22, 2018
This commit fixes a critical issue that allowed to crash the server
with an unhandled error event sending an invalid packet that causes
parser error before a handshake.

Fixes: #76
PR-URL: #78
belochub pushed a commit that referenced this issue Jan 22, 2018
This commit forces a connection to close if a transport emits error.
Socket-related errors should have been already doing this, but parse
errors just emitted error events that caused the invalid chunk to be
parsed over and over again if the event was intercepted.

Refs: #76
PR-URL: #78
belochub pushed a commit that referenced this issue Jan 22, 2018
This commit fixes a critical issue that allowed to crash the server
with an unhandled error event sending an invalid packet that causes
parser error before a handshake.

Fixes: #76
PR-URL: #78
belochub pushed a commit that referenced this issue Jan 22, 2018
This commit forces a connection to close if a transport emits error.
Socket-related errors should have been already doing this, but parse
errors just emitted error events that caused the invalid chunk to be
parsed over and over again if the event was intercepted.

Refs: #76
PR-URL: #78
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants