CVE-2024-51998
Description
changedetection.io is a free open source web page change detection tool. The validation for the file URI scheme falls short, and results in an attacker being able to read any file on the system. This issue only affects instances with a webdriver enabled, and ALLOW_FILE_URI false or not defined. The check used for URL protocol, is_safe_url, allows file: as a URL scheme. It later checks if local files are permitted, but one of the preconditions for the check is that the URL starts with file://. The issue comes with the fact that the file URI scheme is not required to have double slashes. This issue has been addressed in version 0.47.06 and all users are advised to upgrade. There are no known workarounds for this vulnerability.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
changedetection.ioPyPI | < 0.47.6 | 0.47.6 |
Patches
2d2978505390549bc982c6971CVE-2024-51998 - file:/ path traversal access should not be allowed to access a file without ALLOW_FILE_URI set
2 files changed · +30 −3
changedetectionio/processors/__init__.py+2 −2 modified@@ -33,8 +33,8 @@ def call_browser(self, preferred_proxy_id=None): url = self.watch.link - # Protect against file:// access, check the real "link" without any meta "source:" etc prepended. - if re.search(r'^file://', url, re.IGNORECASE): + # Protect against file://, file:/ access, check the real "link" without any meta "source:" etc prepended. + if re.search(r'^file:/', url.strip(), re.IGNORECASE): if not strtobool(os.getenv('ALLOW_FILE_URI', 'false')): raise Exception( "file:// type access is denied for security reasons."
changedetectionio/tests/test_security.py+28 −1 modified@@ -61,7 +61,7 @@ def test_bad_access(client, live_server, measure_memory_usage): assert b'Watch protocol is not permitted by SAFE_PROTOCOL_REGEX' in res.data -def test_file_access(client, live_server, measure_memory_usage): +def test_file_slashslash_access(client, live_server, measure_memory_usage): #live_server_setup(live_server) test_file_path = "/tmp/test-file.txt" @@ -88,6 +88,33 @@ def test_file_access(client, live_server, measure_memory_usage): # Default should be here assert b'file:// type access is denied for security reasons.' in res.data +def test_file_slash_access(client, live_server, measure_memory_usage): + #live_server_setup(live_server) + + test_file_path = "/tmp/test-file.txt" + + # file:// is permitted by default, but it will be caught by ALLOW_FILE_URI + client.post( + url_for("form_quick_watch_add"), + data={"url": f"file:/{test_file_path}", "tags": ''}, + follow_redirects=True + ) + wait_for_all_checks(client) + res = client.get(url_for("index")) + + # If it is enabled at test time + if strtobool(os.getenv('ALLOW_FILE_URI', 'false')): + res = client.get( + url_for("preview_page", uuid="first"), + follow_redirects=True + ) + + # Should see something (this file added by run_basic_tests.sh) + assert b"Hello world" in res.data + else: + # Default should be here + assert b'file:// type access is denied for security reasons.' in res.data + def test_xss(client, live_server, measure_memory_usage): #live_server_setup(live_server) from changedetectionio.notification import (
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
7- github.com/advisories/GHSA-6jrf-rcjf-245rghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2024-51998ghsaADVISORY
- github.com/dgtlmoon/changedetection.io/blob/e0abf0b50507a8a3d0c1d8522ab23519b3e4cdf4/changedetectionio/model/Watch.pynvdWEB
- github.com/dgtlmoon/changedetection.io/blob/e0abf0b50507a8a3d0c1d8522ab23519b3e4cdf4/changedetectionio/processors/__init__.pyghsaWEB
- github.com/dgtlmoon/changedetection.io/commit/49bc982c697169c98b79698889fb9d26f6b3317fnvdWEB
- github.com/dgtlmoon/changedetection.io/releases/tag/0.47.06ghsaWEB
- github.com/dgtlmoon/changedetection.io/security/advisories/GHSA-6jrf-rcjf-245rnvdWEB
News mentions
0No linked articles in our index yet.