changedetection-io
Affected
- introduced
0, fixed0.55.1(ecosystem)
Fixed versions
0.55.1
Fix
- Fixed version
0.55.1pip install --upgrade changedetection-io==0.55.1
Advisory
Also known as: CVE-2026-43891, PYSEC-2026-30
changedetection.io has an Arbitrary Local File Read via a crafted backup restore
Details
The vulnerability is caused by trusting attacker-controlled snapshot paths restored from backup files.
The vulnerable flow starts in the backup restore logic. When a backup ZIP is restored, the application extracts the archive and copies each restored watch UUID directory directly into the live datastore using shutil.copytree(entry.path, dst_dir). This preserves attacker-controlled files inside the restored watch directory, including history.txt.
Relevant code:
After restore, the application parses history.txt in the watch history property. This is the core trust-boundary issue.
Relevant code:
The relevant logic is effectively:
if os.sep not in v and '/' not in v and '\\' not in v:
v = os.path.join(self.data_dir, v)
else:
snapshot_fname = os.path.basename(v)
proposed_new_path = os.path.join(self.data_dir, snapshot_fname)
if not os.path.exists(v) and os.path.exists(proposed_new_path):
v = proposed_new_path
This has the following security consequence:
history.txt value is only a filename, it is resolved safely under self.data_dir.As a result, a malicious restored history.txt entry such as:
1776969105,/etc/passwd
will be accepted if the referenced file exists and is readable by the application process.
The second vulnerable step is in get_history_snapshot(). Once the untrusted path has been accepted into the watch history, the application reads the resolved path directly without enforcing that it remains inside the watch directory.
Relevant code:
That function eventually performs direct file reads such as:
with open(filepath, 'r', encoding='utf-8', errors='ignore') as f:
return f.read()
The third step is reachability. The trusted history entry is consumed by both the Preview UI and the watch history API.
Relevant code:
In the Preview flow, the application selects the latest history timestamp and calls:
content = watch.get_history_snapshot(timestamp=timestamp)
In the API flow, the application also calls:
content = watch.get_history_snapshot(timestamp=timestamp)
This creates the following end-to-end exploit chain:
history.txt.history.txt parser accepts an absolute or out-of-directory path if that path exists.The root cause is that imported history entries are treated as trusted filesystem paths instead of being restricted to safe basenames under watch.data_dir.
PoC
The following proof of concept demonstrates the end-to-end exploit chain. It assumes the attacker has gained access to the backup restore functionality to upload the crafted archive.
https://example.com
<img width="1230" height="587" alt="image" src="https://github.com/user-attachments/assets/a76302c9-48d6-4aa3-9bfc-0ba2fdb31156" />
Backups section and create a backup archive.<img width="1232" height="390" alt="image" src="https://github.com/user-attachments/assets/8fef0444-d8f0-4db6-be75-04fa7db2fec8" />
watch.json. For example:5db3d3d8-71e6-4db2-a81e-e1f0445c3e47
history.txt.1776969188,/etc/passwd
If the timestamp differs in the extracted backup, keep the original latest timestamp and only replace the filename/path portion.
Example:
1776969188,742215043ff9be7e635f05e680ff9b11.txt
becomes:
1776969188,/etc/passwd
<img width="1139" height="366" alt="image" src="https://github.com/user-attachments/assets/07277b36-4747-4181-82d1-523385b40de3" />
Important:
<watch-uuid>/
<group-uuid>/
changedetection.json
url-list.txt
<img width="986" height="353" alt="image" src="https://github.com/user-attachments/assets/21b30368-2cb5-4b88-9055-79d5bf06ad48" />
<img width="1229" height="700" alt="image" src="https://github.com/user-attachments/assets/79abd9d2-8b2d-4e08-abf3-3b63238a8055" />
Preview for the restored watch.history.txt and display the contents of the referenced local file instead of the original watch snapshot.Observed result:
Expected result:
history.txt.Optional API verification:
watch.get_history_snapshot(timestamp=timestamp) on the trusted history entry.High Basis: The source's own band: HIGH
0, fixed 0.55.1 (ecosystem)0.55.1
0.55.1pip install --upgrade changedetection-io==0.55.1Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0