CVE-2021-21374
Nim vulnerability analysis and mitigation

Overview

Nimble, the package manager for the Nim programming language, contained a critical security vulnerability (CVE-2021-21374) where it failed to properly validate SSL/TLS certificates due to insecure httpClient defaults. The vulnerability was discovered in February 2021 and affected Nim versions prior to 1.4.4, with patches released in versions 1.2.10 and 1.4.4 (Consensys Diligence).

Technical details

The vulnerability stemmed from the httpClient component in Nim's standard library, which by default set up an insecure SSL/TLS context by specifying verifyMode = CVerifyNone. This configuration caused the library to trust all certificates by default as long as the CN/SAN matched the request host, without proper certificate validation. The issue particularly affected Nimble's package management functionality when fetching package metadata from GitHub (Consensys Diligence).

Impact

An attacker capable of performing a Man-in-the-Middle (MitM) attack could exploit this vulnerability to deliver modified package lists containing malicious software packages. If these compromised packages were installed and used, the attack could escalate to untrusted code execution on the target system (GitHub Advisory).

Mitigation and workarounds

The issue was addressed in Nim versions 1.2.10 and 1.4.4 by implementing proper certificate validation in the httpClient component. Users were advised to upgrade to these patched versions to protect against potential attacks (GitHub Advisory).

Community reactions

The vulnerability was initially reported by security researcher tintinweb and was assigned a CVSS score of 8.1 (High severity). The Nim development team responded by implementing fixes in both the 1.2.x and 1.4.x release branches (GitHub Advisory).

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