Skip to content

Sécurité: correction des vulnérabilités de redirection ouverte#5512

Merged
xavfernandez merged 3 commits into
masterfrom
xfernandez/open_redirect_fix
Jan 31, 2025
Merged

Sécurité: correction des vulnérabilités de redirection ouverte#5512
xavfernandez merged 3 commits into
masterfrom
xfernandez/open_redirect_fix

Conversation

@xavfernandez
Copy link
Copy Markdown
Contributor

@xavfernandez xavfernandez commented Jan 31, 2025

🤔 Pourquoi ?

Pour que nos utilisateurs ne se fassent pas piéger.

🍰 Comment ?

Décrivez en quelques mots la solution retenue et mise en oeuvre, les difficultés ou problèmes rencontrés. Attirez l'attention sur les décisions d'architecture ou de conception importantes.

🚨 À vérifier

  • Mettre à jour le CHANGELOG_breaking_changes.md ?
  • Ajouter l'étiquette « Bug » ?

🏝️ Comment tester ?

Les instructions pour reproduire le problème, les profils de test, le parcours spécifique à utiliser, etc. Si vous disposez d'une recette jetable, mettre l'URL pour tester dans cette partie.

💻 Captures d'écran

Comment on lines 109 to 110
next_url = request.GET.get("next_url")
if next_url and not url_has_allowed_host_and_scheme(next_url, settings.ALLOWED_HOSTS, request.is_secure()):
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'ai hésité à faire un:

Suggested change
next_url = request.GET.get("next_url")
if next_url and not url_has_allowed_host_and_scheme(next_url, settings.ALLOWED_HOSTS, request.is_secure()):
next_url = get_safe_url(request, "next_url")
if request.GET.get("next_url") and not next_url:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je trouve que c’est moins clair.

Copy link
Copy Markdown
Member

@francoisfreitag francoisfreitag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J’ai greppé pour redirect|HttpResponseRedirect, ainsi que request.(GET|POST) sans trouver d’autres cas. 🙏

@xavfernandez xavfernandez added this pull request to the merge queue Jan 31, 2025
Merged via the queue into master with commit 7de5c53 Jan 31, 2025
@xavfernandez xavfernandez deleted the xfernandez/open_redirect_fix branch January 31, 2025 14:35
@leo-naeka leo-naeka changed the title Tech: correction des vulnérabilités de redirection ouverte Sécurité: correction des vulnérabilités de redirection ouverte Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants