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

Reject the first SETTINGS ack on HTTP/2 Preface #4428

Closed
wants to merge 1 commit into from

Conversation

@trustin
Copy link
Member

commented Nov 2, 2015

Motivation:

Http2ConnectionHandler verifies if the first frame after the preface is
a SETTINGS frame. However, it does not reject the SETTING ack frame
which is not expected actually.

Modifications:

Reject a SETTINGS-ack frame as well

Result:

When the first frame is a SETTINGS-ack frame, connection does not
proceed to further frame handling. (simplicity)

Reject the first SETTINGS ack on HTTP/2 Preface
Motivation:

Http2ConnectionHandler verifies if the first frame after the preface is
a SETTINGS frame.  However, it does not reject the SETTING ack frame
which is not expected actually.

Modifications:

Reject a SETTINGS-ack frame as well

Result:

When the first frame is a SETTINGS-ack frame, connection does not
proceed to further frame handling. (simplicity)

@trustin trustin added this to the 4.1.0.CR1 milestone Nov 2, 2015

@netkins

This comment has been minimized.

Copy link

commented on 76a47a8 Nov 2, 2015

TeamCity pull requests :: netty Build 551 is now running

This comment has been minimized.

Copy link

replied Nov 2, 2015

TeamCity pull requests :: netty Build 551 outcome was SUCCESS
Summary: Tests passed: 5643, ignored: 21 Build time: 00:42:48

@trustin

This comment has been minimized.

Copy link
Member Author

commented Nov 2, 2015

@nmittler PTAL. I wonder if a SETTINGS-ack frame is allowed as the first frame from a client. If not, this PR might be useful.

On the other hand, I see the case where a client sends a SETTINGS-ack frame as its first frame, making PrefaceFrameListener.verifyPrefaceReceived() break the connection. Did you observe the same issue? I'm trying to debug this but maybe you are more familiar with HTTP/2 codec.

@trustin

This comment has been minimized.

Copy link
Member Author

commented Nov 2, 2015

I'm not exactly sure if I read the RFC correctly, but it seems like SETTINGS-ack is also permitted as the first frame. (i.e. this PR is wrong.) It's probably DefaultHttp2ConnectionDecoder.PrefaceFrameListener.onSettingsAckRead() that needs a fix. Could you please confirm, @nmittler ? If I read it wrong, then we probably should fix the ordering issue.

@trustin trustin added the defect label Nov 2, 2015

@nmittler

This comment has been minimized.

Copy link
Member

commented Nov 2, 2015

@trustin the SETTINGS frame must be first, since it is part of the connection preface. So a SETTINGS-ack is invalid as the first frame. I believe this PR is correct. Good catch! LGTM :)

@Scottmitch

This comment has been minimized.

Copy link
Member

commented Nov 2, 2015

lgtm. settings must come before settings ack

@trustin trustin closed this Nov 3, 2015

@trustin trustin deleted the reject_first_settings_ack branch Nov 3, 2015

@trustin

This comment has been minimized.

Copy link
Member Author

commented Nov 3, 2015

Cherry-picked: 8f33488 (4.1) and 7a0282c (master)

@normanmaurer normanmaurer modified the milestones: 4.1.0.CR1, 4.1.0.Beta8 Nov 10, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.