What’s Vulnerable › Vulnerabilities
CVE-2021-46872
- Severity: medium (CVSS 6.1 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.6% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2023-01-13 · updated 2026-06-17
- Weakness: CWE-79
Description
An issue was discovered in Nim before 1.6.2. The RST module of the Nim language stdlib, as used in NimForum and other products, permits the javascript: URI scheme and thus can lead to XSS in some applications. (Nim versions 1.6.2 and later are fixed; there may be backports of the fix to some earlier versions. NimForum 2.2.0 is fixed.)
Affected products
- nim-lang Nim: before 1.6.2 — fixed in 1.6.2
- nim-lang Nimforum: before 2.2.0 — fixed in 2.2.0
How to fix
Upgrade to a fixed version: nim-lang Nim 1.6.2; nim-lang Nimforum 2.2.0. Check the vendor advisory for mitigations.
References
- https://forum.nim-lang.org/t/8852
- https://github.com/nim-lang/Nim/commit/46275126b89218e64844eee169e8ced05dd0e2d7
- https://github.com/nim-lang/Nim/compare/v1.6.0...v1.6.2
- https://github.com/nim-lang/Nim/pull/19134
- https://github.com/nim-lang/nimforum
- https://forum.nim-lang.org/t/8852
- https://github.com/nim-lang/Nim/commit/46275126b89218e64844eee169e8ced05dd0e2d7
- https://github.com/nim-lang/Nim/compare/v1.6.0...v1.6.2
- https://github.com/nim-lang/Nim/pull/19134
- https://github.com/nim-lang/nimforum
Get alerted when CVE-2021-46872 or the next vulnerability affects your stack