Security update - Protect against file:/// type access by webdriver/chrome. (#483)

This commit is contained in:
dgtlmoon
2022-03-21 20:59:20 +01:00
committed by GitHub
parent 82d1a7f73e
commit f2fa638480
3 changed files with 45 additions and 6 deletions

View File

@@ -1,10 +1,10 @@
import hashlib
import os
import re
import time
import urllib3
from inscriptis import get_text
from inscriptis import get_text
from changedetectionio import content_fetcher, html_tools
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
@@ -24,8 +24,14 @@ class perform_site_check():
stripped_text_from_html = ""
watch = self.datastore.data['watching'][uuid]
# Unset any existing notification error
# Protect against file:// access
if re.search(r'^file', watch['url'], re.IGNORECASE) and not os.getenv('ALLOW_FILE_URI', False):
raise Exception(
"file:// type access is denied for security reasons."
)
# Unset any existing notification error
update_obj = {'last_notification_error': False, 'last_error': False}
extra_headers = self.datastore.get_val(uuid, 'headers')