Skip to content

rpc: check content-type for HTTP requests#15220

Merged
fjl merged 1 commit into
ethereum:masterfrom
bas-vk:jsonheader
Nov 9, 2017
Merged

rpc: check content-type for HTTP requests#15220
fjl merged 1 commit into
ethereum:masterfrom
bas-vk:jsonheader

Conversation

@bas-vk
Copy link
Copy Markdown
Member

@bas-vk bas-vk commented Sep 29, 2017

Ensure that HTTP RPC requests contain the content-type header with application/json.

@bas-vk bas-vk requested a review from holiman September 29, 2017 10:00
Copy link
Copy Markdown
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM; but maybe we should wait until after byzantium before merging any potentially breaking changes to the API, so people can use an older version if this breaks their setups.

Comment thread rpc/http.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may want to consider not reflecting untrusted user submitted data here and change the message to "invalid content type, only application/json is supported".

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I don't immediately see how an adversary can abuse this but there might be ways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants