Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ee/api/billing.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from django.utils.http import is_safe_url
from typing import Any, Optional

import posthoganalytics
Expand Down Expand Up @@ -115,6 +116,9 @@ def activation(self, request: Request, *args: Any, **kwargs: Any) -> HttpRespons
billing_service_token = build_billing_token(license, organization)
url = f"{url}&token={billing_service_token}"

if not is_safe_url(url, allowed_hosts={request.get_host()}):
raise ValidationError("Unsafe redirect detected.")

return redirect(url)

@action(methods=["GET"], detail=False)
Expand Down