Skip to content
Noroxi
CVE-2025-4516· NVD / CVE Program· CNA PSF

Use-after-free in "unicode_escape" decoder with error handler

There is an issue in CPython when using `bytes.decode("unicode_escape", error="ignore|replace")`. If you are not using the "unicode_escape" encoding or an error handler your usage is not affected. To work-around this issue you may stop using the error= handler and instead wrap the bytes.decode() call in a try-except catching the DecodeError.

MediumCVSS 5.9 · v4.0—No exploit Fix available
Published
May 15, 2025
Updated
Jul 31, 2026
EPSS
0.2% · 11th percentile
Follow this CVE

Sign in to follow · You’ll be notified if a followed record enters KEV, gets an exploit or is updated.

Report tools

JSON

Action score

23

Monitor

Low priority for now.

CVSS
23 / 40 · 5.9 / 10
CISA KEV
0 / 30 · Not listed
EPSS
0 / 30 · 0.2%

CISA SSVC decision

Exploitation
none
Automatable
no
Technical impact
partial

Vulnrichment: CISA's decision-tree inputs.

CNA vs NVD score

NVD
—
CNA · PSF
5.9
NVD has not scored this yet; the score shown is the CNA’s.

CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

The score given by the assigning authority versus NVD’s independent score. A gap means the severity is contested.

Noroxi analysis

No Noroxi analysis for this record yet

We don't hand-write analysis for the hundreds of thousands of vulnerabilities in the database; that wouldn't be honest. For notable, high-impact vulnerabilities our team writes the mechanism, detection and remediation steps.

We use this product, ask for help

Affected systems

—

Versions reported by the vendor

Affected version ranges reported by the assigning authority (PSF). Independent of NVD's CPE analysis and usually ahead of it.

  • Python Software Foundation CPython

    • before 3.9.23affected · python
    • 3.10.0 and later · before 3.10.18affected · python
    • 3.11.0 and later · before 3.11.13affected · python
    • 3.12.0 and later · before 3.12.11affected · python
    • 3.13.0 and later · before 3.13.4affected · python
    • 3.14.0a1 and later · before 3.14.0b2affected · python

Package-level exposure

OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.

EcosystemPackageAffected rangeFix
AlmaLinux:8python39before 3.9.25-2.module_el8.10.0+4083+53cad1fb3.9.25-2.module_el8.10.0+4083+53cad1fb
AlmaLinux:8python39-attrsbefore 20.3.0-2.module_el8.6.0+2780+a40f65e120.3.0-2.module_el8.6.0+2780+a40f65e1
AlmaLinux:8python39-cffibefore 1.14.3-2.module_el8.6.0+2780+a40f65e11.14.3-2.module_el8.6.0+2780+a40f65e1
AlmaLinux:8python39-cffibefore 1.14.3-2.module_el8.6.0+3248+c431e88c1.14.3-2.module_el8.6.0+3248+c431e88c
AlmaLinux:8python39-chardetbefore 3.0.4-19.module_el8.6.0+2780+a40f65e13.0.4-19.module_el8.6.0+2780+a40f65e1
AlmaLinux:8python39-cryptographybefore 3.3.1-3.module_el8.10.0+3765+2f9a457d3.3.1-3.module_el8.10.0+3765+2f9a457d
AlmaLinux:8python39-Cythonbefore 0.29.21-5.module_el8.6.0+2780+a40f65e10.29.21-5.module_el8.6.0+2780+a40f65e1
AlmaLinux:8python39-Cythonbefore 0.29.21-5.module_el8.6.0+3248+c431e88c0.29.21-5.module_el8.6.0+3248+c431e88c
AlmaLinux:8python39-debugbefore 3.9.25-2.module_el8.10.0+4083+53cad1fb3.9.25-2.module_el8.10.0+4083+53cad1fb
AlmaLinux:8python39-develbefore 3.9.25-2.module_el8.10.0+4083+53cad1fb3.9.25-2.module_el8.10.0+4083+53cad1fb
AlmaLinux:8python39-idlebefore 3.9.25-2.module_el8.10.0+4083+53cad1fb3.9.25-2.module_el8.10.0+4083+53cad1fb
AlmaLinux:8python39-idnabefore 2.10-4.module_el8.10.0+3849+a48d89aa2.10-4.module_el8.10.0+3849+a48d89aa
AlmaLinux:8python39-iniconfigbefore 1.1.1-2.module_el8.6.0+2780+a40f65e11.1.1-2.module_el8.6.0+2780+a40f65e1
AlmaLinux:8python39-libsbefore 3.9.25-2.module_el8.10.0+4083+53cad1fb3.9.25-2.module_el8.10.0+4083+53cad1fb
AlmaLinux:8python39-lxmlbefore 4.6.5-1.module_el8.6.0+3248+c431e88c4.6.5-1.module_el8.6.0+3248+c431e88c
AlmaLinux:8python39-lxmlbefore 4.6.5-1.module_el8.6.0+2780+a40f65e14.6.5-1.module_el8.6.0+2780+a40f65e1
AlmaLinux:8python39-mod_wsgibefore 4.7.1-7.module_el8.10.0+3989+a618fe15.14.7.1-7.module_el8.10.0+3989+a618fe15.1
AlmaLinux:8python39-more-itertoolsbefore 8.5.0-2.module_el8.6.0+2780+a40f65e18.5.0-2.module_el8.6.0+2780+a40f65e1
AlmaLinux:8python39-numpybefore 1.19.4-3.module_el8.6.0+2780+a40f65e11.19.4-3.module_el8.6.0+2780+a40f65e1
AlmaLinux:8python39-numpybefore 1.19.4-3.module_el8.6.0+3248+c431e88c1.19.4-3.module_el8.6.0+3248+c431e88c
AlmaLinux:8python39-numpy-docbefore 1.19.4-3.module_el8.6.0+2780+a40f65e11.19.4-3.module_el8.6.0+2780+a40f65e1
AlmaLinux:8python39-numpy-f2pybefore 1.19.4-3.module_el8.6.0+3248+c431e88c1.19.4-3.module_el8.6.0+3248+c431e88c
AlmaLinux:8python39-numpy-f2pybefore 1.19.4-3.module_el8.6.0+2780+a40f65e11.19.4-3.module_el8.6.0+2780+a40f65e1
AlmaLinux:8python39-packagingbefore 20.4-4.module_el8.6.0+2780+a40f65e120.4-4.module_el8.6.0+2780+a40f65e1

+96

Other highest-scoring records for the same primary product.

  • CVE-2025-4517Arbitrary writes via tarfile realpath overflow
    37Monitor
  • CVE-2026-19445Use-after-free of a server-side SSLContext when sni_callback switches contexts
    36Monitor
  • CVE-2026-6100Use-after-free in lzma.LZMADecompressor, bz2.BZ2Decompressor, and gzip.GzipFile after re-use under memory pressure
    36Monitor
  • CVE-2026-3298Out-of-bounds write in Windows asyncio.ProacterEventLoop.sock_recvfrom_into() when using nbytes
    35Monitor
  • CVE-2024-12254Unbounded memory buffering in SelectorSocketTransport.writelines()
    35Monitor
  • CVE-2024-8088Infinite loop when iterating over zip archive entry names from zipfile.Path
    34Monitor

Remediation

Which version to upgrade to

Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.

Product / packageFixed versionSource
Python Software Foundation CPython3.10.18Vendor (CNA)
Python Software Foundation CPython3.11.13Vendor (CNA)
Python Software Foundation CPython3.12.11Vendor (CNA)
Python Software Foundation CPython3.13.4Vendor (CNA)
Python Software Foundation CPython3.14.0b2Vendor (CNA)
Python Software Foundation CPython3.9.23Vendor (CNA)
almalinux:python393.9.25-2.module_el8.10.0+4083+53cad1fb · AlmaLinux:8Package registry (OSV)
almalinux:python39-attrs20.3.0-2.module_el8.6.0+2780+a40f65e1 · AlmaLinux:8Package registry (OSV)
almalinux:python39-cffi1.14.3-2.module_el8.6.0+2780+a40f65e1 · AlmaLinux:8Package registry (OSV)
almalinux:python39-chardet3.0.4-19.module_el8.6.0+2780+a40f65e1 · AlmaLinux:8Package registry (OSV)
almalinux:python39-cryptography3.3.1-3.module_el8.10.0+3765+2f9a457d · AlmaLinux:8Package registry (OSV)
almalinux:python39-Cython0.29.21-5.module_el8.6.0+2780+a40f65e1 · AlmaLinux:8Package registry (OSV)
almalinux:python39-debug3.9.25-2.module_el8.10.0+4083+53cad1fb · AlmaLinux:8Package registry (OSV)
almalinux:python39-devel3.9.25-2.module_el8.10.0+4083+53cad1fb · AlmaLinux:8Package registry (OSV)
almalinux:python39-idle3.9.25-2.module_el8.10.0+4083+53cad1fb · AlmaLinux:8Package registry (OSV)
almalinux:python39-idna2.10-4.module_el8.10.0+3849+a48d89aa · AlmaLinux:8Package registry (OSV)
almalinux:python39-iniconfig1.1.1-2.module_el8.6.0+2780+a40f65e1 · AlmaLinux:8Package registry (OSV)
almalinux:python39-PyMySQL0.10.1-2.module_el8.6.0+2780+a40f65e1 · AlmaLinux:8Package registry (OSV)
alpine:python33.11.12-r1 · Alpine:v3.18Package registry (OSV)
debian:python3.113.11.2-6+deb12u7 · Debian:12Package registry (OSV)
debian:python3.133.13.3-4 · Debian:13Package registry (OSV)
debian:python3.93.9.2-1+deb11u4 · Debian:11Package registry (OSV)
opensuse:python3103.10.18-150400.4.82.1 · openSUSE:Leap 15.6Package registry (OSV)
opensuse:python310-core3.10.18-150400.4.82.1 · openSUSE:Leap 15.6Package registry (OSV)
opensuse:python310-documentation3.10.18-150400.4.82.1 · openSUSE:Leap 15.6Package registry (OSV)
opensuse:python3123.12.11-150600.3.30.1 · openSUSE:Leap 15.6Package registry (OSV)
opensuse:python312-core3.12.11-150600.3.30.1 · openSUSE:Leap 15.6Package registry (OSV)
opensuse:python312-documentation3.12.11-150600.3.30.1 · openSUSE:Leap 15.6Package registry (OSV)
red hat:mod_wsgi0:4.7.1-7.module+el8.10.0+23075+0aa18782.1 · Red Hat:enterprise_linux:8::appstreamPackage registry (OSV)
red hat:numpy0:1.19.4-3.module+el8.9.0+19644+d68f775d · Red Hat:enterprise_linux:8::appstreamPackage registry (OSV)

+30

Exploit status

No known public exploit

No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.

Research context

For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.

Timeline

From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.

No dated events beyond publication.

EPSS, last 120 days

FIRST EPSS daily score; only changes of 0.01 or more are recorded (step chart).

Patch and commit links

Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.

Finders, reporters and analysts named in the CNA record. Click a name for that researcher’s other records.

No credits in the CNA record.

Variant candidates

Same product, same weakness class, within 18 months. If the patch missed the root cause, the sibling bug is here.

  • CVE-2026-6100333 days apartUse-after-free in lzma.LZMADecompressor, bz2.BZ2Decompressor, and gzip.GzipFile after re-use under memory pressure
    36Monitor
  • CVE-2026-19445503 days apartUse-after-free of a server-side SSLContext when sni_callback switches contexts
    36Monitor

Chain candidates

An authentication bypass and a privilege-requiring bug in the same product, published close together: combined they may become an unauthenticated path.

—

Bug bounty scope

No known public program.

Source: bounty-targets-data (public HackerOne, Bugcrowd, Intigriti, YesWeHack listings).

Technical details

Attack conditions

  • Someone with local access to the system can trigger it.
  • No account or password is required.
  • No user action is required.
  • Special conditions such as timing or configuration are required.

If successful

Confidentiality
Integrity
Availability
Attack vector
Local
Attack complexity
High
Privileges required
None
User interaction
None
Scope
X

Weakness class (CWE)

CWE-416 · Use After Free

CVSS vector

CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

nvd-secondary

Root cause

After a memory region is freed, another reference pointing to it is still used. By then, the same region may have been allocated for different data.

A representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.

Vulnerable

c
free(dev->buf);/* ... another thread is still running ... */process(dev->buf);

Fixed

c
lock(&dev->lock);free(dev->buf);dev->buf = NULL;unlock(&dev->lock);

Attack context

MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.

MITRE has no CAPEC/ATT&CK mapping for this CWE.

Change log

  1. Fix✗ → ✓

For records you follow, these changes also arrive as notifications. →

References

All records