-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Candidature: traitement par lot [GEN-1949] #5242
base: master
Are you sure you want to change the base?
Conversation
2d161d7
to
a7a5fae
Compare
🥁 La recette jetable est prête ! 👉 Je veux tester cette PR ! |
ec04e9e
to
7cc3864
Compare
archived_nb, | ||
",".join(str(app_uid) for app_uid in archived_ids), | ||
) | ||
return HttpResponseRedirect(next_url) |
Check warning
Code scanning / CodeQL
URL redirection from remote source Medium
user-provided value
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 1 day ago
To fix the problem, we need to ensure that the next_url
is validated before it is used in the HttpResponseRedirect
function. We can use Django's url_has_allowed_host_and_scheme
function to check that the URL is safe to redirect to. This function ensures that the URL does not contain an explicit host name unless it is in the list of allowed hosts.
- Modify the
transfer
function to validatenext_url
usingurl_has_allowed_host_and_scheme
. - If
next_url
is not valid, redirect to a safe fallback URL.
-
Copy modified line R11 -
Copy modified lines R436-R437
@@ -10,2 +10,3 @@ | ||
from django.urls import reverse | ||
from django.utils.http import url_has_allowed_host_and_scheme | ||
from django.utils import timezone | ||
@@ -434,2 +435,4 @@ | ||
next_url = get_safe_url(request, "next_url", fallback_url=reverse("apply:list_for_siae")) | ||
if not url_has_allowed_host_and_scheme(next_url, allowed_hosts=None): | ||
next_url = reverse("apply:list_for_siae") | ||
logger.info( |
86197bb
to
f61e6cc
Compare
c48a175
to
7aa8731
Compare
bbdd791
to
81e4c07
Compare
14bb543
to
a55404b
Compare
",".join(str(app_uid) for app_uid in postponed_ids), | ||
) | ||
next_url = get_safe_url(request, "next_url", fallback_url=reverse("apply:list_for_siae")) | ||
return HttpResponseRedirect(next_url) |
Check warning
Code scanning / CodeQL
URL redirection from remote source Medium
user-provided value
5f7e775
to
36466b2
Compare
ea788af
to
1d915a7
Compare
1d915a7
to
668f271
Compare
🤔 Pourquoi ?
🍰 Comment ?
🚨 À vérifier
🏝️ Comment tester
💻 Captures d'écran