{"id":"CVE-2024-32651","kind":"vulnerability","aliases":["CVE-2024-32651","GHSA-4r7v-whpg-8rx3"],"related":[],"title":"changedetection.io has a Server Side Template Injection using Jinja2 which allows Remote Command Execution","description":"### Summary\nA Server Side Template Injection in changedetection.io caused by usage of unsafe functions of Jinja2 allows Remote Command Execution on the server host.\n\n### Details\n\nchangedetection.io version: 0.45.20\n```\ndocker images\nREPOSITORY                            TAG       IMAGE ID       CREATED        SIZE\ndgtlmoon/changedetection.io           latest    53529c2e69f1   44 hours ago   423MB\n```\n\nThe vulnerability is caused by the usage of vulnerable functions of Jinja2 template engine.\n```python\nfrom jinja2 import Environment, BaseLoader\n...\n    # Get the notification body from datastore\n    jinja2_env = Environment(loader=BaseLoader)\n    n_body = jinja2_env.from_string(n_object.get('notification_body', '')).render(**notification_parameters)\n    n_title = jinja2_env.from_string(n_object.get('notification_title', '')).render(**notification_parameters)\n```\n\n\n### PoC\n1. Create/Edit a URL watch item\n2. Under *Notifications* tab insert this payload: \n```python\n{{ self.__init__.__globals__.__builtins__.__import__('os').popen('id').read() }}\n```\n![Screenshot from 2024-04-19 15-46-04](https://github.com/dgtlmoon/changedetection.io/assets/35783570/b6a5779f-fd1e-4708-9b2d-21cb97f0bb4f)\n\n3. See Telegram (or other supported messaging app) notification\n\n![Screenshot from 2024-04-19 16-02-12](https://github.com/dgtlmoon/changedetection.io/assets/35783570/20877919-d6fe-49f1-bbd2-586e900207f1)\n\n\n### Impact\nIn the PoC I've used `id` as payload and Telegram to read the result.  \nAttackers can run any system command without any restriction and they don't need to read the result in the notification app (e.g. they could use a reverse shell).\nThe impact is critical as the attacker can completely takeover the server host.\nThis can be reduced if changedetection access is protected by login page with a password, but this isn't required by the application (not by default and not enforced).\n\n### References\n- https://www.hacktivesecurity.com/blog/2024/05/08/cve-2024-32651-server-side-template-injection-changedetection-io/\n- https://book.hacktricks.xyz/pentesting-web/ssti-server-side-template-injection/jinja2-ssti\n- https://www.onsecurity.io/blog/server-side-template-injection-with-jinja2/\n- https://docs.cobalt.io/bestpractices/prevent-ssti/\n\n### Credits\n\nEdoardo Ottavianelli","summary":"changedetection.io renders notification title and body fields through Jinja2 as templates, so a crafted value in a watch's Notifications tab executes Python on the server. An attacker who can edit a watch gets remote command execution on the host, with no reading of output needed since a reverse shell works.","severity":"critical","cvss":10.0,"epss":0.83601,"exploited":false,"exploited_at":null,"products":[{"name":"changedetection.io","fixed":["0.45.21"],"affected":"<= 0.45.20","ecosystem":"pypi"}],"ecosystems":["pypi"],"tags":["changedetection.io","cwe-1336","docker","package","python","self-hosted"],"not_affected_if":["auth-required","fixed-version-0.45.21"],"how_to_check":"- Check the installed version with `pip show changedetection.io` or `docker images dgtlmoon/changedetection.io`; affected versions are `<= 0.45.20`\n- Confirm the instance is reachable from the internet or an untrusted network and has no login page configured","fix":"- Upgrade `changedetection.io` to `0.45.21` or later\n- Until upgraded, restrict access to the web UI behind authentication and a network boundary","status":"open","published_at":"2024-04-26T00:15:08+00:00","first_seen_at":"2026-10-27T16:25:43+00:00","triaged_at":"2026-10-27T16:27:41+00:00","updated_at":"2026-10-27T16:33:07+00:00","category":"package","confidence":0.9,"triage":{"at":"2026-10-27T16:27:41Z","model":"claude-haiku-5-5","output":{"fix":"- Upgrade `changedetection.io` to `0.45.21` or later\n- Until upgraded, restrict access to the web UI behind authentication and a network boundary","reach":"internet","title":"changedetection.io: template injection in notifications lets attackers run commands","impact":"high","summary":"changedetection.io renders notification title and body fields through Jinja2 as templates, so a crafted value in a watch's Notifications tab executes Python on the server. An attacker who can edit a watch gets remote command execution on the host, with no reading of output needed since a reverse shell works.","category":"package","nicknames":[],"who_cares":["changedetection.io","python","self-hosted","docker"],"confidence":0.9,"needs_auth":"unknown","worst_case":"Attacker runs arbitrary system commands as the service user on the host.","analyst_note":"","how_to_check":"- Check the installed version with `pip show changedetection.io` or `docker images dgtlmoon/changedetection.io`; affected versions are `<= 0.45.20`\n- Confirm the instance is reachable from the internet or an untrusted network and has no login page configured","needs_analyst":false,"not_affected_if":["fixed-version-0.45.21","auth-required"],"who_is_affected":"Any deployment of changedetection.io at or below `0.45.20` where someone can create or edit a watch, which is the default for the web UI. Exposure is highest when the UI is reachable without a password, since the advisory notes login is not enforced by default. Teams running only a patched release or an instance locked to trusted users behind login can deprioritise it.","user_interaction":"no","needs_special_setup":"no","severity_if_unknown":"critical"},"cost_usd":0.000706,"input_tokens":4179,"output_tokens":577,"severity_before":"critical"},"analyst_status":null,"analyst_note":null,"search":"'-02':227C '-04':204C,208C,224C '-12':228C '-1336':29B '-19':205C,225C '-2024':16A,24A '-32651':17A,25A '-46':207C '/bestpractices/prevent-ssti/':331C '/blog/2024/05/08/cve-2024-32651-server-side-template-injection-changedetection-io/':322C '/blog/server-side-template-injection-with-jinja2/':328C '/dgtlmoon/changedetection.io/assets/35783570/20877919-d6fe-49f1-bbd2-586e900207f1)':231C '/dgtlmoon/changedetection.io/assets/35783570/b6a5779f-fd1e-4708-9b2d-21cb97f0bb4f)':211C '/pentesting-web/ssti-server-side-template-injection/jinja2-ssti':325C '0.45.20':114C '1':182C '15':206C '16':226C '2':188C '2024':203C,223C '3':212C '423mb':129C '44':126C '4r7v':20A '53529c2e69f1':125C '8rx3':22A 'access':296C 'ago':128C 'allow':11A,103C 'app':219C,269C 'applic':312C 'attack':63B,248C,283C 'baseload':149C,160C 'bodi':41B,153C,162C,167C 'book.hacktricks.xyz':324C 'book.hacktricks.xyz/pentesting-web/ssti-server-side-template-injection/jinja2-ssti':323C 'caus':95C,133C 'changedetect':295C 'changedetection.io':1A,26A,27B,36B,94C,112C 'command':13A,71B,105C,253C 'complet':285C 'could':272C 'craft':49B 'creat':121C 'create/edit':183C 'credit':332C 'critic':280C 'cve':15A,23A 'cwe':28B 'datastor':155C 'default':315C 'detail':111C 'dgtlmoon/changedetection.io':123C 'docker':30B,115C 'docs.cobalt.io':330C 'docs.cobalt.io/bestpractices/prevent-ssti/':329C 'e.g':270C 'edit':66B 'edoardo':333C 'enforc':318C 'engin':143C 'env':157C 'environ':148C,158C 'execut':14A,57B,72B,106C 'field':42B 'function':100C,139C 'get':69B,150C 'ghsa':19A 'ghsa-4r7v-whpg-8rx3':18A 'github.com':210C,230C 'github.com/dgtlmoon/changedetection.io/assets/35783570/20877919-d6fe-49f1-bbd2-586e900207f1)':229C 'github.com/dgtlmoon/changedetection.io/assets/35783570/b6a5779f-fd1e-4708-9b2d-21cb97f0bb4f)':209C 'host':35B,75B,110C,289C 'hour':127C 'id':120C,199C,239C 'imag':116C,119C 'impact':232C,278C 'import':147C 'inject':7A,92C 'insert':192C 'isn':307C 'item':187C 'jinja2':9A,44B,102C,141C,146C,156C 'jinja2_env.from':163C,173C 'latest':124C 'loader':159C 'login':300C 'messag':218C 'n':161C,171C 'n_object.get':165C,175C 'need':81B,261C 'notif':38B,55B,152C,166C,169C,176C,179C,190C,220C,268C 'os':197C 'ottavianelli':334C 'output':80B 'packag':31B 'page':301C 'paramet':170C,180C 'password':304C 'payload':194C,241C 'poc':181C,235C 'popen':198C 'protect':298C 'python':32B,58B,144C,195C 'read':78B,200C,245C,263C 'reduc':293C 'refer':319C 'remot':12A,70B,104C 'render':37B,168C,178C 'repositori':117C 'requir':309C 'restrict':256C 'result':247C,265C 'revers':84B,275C 'run':250C 'screenshot':201C,221C 'see':213C 'self':34B 'self-host':33B 'self.__init__.__globals__.__builtins__.__import__':196C 'server':4A,61B,89C,109C,288C 'shell':85B,276C 'side':5A,90C 'sinc':82B 'size':122C 'string':164C,174C 'summari':87C 'support':217C 'system':252C 'tab':56B,191C 'tag':118C 'takeov':286C 'telegram':214C,243C 'templat':6A,46B,91C,142C 'titl':39B,172C,177C 'unsaf':99C 'url':185C 'usag':97C,136C 'use':8A,238C,273C 'valu':50B 've':237C 'version':113C 'vulner':131C,138C 'watch':53B,68B,186C 'whpg':21A 'without':254C 'work':86B 'www.hacktivesecurity.com':321C 'www.hacktivesecurity.com/blog/2024/05/08/cve-2024-32651-server-side-template-injection-changedetection-io/':320C 'www.onsecurity.io':327C 'www.onsecurity.io/blog/server-side-template-injection-with-jinja2/':326C","nicknames":[],"mitigations":[],"who_affected":"Any deployment of changedetection.io at or below `0.45.20` where someone can create or edit a watch, which is the default for the web UI. Exposure is highest when the UI is reachable without a password, since the advisory notes login is not enforced by default. Teams running only a patched release or an instance locked to trusted users behind login can deprioritise it.","tier":"B","verified":{},"analyst_revisit_at":null,"first_public_at":"2024-04-26T00:15:08+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","cvss_by":"GitHub","poc_count":0,"sources":[{"source":"ghsa","external_id":"GHSA-4r7v-whpg-8rx3","url":"https://github.com/advisories/GHSA-4r7v-whpg-8rx3","severity":"critical","published_at":"2024-10-15T18:05:15+00:00","modified_at":"2026-10-27T16:21:19+00:00","first_seen_at":"2026-10-27T16:25:43+00:00","fetched_at":"2026-10-27T16:25:43+00:00","note":null},{"source":"nvd","external_id":"CVE-2024-32651","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-32651","severity":null,"published_at":"2024-04-26T00:15:08+00:00","modified_at":"2026-06-17T07:30:09+00:00","first_seen_at":"2026-10-27T16:33:07+00:00","fetched_at":"2026-10-27T16:33:07+00:00","note":null}],"documents":[],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}