---
id: CVE-2022-31117
aliases:
  - GHSA-fm67-cv37-96ff
  - PYSEC-2026-1056
title: Potential double free of buffer during string decoding
summary: Potential double free of buffer during string decoding
severity: medium
cvss: 5.9
cvssVector: 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H'
vendor: ujson
product: ujson
ecosystem: pip
affected:
  - ujson < 5.4.0
patched:
  - ujson 5.4.0
published: '2022-07-05'
updated: '2026-07-07'
source: OSV
sourceUrl: 'https://osv.dev/vulnerability/GHSA-fm67-cv37-96ff'
references:
  - url: >-
      https://github.com/ultrajson/ultrajson/security/advisories/GHSA-fm67-cv37-96ff
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2022-31117'
  - url: >-
      https://github.com/ultrajson/ultrajson/commit/9c20de0f77b391093967e25d01fb48671104b15b
  - url: 'https://github.com/ultrajson/ultrajson'
  - url: >-
      https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NAU5N4A7EUK2AMUCOLYDD5ARXAJYZBD2
  - url: >-
      https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/OPPU5FZP3LCTXYORFH7NHUMYA5X66IA7
tags:
  - osv
  - pip
epss: 0.01876
epssPercentile: 0.78563
ingestedAt: '2026-07-08T18:25:48.935Z'
---

## Overview

### Impact
_What kind of vulnerability is it? Who is impacted?_

When an error occurs while reallocating the buffer for string decoding, the buffer gets freed twice.

Due to how UltraJSON uses the internal decoder, this double free is impossible to trigger from Python.

### Patches
_Has the problem been patched? What versions should users upgrade to?_

Users should upgrade to UltraJSON 5.4.0.

### Workarounds
_Is there a way for users to fix or remediate the vulnerability without upgrading?_

There is no workaround.

### For more information
If you have any questions or comments about this advisory:
* Open an issue in [UltraJSON](http://github.com/ultrajson/ultrajson/issues)


## Affected packages

- `ujson < 5.4.0`

## Remediation

Upgrade to a patched release:

- `ujson 5.4.0`
