From fc4c891da8eae40b5609b3937bc4a8edc845dd25 Mon Sep 17 00:00:00 2001 From: Nassim Tabchiche Date: Fri, 13 Sep 2024 17:23:35 +0200 Subject: [PATCH] Fix potential information disclosure serializers.ValidationError is passed to the ViewSet and returned to the client. Displaying the message of the exception WILL cause unwanted information disclosure. --- backend/core/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/core/serializers.py b/backend/core/serializers.py index baaf1456e..349e4a3f2 100644 --- a/backend/core/serializers.py +++ b/backend/core/serializers.py @@ -86,7 +86,7 @@ def create(self, validated_data: Any): return object_created except Exception as e: logger.error(e) - raise serializers.ValidationError(e.args[0]) + raise serializers.ValidationError() class Meta: model: models.Model