From 4003a4772397abb5c42e62cb0b41359a0bd9f3d5 Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 30 Jul 2026 18:22:45 +0000 Subject: [PATCH] multipart boundary max-len --- copyparty/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/copyparty/util.py b/copyparty/util.py index c6c96e2e..fccafa49 100644 --- a/copyparty/util.py +++ b/copyparty/util.py @@ -2150,7 +2150,8 @@ class MultipartParser(object): boundary = get_boundary(self.headers) if boundary.startswith('"') and boundary.endswith('"'): boundary = boundary[1:-1] # dillo uses quotes - self.log("boundary=%r" % (boundary,)) + if len(boundary) > 72: # rfc-2046 <=70 + raise Pebkac(400, "boundary 2big: %d" % (len(boundary),)) # spec says there might be junk before the first boundary, # can't have the leading \r\n if that's not the case