CVE-2024-21624
JSON

5.7medium

Potential Information Leak in User-Constructed Message Templates in nonebot2

Severity
5.7medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.49% (higher than 43% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-59j8-776v-xxxgPYSEC-2024-37

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

Product or packageVersionsReported by
nonebot nonebot2>= 2.0.0a16, < 2.2.0CVE List
nonebot2 (PyPI)from 2.0.0a16 before 2.2.0, from 2.0.1 before 2.2.0GitHub Advisory Database, PyPA Advisory Database
nonebot nonebotfrom 2.0.1 before 2.2.0, 2.0.0NVD

All scores

GitHub_M5.7medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N
GitHub5.7medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N
NVD6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N
PyPA Advisory Database6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N

Classification

CWE-200CWE-1336

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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.

GitHub Advisory Database
Impact

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.

Patches

The 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.

Workarounds

A temporary workaround involves filtering underscores before incorporating user input into the message template.

References
NVD (es)

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.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-21624 changed 2024-08-01CVE Terms of Use
GitHub Advisory DatabaseGHSA-59j8-776v-xxxg changed 2026-09-10CC-BY-4.0
NVDCVE-2024-21624 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2024-37 changed 2024-02-16CC-BY-4.0