What’s Vulnerable › Vulnerabilities
CVE-2024-21624: Potential Information Leak in User-Constructed Message Templates in nonebot2
- Severity: medium (CVSS 6.5 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.5% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2024-02-09 · updated 2026-06-17
- Weakness: CWE-200
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.
Affected products
- nonebot2: from 2.0.1 before 2.2.0; 2.0.0, 2.0.0-alpha16, 2.0.0-beta1, 2.0.0-beta2, 2.0.0-beta3, 2.0.0-beta4 (+5) — fixed in 2.2.0
How to fix
Upgrade to a fixed version: nonebot2 2.2.0. Check the vendor advisory for mitigations.
References
- https://github.com/nonebot/nonebot2/pull/2509
- https://github.com/nonebot/nonebot2/security/advisories/GHSA-59j8-776v-xxxg
- https://github.com/nonebot/nonebot2/pull/2509
- https://github.com/nonebot/nonebot2/security/advisories/GHSA-59j8-776v-xxxg
Get alerted when CVE-2024-21624 or the next vulnerability affects your stack