# CVE-2024-21624: Potential Information Leak in User-Constructed Message Templates in nonebot2

- Severity: Medium 5.7 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.49%, higher than 43% of CVEs (2026-12-01)
- Published: 2024-02-09T15:04:08.000Z
- Modified: 2026-09-10T03:50:05.511Z
- Also known as: GHSA-59j8-776v-xxxg, PYSEC-2024-37
- Weaknesses: CWE-200, CWE-1336
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- nonebot nonebot2: >= 2.0.0a16, < 2.2.0
- nonebot2 (PyPI): from 2.0.0a16 before 2.2.0; from 2.0.1 before 2.2.0
- nonebot nonebot: from 2.0.1 before 2.2.0; 2.0.0

## Every score

- GitHub_M: CVSS:3.1 5.7 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N`
- GitHub: CVSS:3.1 5.7 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N`
- NVD: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N`
- PyPA Advisory Database: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N`

## References

- <https://github.com/nonebot/nonebot2/security/advisories/GHSA-59j8-776v-xxxg> (advisory, vendor-advisory, web)
- <https://github.com/nonebot/nonebot2/pull/2509> (fix, issue-tracking, patch, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-21624> (advisory)
- <https://github.com/nonebot/nonebot2/commit/b65b3b438c95894654fd9081139989c757bdc6c1> (web)
- <https://github.com/nonebot/nonebot2> (package)
- <https://github.com/pypa/advisory-database/tree/main/vulns/nonebot2/PYSEC-2024-37.yaml> (web)

## Sources

- CVE List: [CVE-2024-21624](https://www.cve.org/CVERecord?id=CVE-2024-21624), CVE Terms of Use, modified 2024-08-01
- GitHub Advisory Database: [GHSA-59j8-776v-xxxg](https://github.com/advisories/GHSA-59j8-776v-xxxg), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2024-21624](https://nvd.nist.gov/vuln/detail/CVE-2024-21624), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2024-37](https://osv.dev/vulnerability/PYSEC-2024-37), CC-BY-4.0, modified 2024-02-16

---

Page: https://cve.day/CVE-2024-21624 · Whole record: https://cve.day/CVE-2024-21624.json · Rebuilt by cve.day 2026-11-25T22:58:36.703Z
