We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ea1e78e commit f11b7f0Copy full SHA for f11b7f0
lib/server/swarm.js
@@ -37,6 +37,12 @@ class Swarm {
37
announce (params, cb) {
38
const self = this
39
const id = params.type === 'ws' ? params.peer_id : params.addr
40
+
41
+ // Prevent invalid ports as this can be abused - issue: #512
42
+ if (params.port <= 0 || params.port > 65535) {
43
+ return cb(new Error('invalid port announced'))
44
+ }
45
46
// Mark the source peer as recently used in cache
47
const peer = self.peers.get(id)
48
0 commit comments