Skip to content
Heist/ feed
Back to feed
HighFix available

ujson — security advisory

Type: advisorySources: OSVAdvisory ID: DEBIAN-CVE-2022-31116

UltraJSON is a fast JSON encoder and decoder written in pure C with bindings for Python 3.7+. Affected versions were found to improperly decode certain characters. JSON strings that contain escaped surrogate characters not part of a proper surrogate pair were decoded incorrectly. Besides corrupting strings, this allowed for potential key confusion and value overwriting in dictionaries. All users parsing JSON from untrusted sources are vulnerable. From version 5.4.0, UltraJSON decodes lone surrogates in the same way as the standard library's `json` module does, preserving them in the parsed output. Users are advised to upgrade. There are no known workarounds for this issue.

Products
ujson
Affected versions
Not specified
Fixed versions
5.4.0-1
CVEs
CVE-2022-31116
Confirmed fixed CVEs
Not specified
Updated in this feed
30 Oct 2026, 14:44 UTC · Revision 1

Source evidence

DEBIAN-CVE-2022-31116

core-osv · Original source

Published 5 Jul 2022, 18:15 UTC

UltraJSON is a fast JSON encoder and decoder written in pure C with bindings for Python 3.7+. Affected versions were found to improperly decode certain characters. JSON strings that contain escaped surrogate characters not part of a proper surrogate pair were decoded incorrectly. Besides corrupting strings, this allowed for potential key confusion and value overwriting in dictionaries. All users parsing JSON from untrusted sources are vulnerable. From version 5.4.0, UltraJSON decodes lone surrogates in the same way as the standard library's `json` module does, preserving them in the parsed output. Users are advised to upgrade. There are no known workarounds for this issue.

osv:DEBIAN-CVE-2022-31116

ujson

Fixed versions: 5.4.0-1

ujson

Fixed versions: 5.4.0-1

ujson

Fixed versions: 5.4.0-1

Complete source record
{
  "id": "07d9b100c3ff27b1f78c9ee3d3630fa2281e64347732f434802145e85a8b4cc3",
  "url": "https://osv.dev/vulnerability/DEBIAN-CVE-2022-31116",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "DEBIAN-CVE-2022-31116",
    "summary": "UltraJSON is a fast JSON encoder and decoder written in pure C with bindings for Python 3.7+. Affected versions were found to improperly decode certain characters. JSON strings that contain escaped surrogate characters not part of a proper surrogate pair were decoded incorrectly. Besides corrupting strings, this allowed for potential key confusion and value overwriting in dictionaries. All users parsing JSON from untrusted sources are vulnerable. From version 5.4.0, UltraJSON decodes lone surrogates in the same way as the standard library's `json` module does, preserving them in the parsed output. Users are advised to upgrade. There are no known workarounds for this issue.",
    "evidence": "osv:DEBIAN-CVE-2022-31116",
    "products": [
      {
        "name": {
          "value": "ujson",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "5.4.0-1",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "ujson",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "5.4.0-1",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "ujson",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "5.4.0-1",
            "evidence": "/affected/2/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "high",
    "structured": {
      "id": "DEBIAN-CVE-2022-31116",
      "aliases": [
        "DEBIAN-CVE-2022-31116"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "5.4.0-1"
                }
              ]
            }
          ],
          "package": {
            "name": "ujson",
            "purl": "pkg:deb/debian/ujson?arch=source&distro=bookworm",
            "ecosystem": "Debian:12"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2022-31116.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "5.4.0-1"
                }
              ]
            }
          ],
          "package": {
            "name": "ujson",
            "purl": "pkg:deb/debian/ujson?arch=source&distro=trixie",
            "ecosystem": "Debian:13"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2022-31116.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "5.4.0-1"
                }
              ]
            }
          ],
          "package": {
            "name": "ujson",
            "purl": "pkg:deb/debian/ujson?arch=source&distro=forky",
            "ecosystem": "Debian:14"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2022-31116.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        }
      ],
      "modified": "2026-10-15T08:01:51.716103233Z",
      "provider": "osv",
      "upstream": [
        "CVE-2022-31116"
      ],
      "references": [
        "https://security-tracker.debian.org/tracker/CVE-2022-31116"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2022-31116",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 323178,
  "published_at": "2022-07-05T18:15:08.023+00:00"
}