Skip to content

Commit 171456e

Browse files
rtibblesbotclaude
andcommitted
fix(security): drop str(exc) from pagination NotFound message to prevent exception text leakage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 229a0fd commit 171456e

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

contentcuration/contentcuration/utils/pagination.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,8 @@ def paginate_queryset(self, queryset, request, view=None):
8383

8484
try:
8585
self.page = paginator.page(page_number)
86-
except InvalidPage as exc:
87-
msg = self.invalid_page_message.format(
88-
page_number=page_number, message=str(exc)
89-
)
90-
raise NotFound(msg)
86+
except InvalidPage:
87+
raise NotFound("Invalid page: {}".format(page_number))
9188

9289
if paginator.num_pages > 1 and self.template is not None:
9390
# The browsable API should display pagination controls.

0 commit comments

Comments
 (0)