The vulnerability is a stored Cross-Site Scripting (XSS) issue within the changedetection.io application, specifically in the API endpoints for managing watches. The root cause was the insufficient validation of the url parameter when creating or updating a watch via the API.
The advisory's Proof of Concept demonstrates that an attacker with API access could send a PUT request to /api/v1/watch/{uuid} to update a watch's URL to a malicious javascript: payload. The analysis of the patch commits confirms this. The primary vulnerable function was Watch.put in changedetectionio/api/Watch.py, which completely lacked URL validation for incoming updates.
The patch, introduced in commit 552e98519b2811c2e25000f1ff0995715aa0b725, adds a call to a new is_safe_url function to validate the URL before applying the update. This function explicitly checks if the URL starts with a safe protocol (http, https, ftp, file).
Further investigation of subsequent commits, like d48c82052a7b9bbff65ea65d38d5b8a67a3ab03b, revealed that the Watch.post method (for creating watches) was also inadequately protected. It used a generic validators.url check which was replaced by the more robust, custom validation logic. This implies that both creating and updating watches through the API were vulnerable entry points. When a user later views or previews the watch with the malicious URL in the web UI, the JavaScript payload executes in their browser.