Skip to content

Commit ea59b6e

Browse files
[SECURITY] Patch for GHSA-2v67-4x3c-889g (BACKPORT)
Version v1.5.1
1 parent f46f285 commit ea59b6e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

multicast/hear.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,25 +329,26 @@ class HearUDPHandler(socketserver.BaseRequestHandler):
329329
def handle(self):
330330
data = self.request[0].strip()
331331
socket = self.request[1]
332+
safe_data = str(data).replace('\r', '').replace('%', '%%')
332333
print(str("{} SAYS: {} to {}").format(
333-
self.client_address[0], str(data), "ALL"
334+
self.client_address[0], safe_data, "ALL"
334335
))
335336
if data is not None:
336337
myID = str(socket.getsockname()[0])
337338
print(
338339
str("{me} HEAR: [{you} SAID {what}]").format(
339-
me=myID, you=self.client_address, what=str(data)
340+
me=myID, you=self.client_address, what=safe_data
340341
)
341342
)
342343
print(
343344
str("{me} SAYS [ HEAR [ {what} SAID {you} ] from {me} ]").format(
344-
me=myID, you=self.client_address, what=str(data)
345+
me=myID, you=self.client_address, what=safe_data
345346
)
346347
)
347348
send.McastSAY()._sayStep( # skipcq: PYL-W0212 - module ok
348349
self.client_address[0], self.client_address[1],
349350
str("HEAR [ {what} SAID {you} ] from {me}").format(
350-
me=myID, you=self.client_address, what=data.upper()
351+
me=myID, you=self.client_address, what=safe_data.upper()
351352
)
352353
)
353354
if """STOP""" in str(data):

0 commit comments

Comments
 (0)