From 9c73986e2abecc9daff61c6b51d173fdd647449a Mon Sep 17 00:00:00 2001 From: TheKysek Date: Wed, 23 Aug 2017 18:35:48 +0200 Subject: [PATCH] Reject objects with end of life set too far into the future --- minode/structure.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/minode/structure.py b/minode/structure.py index b44bd80..862f587 100644 --- a/minode/structure.py +++ b/minode/structure.py @@ -84,6 +84,9 @@ class Object(object): if self.is_expired(): logging.warning('Rejecting object {}, reason: is_expired'.format(base64.b16encode(self.vector).decode())) return False + if self.expires_time > time.time() + 28 * 24 * 3600 + 3 * 3600: + logging.warning('Rejecting object {}, reason: end of life too far into the future'.format(base64.b16encode(self.vector).decode())) + return False if len(self.object_payload) > 2**18: logging.warning('Rejecting object {}, reason: len(payload) > 2**18'.format(base64.b16encode(self.vector).decode())) return False