CVE-2021-46872
Nim vulnerability analysis and mitigation

Overview

An issue was discovered in Nim before version 1.6.2 (CVE-2021-46872). The RST module of the Nim language stdlib, as used in NimForum and other products, permits the javascript: URI scheme which can lead to Cross-Site Scripting (XSS) vulnerabilities in some applications. The vulnerability was fixed in Nim versions 1.6.2 and later, with potential backports to earlier versions. NimForum 2.2.0 also includes the fix (NVD).

Technical details

The vulnerability exists in the RST (reStructuredText) module of Nim's standard library, which failed to properly sanitize URI schemes in links and image targets. The issue allows the javascript: URI scheme to be processed, potentially enabling XSS attacks. The CVSS v3.1 Base Score is 6.1 (MEDIUM) with the vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N. The vulnerability is classified as CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-site Scripting) (NVD).

Impact

If exploited, this vulnerability could allow attackers to execute arbitrary JavaScript code in the context of the victim's browser through XSS attacks. This could potentially lead to theft of sensitive information, session hijacking, or other client-side attacks (NVD).

Mitigation and workarounds

The primary mitigation is to upgrade to Nim version 1.6.2 or later, which includes the fix for this vulnerability. For NimForum users, upgrading to version 2.2.0 or later is recommended. The fix involves implementing proper URI scheme validation that only allows safe protocols such as http, https, and ftp (Nim Commit).

Additional resources


SourceThis report was generated using AI

Related Nim vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2021-21372HIGH8.8
  • NimNim
  • nim
NoYesMar 26, 2021
CVE-2021-21374HIGH8.1
  • NimNim
  • nim
NoYesMar 26, 2021
CVE-2021-29495HIGH7.5
  • NimNim
  • nim
NoYesMay 07, 2021
CVE-2021-46872MEDIUM6.1
  • NimNim
  • nim
NoYesJan 13, 2023
CVE-2021-21373MEDIUM5.9
  • NimNim
  • nim
NoYesMar 26, 2021

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management