Skip to content
Heist/ feed
Back to feed
Medium

nim — security advisory

Type: advisorySources: OSVAdvisory ID: UBUNTU-CVE-2021-46872

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

Products
nim
Affected versions
0.11.2+dfsg1-4, 0.12.0-2, 0.17.2-1ubuntu1, 0.17.2-1ubuntu2, 0.20.2-1, 1.0.2-1, 1.0.3~rc-1, 1.0.4-1, 1.0.6-1, 1.6.14-1, 1.6.14-1ubuntu1, 1.6.14-1ubuntu2, 2.2.10-1, 2.2.4-1, 2.2.4-2
Fixed versions
Not specified
CVEs
CVE-2021-46872
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 00:55 UTC · Revision 1

Source evidence

UBUNTU-CVE-2021-46872

core-osv · Original source

Published 13 Jan 2023, 06:15 UTC

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

osv:UBUNTU-CVE-2021-46872

nim

Fixed versions: Not specified

nim

Fixed versions: Not specified

nim

Fixed versions: Not specified

nim

Fixed versions: Not specified

nim

Fixed versions: Not specified

nim

Fixed versions: Not specified

nim

Fixed versions: Not specified

Complete source record
{
  "id": "03c70080970823bb02671fb1143d18f90b363905e435d6da1db7d8cdc2f5f1da",
  "url": "https://osv.dev/vulnerability/UBUNTU-CVE-2021-46872",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "UBUNTU-CVE-2021-46872",
    "summary": "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.)",
    "evidence": "osv:UBUNTU-CVE-2021-46872",
    "products": [
      {
        "name": {
          "value": "nim",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "0.11.2+dfsg1-4",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "0.12.0-2",
            "evidence": "/affected/0/versions"
          }
        ]
      },
      {
        "name": {
          "value": "nim",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "0.17.2-1ubuntu1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "0.17.2-1ubuntu2",
            "evidence": "/affected/1/versions"
          }
        ]
      },
      {
        "name": {
          "value": "nim",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "0.20.2-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.0.2-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.0.3~rc-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.0.4-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.0.6-1",
            "evidence": "/affected/2/versions"
          }
        ]
      },
      {
        "name": {
          "value": "nim",
          "evidence": "/affected/3/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.6.14-1",
            "evidence": "/affected/3/versions"
          },
          {
            "value": "1.6.14-1ubuntu1",
            "evidence": "/affected/3/versions"
          },
          {
            "value": "1.6.14-1ubuntu2",
            "evidence": "/affected/3/versions"
          }
        ]
      },
      {
        "name": {
          "value": "nim",
          "evidence": "/affected/4/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.6.14-1ubuntu2",
            "evidence": "/affected/4/versions"
          },
          {
            "value": "2.2.4-1",
            "evidence": "/affected/4/versions"
          }
        ]
      },
      {
        "name": {
          "value": "nim",
          "evidence": "/affected/5/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2.2.4-2",
            "evidence": "/affected/5/versions"
          },
          {
            "value": "2.2.10-1",
            "evidence": "/affected/5/versions"
          }
        ]
      },
      {
        "name": {
          "value": "nim",
          "evidence": "/affected/6/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "2.2.4-1",
            "evidence": "/affected/6/versions"
          },
          {
            "value": "2.2.4-2",
            "evidence": "/affected/6/versions"
          }
        ]
      }
    ],
    "severity": "medium",
    "structured": {
      "id": "UBUNTU-CVE-2021-46872",
      "aliases": [
        "UBUNTU-CVE-2021-46872"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
        },
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
        },
        {
          "type": "Ubuntu",
          "score": "medium"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "nim",
            "purl": "pkg:deb/ubuntu/nim?arch=source&distro=xenial",
            "ecosystem": "Ubuntu:16.04:LTS"
          },
          "versions": [
            "0.11.2+dfsg1-4",
            "0.12.0-2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-46872.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "nim",
                "binary_version": "0.12.0-2"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "nim",
            "purl": "pkg:deb/ubuntu/nim?arch=source&distro=bionic",
            "ecosystem": "Ubuntu:18.04:LTS"
          },
          "versions": [
            "0.17.2-1ubuntu1",
            "0.17.2-1ubuntu2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-46872.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "nim",
                "binary_version": "0.17.2-1ubuntu2"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "nim",
            "purl": "pkg:deb/ubuntu/nim?arch=source&distro=focal",
            "ecosystem": "Ubuntu:20.04:LTS"
          },
          "versions": [
            "0.20.2-1",
            "1.0.2-1",
            "1.0.3~rc-1",
            "1.0.4-1",
            "1.0.6-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-46872.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "nim",
                "binary_version": "1.0.6-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "nim",
            "purl": "pkg:deb/ubuntu/nim?arch=source&distro=noble",
            "ecosystem": "Ubuntu:24.04:LTS"
          },
          "versions": [
            "1.6.14-1",
            "1.6.14-1ubuntu1",
            "1.6.14-1ubuntu2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-46872.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "nim",
                "binary_version": "1.6.14-1ubuntu2"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "nim",
            "purl": "pkg:deb/ubuntu/nim?arch=source&distro=questing",
            "ecosystem": "Ubuntu:25.10"
          },
          "versions": [
            "1.6.14-1ubuntu2",
            "2.2.4-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-46872.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "nim",
                "binary_version": "2.2.4-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "nim",
            "purl": "pkg:deb/ubuntu/nim?arch=source&distro=stonking",
            "ecosystem": "Ubuntu:26.10"
          },
          "versions": [
            "2.2.4-2",
            "2.2.10-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-46872.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "nim",
                "binary_version": "2.2.10-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "nim",
            "purl": "pkg:deb/ubuntu/nim?arch=source&distro=resolute",
            "ecosystem": "Ubuntu:26.04:LTS"
          },
          "versions": [
            "2.2.4-1",
            "2.2.4-2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-46872.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "nim",
                "binary_version": "2.2.4-2"
              }
            ]
          }
        }
      ],
      "modified": "2026-10-17T12:56:16.244034562Z",
      "provider": "osv",
      "upstream": [
        "CVE-2021-46872"
      ],
      "references": [
        "https://ubuntu.com/security/CVE-2021-46872",
        "https://forum.nim-lang.org/t/8852",
        "https://github.com/nim-lang/Nim/pull/19134",
        "https://github.com/nim-lang/Nim/compare/v1.6.0...v1.6.2",
        "https://github.com/nim-lang/nimforum",
        "https://github.com/nim-lang/Nim/commit/46275126b89218e64844eee169e8ced05dd0e2d7",
        "https://www.cve.org/CVERecord?id=CVE-2021-46872"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2021-46872",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 355099,
  "published_at": "2023-01-13T06:15:00+00:00"
}