Skip to content

Commit

Permalink
Input validation
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewFlora310 authored Dec 12, 2023
1 parent 985802a commit 76f4f8a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ def web_tool():
r'^http(s)://(?:www\.)?[a-zA-Z0-9-]+(?:\.[a-zA-Z]{2,})+(?:/[^/\s]*)?$')
if not url_pattern.match(user_url):
return jsonify({"error": "Please provide a valid HTTPS URL"}), 400
unallowed_domains = ["osintdashboard.info","https://osintdashboard.azurewebsites.net/"]

if user_url in unallowed_domains or user_url.startswith("https://osintdashboard.azurewebsites.net/"):
return jsonify({"error": "Access to this domain is not allowed"}), 400


domain, ip_str, title, favicon = website_information(user_url)
large_json = {
Expand Down

0 comments on commit 76f4f8a

Please sign in to comment.