Skip to content
Heist/ feed
Back to feed
Medium

Security advisory

Type: advisorySources: OSVCVE: CVE-2021-45958

UltraJSON (aka ujson) through 5.1.0 has a stack-based buffer overflow in Buffer_AppendIndentUnchecked (called from encode). Exploitation can, for example, use a large amount of indentation.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2021-45958
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 11:23 UTC · Revision 1

Source evidence

CVE-2021-45958

core-osv · Original source

Published 1 Jan 2022, 00:15 UTC

UltraJSON (aka ujson) through 5.1.0 has a stack-based buffer overflow in Buffer_AppendIndentUnchecked (called from encode). Exploitation can, for example, use a large amount of indentation.

osv:CVE-2021-45958
Complete source record
{
  "id": "a873512f535554653ac2b11b96a678e92da7e4c6602991bd5d5ab58e0e68fef7",
  "url": "https://osv.dev/vulnerability/CVE-2021-45958",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2021-45958",
    "summary": "UltraJSON (aka ujson) through 5.1.0 has a stack-based buffer overflow in Buffer_AppendIndentUnchecked (called from encode). Exploitation can, for example, use a large amount of indentation.",
    "evidence": "osv:CVE-2021-45958",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2021-45958",
      "aliases": [
        "CVE-2021-45958",
        "GHSA-fh56-85cw-5pq6",
        "PYSEC-2022-25"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/ultrajson/ultrajson",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "f6860f1f3d8d4e92b9be0e5815355a8976c6e75b"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:ultrajson_project:ultrajson:*:*:*:*:*:python:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "5.2.0"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "versions": [
            "5.1.0",
            "5.0.0",
            "4.3.0",
            "4.2.0",
            "4.1.0",
            "4.0.2",
            "4.0.1",
            "4.0.0",
            "3.2.0",
            "3.1.0",
            "3.0.0",
            "2.0.3",
            "2.0.2",
            "2.0.1",
            "2.0.0",
            "v1.35",
            "v1.34"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-45958.json"
          }
        }
      ],
      "modified": "2026-10-20T10:54:12.656501752Z",
      "provider": "osv",
      "references": [
        "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CN7W3GOXALINKFUUE7ICQIC2EF5HNKUQ/",
        "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NAU5N4A7EUK2AMUCOLYDD5ARXAJYZBD2/",
        "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/O6JUWQTJLA2CMG4CJN7DCUVSOXLZIIXL/",
        "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ULX35TSWLBBIMEH44MUORPXYYRZKEDC6/",
        "https://lists.debian.org/debian-lts-announce/2022/02/msg00023.html",
        "https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=36009",
        "https://github.com/ultrajson/ultrajson/issues/501",
        "https://github.com/ultrajson/ultrajson/issues/502#issuecomment-1031747284",
        "https://github.com/ultrajson/ultrajson/pull/504",
        "https://github.com/google/oss-fuzz-vulns/blob/main/vulns/ujson/OSV-2021-955.yaml"
      ],
      "provider_metadata": {
        "unresolved_ranges": [
          {
            "cpes": [
              "cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*"
            ],
            "vendor_product": "debian:debian_linux",
            "extracted_events": [
              {
                "range": [
                  {
                    "introduced": "9.0"
                  },
                  {
                    "last_affected": "9.0"
                  }
                ],
                "source": "CPE_STRING"
              }
            ]
          },
          {
            "cpes": [
              "cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*",
              "cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*",
              "cpe:2.3:o:fedoraproject:fedora:37:*:*:*:*:*:*:*"
            ],
            "vendor_product": "fedoraproject:fedora",
            "extracted_events": [
              {
                "range": [
                  {
                    "introduced": "35"
                  },
                  {
                    "last_affected": "35"
                  },
                  {
                    "introduced": "36"
                  },
                  {
                    "last_affected": "36"
                  },
                  {
                    "introduced": "37"
                  },
                  {
                    "last_affected": "37"
                  }
                ],
                "source": "CPE_STRING"
              }
            ]
          }
        ]
      }
    },
    "related_cves": [
      {
        "value": "CVE-2021-45958",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 384948,
  "published_at": "2022-01-01T00:15:08.813+00:00"
}