Skip to content

Commit 1c38387

Browse files
committed
Merged in [16649] from rjsparks@nostrum.com:
Guard against attempts to use the review request view with a ReviewRequest id that does not match the document for the ReviewRequest. This would have exposed ietf-tools#2776 much earlier. - Legacy-Id: 16710 Note: SVN reference [16649] has been migrated to Git commit 01ceeba
2 parents 3349d64 + 01ceeba commit 1c38387

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

ietf/doc/views_review.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import debug # pyflakes:ignore
1414

15-
from django.http import HttpResponseForbidden, JsonResponse
15+
from django.http import HttpResponseForbidden, JsonResponse, Http404
1616
from django.shortcuts import render, get_object_or_404, redirect
1717
from django import forms
1818
from django.conf import settings
@@ -186,6 +186,8 @@ def review_request_forced_login(request, name, request_id):
186186
def review_request(request, name, request_id):
187187
doc = get_object_or_404(Document, name=name)
188188
review_req = get_object_or_404(ReviewRequest, pk=request_id)
189+
if review_req.doc != doc:
190+
raise Http404('The indicated ReviewRequest is not a request for the indicated document')
189191

190192
can_manage_request = can_manage_review_requests_for_team(request.user, review_req.team)
191193

0 commit comments

Comments
 (0)