Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ff2f2b5

Browse files
committed
Python: Add django.shortcuts.redirect test
1 parent 7a76a51 commit ff2f2b5

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

python/ql/test/experimental/library-tests/frameworks/django-v1/response_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from django.http.response import HttpResponse, HttpResponseRedirect, HttpResponsePermanentRedirect, JsonResponse, HttpResponseNotFound
2+
import django.shortcuts
23

34
# Not an XSS sink, since the Content-Type is not "text/html"
45
# FP reported in https://github.com/github/codeql-python-team/issues/38
@@ -48,6 +49,11 @@ def redirect_through_normal_response(request):
4849
return resp
4950

5051

52+
def redirect_shortcut(request):
53+
next = request.GET.get("next")
54+
return django.shortcuts.redirect(next) # $ MISSING: HttpResponse HttpRedirectResponse redirectLocation=next
55+
56+
5157
# Ensure that simple subclasses are still vuln to XSS
5258
def xss__not_found(request):
5359
return HttpResponseNotFound(request.GET.get("name")) # $HttpResponse mimetype=text/html responseBody=Attribute()

0 commit comments

Comments
 (0)