{"id":"CVE-2024-21624","aliases":["CVE-2024-21624","GHSA-59j8-776v-xxxg","PYSEC-2024-37"],"related":[],"kind":"vulnerability","state":"published","title":"Potential Information Leak in User-Constructed Message Templates in nonebot2","summary":"nonebot2 is a cross-platform Python asynchronous chatbot framework written in Python. This security advisory pertains to a potential information leak (e.g., environment variables) in instances where developers utilize `MessageTemplate` and incorporate user-provided data into templates. The identified vulnerability has been remedied in pull request #2509 and will be included in versions released from 2.2.0. Users are strongly advised to upgrade to these patched versions to safeguard against the vulnerability. A temporary workaround involves filtering underscores before incorporating user input into the message template.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"nonebot2 is a cross-platform Python asynchronous chatbot framework written in Python. This security advisory pertains to a potential information leak (e.g., environment variables) in instances where developers utilize `MessageTemplate` and incorporate user-provided data into templates. The identified vulnerability has been remedied in pull request #2509 and will be included in versions released from 2.2.0. Users are strongly advised to upgrade to these patched versions to safeguard against the vulnerability. A temporary workaround involves filtering underscores before incorporating user input into the message template.","source":"cvelist"},{"lang":"en","text":"### Impact\nThis security advisory pertains to a potential information leak (e.g., environment variables) in instances where developers utilize `MessageTemplate` and incorporate user-provided data into templates.\n\n### Patches\nThe identified vulnerability has been remedied in fix #2509 and will be included in versions released after 2.1.3. Users are strongly advised to upgrade to these patched versions to safeguard against the vulnerability.\n\n### Workarounds\nA temporary workaround involves filtering underscores before incorporating user input into the message template.\n\n### References\n- [Pull Request #2509](https://github.com/nonebot/nonebot2/pull/2509)\n- [CWE-1336](https://cwe.mitre.org/data/definitions/1336.html)","format":"markdown","source":"ghsa"},{"lang":"es","text":"nonebot2 es un framework de chatbot asincrónico de Python multiplataforma escrito en Python. Este aviso de seguridad se refiere a una posible fuga de información (por ejemplo, variables de entorno) en casos en los que los desarrolladores utilizan \"MessageTemplate\" e incorporan datos proporcionados por el usuario en plantillas. La vulnerabilidad identificada se solucionó en la solicitud de extracción n.° 2509 y se incluirá en las versiones lanzadas a partir de la 2.2.0. Se recomienda encarecidamente a los usuarios que actualicen a estas versiones parcheadas para protegerse contra la vulnerabilidad. Una solución temporal implica filtrar los guiones bajos antes de incorporar la entrada del usuario en la plantilla del mensaje.","source":"nvd"}],"published":"2024-02-09T15:04:08.000Z","modified":"2026-09-10T03:50:05.511Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N","score":5.7,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N","score":5.7,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N","score":5.7,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-200","CWE-1336"],"affected":[{"ranges":[{"version":">= 2.0.0a16, < 2.2.0","status":"affected"}],"vendor":"nonebot","product":"nonebot2","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"2.0.0a16","status":"affected","fixed":"2.2.0"}],"ecosystem":"PyPI","package":"nonebot2","purl":"pkg:pypi/nonebot2","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"2.0.1","fixed":"2.2.0"},{"status":"affected","version":"2.0.0"},{"status":"affected","version":"2.0.0"},{"status":"affected","version":"2.0.0"},{"status":"affected","version":"2.0.0"},{"status":"affected","version":"2.0.0"},{"status":"affected","version":"2.0.0"},{"status":"affected","version":"2.0.0"},{"status":"affected","version":"2.0.0"},{"status":"affected","version":"2.0.0"},{"status":"affected","version":"2.0.0"},{"status":"affected","version":"2.0.0"}],"vendor":"nonebot","product":"nonebot","cpe":"cpe:2.3:a:nonebot:nonebot:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"2.0.1","status":"affected","fixed":"2.2.0"}],"ecosystem":"PyPI","package":"nonebot2","purl":"pkg:pypi/nonebot2","source":"pysec"}],"references":[{"url":"https://github.com/nonebot/nonebot2/security/advisories/GHSA-59j8-776v-xxxg","tags":["advisory","vendor-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/nonebot/nonebot2/pull/2509","tags":["fix","issue-tracking","patch","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-21624","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/nonebot/nonebot2/commit/b65b3b438c95894654fd9081139989c757bdc6c1","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/nonebot/nonebot2","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/nonebot2/PYSEC-2024-37.yaml","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-02-11T17:00:54.232Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-21624","url":"https://www.cve.org/CVERecord?id=CVE-2024-21624","licence":"CVE Terms of Use","modified":"2024-08-01T22:27:35.692Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-59j8-776v-xxxg","url":"https://github.com/advisories/GHSA-59j8-776v-xxxg","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:05.511Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-21624","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-21624","licence":"Public domain","modified":"2026-06-17T07:09:52.123Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2024-37","url":"https://osv.dev/vulnerability/PYSEC-2024-37","licence":"CC-BY-4.0","modified":"2024-02-16T16:41:43.954Z"}],"updatedAt":"2026-11-25T22:58:36.703Z","epss":{"score":0.00492,"percentile":0.43851,"date":"2026-12-01T12:00:22.000Z"}}