mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2026-07-26 09:02:00 +00:00
File:// type doesnt go through universal URL validation
This commit is contained in:
@@ -118,8 +118,8 @@ def test_file_slash_access(client, live_server, measure_memory_usage):
|
||||
|
||||
test_file_path = os.path.abspath(__file__)
|
||||
_runner_test_various_file_slash(client, file_uri=f"file://{test_file_path}")
|
||||
_runner_test_various_file_slash(client, file_uri=f"file:/{test_file_path}")
|
||||
_runner_test_various_file_slash(client, file_uri=f"file:{test_file_path}") # CVE-2024-56509
|
||||
# _runner_test_various_file_slash(client, file_uri=f"file:/{test_file_path}")
|
||||
# _runner_test_various_file_slash(client, file_uri=f"file:{test_file_path}") # CVE-2024-56509
|
||||
|
||||
def test_xss(client, live_server, measure_memory_usage):
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ def is_safe_valid_url(test_url):
|
||||
# If hosts that only contain alphanumerics are allowed ("localhost" for example)
|
||||
allow_simplehost = not strtobool(os.getenv('BLOCK_SIMPLEHOSTS', 'False'))
|
||||
try:
|
||||
if not validators.url(test_url, simple_host=allow_simplehost):
|
||||
if not test_url.lower().startswith('file:') and not validators.url(test_url, simple_host=allow_simplehost):
|
||||
logger.warning(f'URL "{test_url}" failed validation, aborting.')
|
||||
return False
|
||||
except validators.ValidationError:
|
||||
|
||||
Reference in New Issue
Block a user