The vulnerability is an arbitrary file read due to an XPath injection in the include_filters field. The root cause is the use of the elementpath library's XPath3Parser without disabling dangerous functions like unparsed-text(), which can access the local filesystem.
The analysis of the patch commit 417d57e5749441e4be9acc4010369bded805d66f reveals the exact locations of the vulnerability. The patch introduces a SafeXPath3Parser where unsafe functions are explicitly removed.
Two functions were identified as vulnerable:
changedetectionio.html_tools.xpath_filter: This is the core function where the malicious XPath is executed when a website check is performed. The patch replaces the unsafe XPath3Parser with the new SafeXPath3Parser, confirming this is where the exploit is triggered.
changedetectionio.forms.ValidateCSSJSONXPATHInput.__call__: This function is the validation step for the user-provided filter. It was also using the unsafe XPath3Parser to validate the expression, which means the malicious payload was not blocked at the input stage. An attacker could save a filter with a payload like xpath:unparsed-text('file:///etc/passwd'), which would then be executed by xpath_filter.
During exploitation, a profiler would likely show xpath_filter in the stack trace as it's the function that directly processes the malicious XPath and triggers the file read.