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(coap-server): ignore incoming requests with an invalid source port #1188

Merged
merged 3 commits into from
Dec 12, 2023
Merged
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions packages/binding-coap/src/coap-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,12 @@
}

private async handleRequest(req: IncomingMessage, res: OutgoingMessage) {
if (req.rsinfo.port === 0) {
danielpeintner marked this conversation as resolved.
Show resolved Hide resolved
// Ignore requests with an invalid source port
// See https://github.com/eclipse-thingweb/node-wot/issues/1182
return;
}

Check warning on line 442 in packages/binding-coap/src/coap-server.ts

View check run for this annotation

Codecov / codecov/patch

packages/binding-coap/src/coap-server.ts#L439-L442

Added lines #L439 - L442 were not covered by tests

const origin = this.formatRequestOrigin(req);

debug(
Expand Down
Loading