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

Fix threshold after which a protocol name is too long #2162

Merged
merged 4 commits into from
Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions bin/wasm-node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
- Add `ClientOptions.cpuRateLimit`, which lets the user put an upper bound on the amount of CPU that the client uses on average ([#2151](https://github.com/paritytech/smoldot/pull/2151)).
- Add support for parsing the "fron" (Frontier) consensus log items in headers. The content of these log items is ignored by the client. ([#2150](https://github.com/paritytech/smoldot/pull/2150))

### Fixed

- Increase the threshold after which smoldot considers that a protocol name sent through multistream-select is an attempt at a DoS attack, to accomodate for the change in the GrandPa protocol name in Substrate. ([#2162](https://github.com/paritytech/smoldot/pull/2162))

## 0.6.5 - 2022-03-17

### Changed
Expand Down
2 changes: 1 addition & 1 deletion src/libp2p/connection/multistream_select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ where
// legitimately requests a protocol that the listener doesn't support. In order to prevent
// confusion, a minimum length is applied to the protocol name length. Any protocol name
// smaller than this will never trigger a protocol error, even if it isn't supported.
const MIN_PROTO_LEN_NO_ERR: usize = 48;
const MIN_PROTO_LEN_NO_ERR: usize = 512;
let max_frame_len = cmp::max(
cmp::max(max_proto_name_len, MIN_PROTO_LEN_NO_ERR),
HANDSHAKE.len(),
Expand Down