Cloudanix VulnDB

CVE-2025-4516

None

CVSS

—

EPSS

0.2%

Published

May 15, 2025

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

A flaw in Python can make programs crash when they try to read certain kinds of text data, potentially stopping important software from working until fixed.

Exploitation
Local Privilege
Attacker needs
Local User
Complexity
High
Impact
Denial Of Service
Component
Library
Class
Improper Input Validation
Remediation
Workaround Only
Effort
Low
Patch risk
Other

What it actually does

Improper input validation in CPython's bytes.decode when using the unicode_escape codec with ignore or replace error handlers can raise an unexpected DecodeError, leading to application crashes and denial of service.

Why it matters to the business

Python-based applications may crash unexpectedly when handling certain inputs, causing service outages, lost productivity, and the need for emergency code reviews or restarts in environments relying on this decoding pattern.

How an attack unfolds

An attacker identifies Python code paths that call bytes.decode with unicode_escape and an error handler, then supplies specially crafted byte input that triggers the decoder flaw, resulting in an uncaught DecodeError that terminates the process.

How to fix it

Upgrade python/cpython to the fixed commit 4398b788ffc1f954a2c552da285477d42a571292 or later. As an immediate mitigation, replace direct use of the error= handler with a try-except block that catches DecodeError around the decode call.

How to confirm the fix worked

Confirm the installed CPython commit or version includes 4398b788ffc1f954a2c552da285477d42a571292; test the specific bytes.decode call with unicode_escape and error handlers to verify it no longer raises DecodeError on previously triggering inputs.

Typical attack path

  1. Locate Python applications or libraries using bytes.decode("unicode_escape", errors=...) patterns
  2. Craft input bytes designed to provoke the decoder error condition
  3. Deliver the input through application interfaces such as file uploads, network requests, or command arguments
  4. Trigger the decode operation to raise DecodeError and crash the process if unhandled

How to detect it

Review application and system logs for unhandled DecodeError exceptions occurring during unicode_escape decoding operations; search source code repositories for direct calls to bytes.decode with unicode_escape and error handlers.

What your security team should do

  • Immediately audit all codebases for bytes.decode calls using unicode_escape with error handlers and apply try-except wrapping
  • Prioritize upgrading affected CPython installations to the commit 4398b788ffc1f954a2c552da285477d42a571292
  • Add static analysis or linting rules to flag use of the vulnerable decode pattern
  • Monitor application logs for unexpected DecodeError occurrences tied to text decoding

The record

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.

Affected packages

Ecosystem Package Introduced Fixed
AlmaLinux:8 python39 0 3.9.25-2.module_el8.10.0+4083+53cad1fb
AlmaLinux:8 python39-Cython 0 0.29.21-5.module_el8.6.0+2780+a40f65e1
AlmaLinux:8 python39-Cython 0 0.29.21-5.module_el8.6.0+3248+c431e88c
AlmaLinux:8 python39-PyMySQL 0 0.10.1-2.module_el8.6.0+2780+a40f65e1
AlmaLinux:8 python39-attrs 0 20.3.0-2.module_el8.6.0+2780+a40f65e1
AlmaLinux:8 python39-cffi 0 1.14.3-2.module_el8.6.0+2780+a40f65e1
AlmaLinux:8 python39-cffi 0 1.14.3-2.module_el8.6.0+3248+c431e88c
AlmaLinux:8 python39-chardet 0 3.0.4-19.module_el8.6.0+2780+a40f65e1
AlmaLinux:8 python39-cryptography 0 3.3.1-3.module_el8.10.0+3765+2f9a457d
AlmaLinux:8 python39-debug 0 3.9.25-2.module_el8.10.0+4083+53cad1fb
AlmaLinux:8 python39-devel 0 3.9.25-2.module_el8.10.0+4083+53cad1fb
AlmaLinux:8 python39-idle 0 3.9.25-2.module_el8.10.0+4083+53cad1fb
AlmaLinux:8 python39-idna 0 2.10-4.module_el8.10.0+3849+a48d89aa
AlmaLinux:8 python39-iniconfig 0 1.1.1-2.module_el8.6.0+2780+a40f65e1
AlmaLinux:8 python39-libs 0 3.9.25-2.module_el8.10.0+4083+53cad1fb
AlmaLinux:8 python39-lxml 0 4.6.5-1.module_el8.6.0+2780+a40f65e1
AlmaLinux:8 python39-lxml 0 4.6.5-1.module_el8.6.0+3248+c431e88c
AlmaLinux:8 python39-mod_wsgi 0 4.7.1-7.module_el8.10.0+3989+a618fe15.1
AlmaLinux:8 python39-more-itertools 0 8.5.0-2.module_el8.6.0+2780+a40f65e1
AlmaLinux:8 python39-numpy 0 1.19.4-3.module_el8.6.0+2780+a40f65e1
AlmaLinux:8 python39-numpy 0 1.19.4-3.module_el8.6.0+3248+c431e88c
AlmaLinux:8 python39-numpy-doc 0 1.19.4-3.module_el8.6.0+2780+a40f65e1
AlmaLinux:8 python39-numpy-f2py 0 1.19.4-3.module_el8.6.0+2780+a40f65e1
AlmaLinux:8 python39-numpy-f2py 0 1.19.4-3.module_el8.6.0+3248+c431e88c
AlmaLinux:8 python39-packaging 0 20.4-4.module_el8.6.0+2780+a40f65e1
AlmaLinux:8 python39-pip 0 20.2.4-9.module_el8.10.0+3765+2f9a457d
AlmaLinux:8 python39-pip-wheel 0 20.2.4-9.module_el8.10.0+3765+2f9a457d
AlmaLinux:8 python39-pluggy 0 0.13.1-3.module_el8.6.0+2780+a40f65e1
AlmaLinux:8 python39-ply 0 3.11-10.module_el8.6.0+2780+a40f65e1
AlmaLinux:8 python39-psutil 0 5.8.0-4.module_el8.6.0+2780+a40f65e1
AlmaLinux:8 python39-psutil 0 5.8.0-4.module_el8.6.0+3248+c431e88c
AlmaLinux:8 python39-psycopg2 0 2.8.6-3.module_el8.10.0+3765+2f9a457d
AlmaLinux:8 python39-psycopg2-doc 0 2.8.6-3.module_el8.10.0+3765+2f9a457d
AlmaLinux:8 python39-psycopg2-tests 0 2.8.6-3.module_el8.10.0+3765+2f9a457d
AlmaLinux:8 python39-py 0 1.10.0-1.module_el8.6.0+2780+a40f65e1
AlmaLinux:8 python39-pybind11 0 2.7.1-1.module_el8.6.0+2780+a40f65e1
AlmaLinux:8 python39-pybind11 0 2.7.1-1.module_el8.6.0+3248+c431e88c
AlmaLinux:8 python39-pybind11-devel 0 2.7.1-1.module_el8.6.0+2780+a40f65e1
AlmaLinux:8 python39-pybind11-devel 0 2.7.1-1.module_el8.6.0+3248+c431e88c
AlmaLinux:8 python39-pycparser 0 2.20-3.module_el8.6.0+2780+a40f65e1
AlmaLinux:8 python39-pyparsing 0 2.4.7-5.module_el8.6.0+2780+a40f65e1
AlmaLinux:8 python39-pysocks 0 1.7.1-4.module_el8.6.0+2780+a40f65e1
AlmaLinux:8 python39-pytest 0 6.0.2-2.module_el8.6.0+2780+a40f65e1
AlmaLinux:8 python39-pyyaml 0 5.4.1-1.module_el8.6.0+2780+a40f65e1
AlmaLinux:8 python39-pyyaml 0 5.4.1-1.module_el8.6.0+3248+c431e88c
AlmaLinux:8 python39-requests 0 2.25.0-3.module_el8.9.0+3634+fb2a896c
AlmaLinux:8 python39-rpm-macros 0 3.9.25-2.module_el8.10.0+4083+53cad1fb
AlmaLinux:8 python39-scipy 0 1.5.4-5.module_el8.9.0+3634+fb2a896c
AlmaLinux:8 python39-setuptools 0 50.3.2-7.module_el8.10.0+4040+9207bbc0
AlmaLinux:8 python39-setuptools-wheel 0 50.3.2-7.module_el8.10.0+4040+9207bbc0
AlmaLinux:8 python39-six 0 1.15.0-3.module_el8.6.0+2780+a40f65e1
AlmaLinux:8 python39-test 0 3.9.25-2.module_el8.10.0+4083+53cad1fb
AlmaLinux:8 python39-tkinter 0 3.9.25-2.module_el8.10.0+4083+53cad1fb
AlmaLinux:8 python39-toml 0 0.10.1-5.module_el8.6.0+2780+a40f65e1
AlmaLinux:8 python39-urllib3 0 1.25.10-5.module_el8.10.0+3765+2f9a457d
AlmaLinux:8 python39-wcwidth 0 0.2.5-3.module_el8.6.0+2780+a40f65e1
AlmaLinux:8 python39-wheel 0 1:0.35.1-4.module_el8.6.0+2780+a40f65e1
AlmaLinux:8 python39-wheel-wheel 0 1:0.35.1-4.module_el8.6.0+2780+a40f65e1
Alpine:v3.18 python3 0 3.11.12-r1
Alpine:v3.19 python3 0 3.11.12-r1
Alpine:v3.20 python3 0 3.12.10-r1
Alpine:v3.21 python3 0 3.12.10-r1
Alpine:v3.22 python3 0 3.12.10-r1
Bitnami libpython 0 3.9.23
Bitnami python 0 No fix
Bitnami python 0 3.9.23
Bitnami python-min 0 No fix
Bitnami python-min 0 3.9.23
Chainguard python-3.10 0 3.10.19-r0
Chainguard python-3.10-base 0 3.10.19-r0
Chainguard python-3.10-base-dev 0 3.10.19-r0
Chainguard python-3.10-dev 0 3.10.19-r1
Chainguard python-3.10-doc 0 3.10.19-r0
Chainguard python-3.11 0 3.11.14-r0
Chainguard python-3.11-base 0 3.11.14-r0
Chainguard python-3.11-base-dev 0 3.11.14-r0
Chainguard python-3.11-dev 0 3.11.14-r0
Chainguard python-3.11-doc 0 3.11.14-r1
Chainguard python-3.12 0 3.12.10-r2
Chainguard python-3.12-base 0 3.12.10-r2
Chainguard python-3.12-base-dev 0 3.12.10-r2
Chainguard python-3.12-dev 0 3.12.10-r2
Chainguard python-3.12-doc 0 3.12.10-r2
Chainguard python-3.12-privileged-netbindservice 0 3.12.10-r2
Chainguard python-3.12-tk 0 3.12.10-r2
Chainguard python-3.13 0 3.13.3-r2
Chainguard python-3.13-base 0 3.13.3-r2
Chainguard python-3.13-base-dev 0 3.13.3-r2
Chainguard python-3.13-dev 0 3.13.3-r2
Chainguard python-3.13-doc 0 3.13.3-r2
Chainguard python-3.13-privileged-netbindservice 0 3.13.3-r2
Chainguard python-3.13-tk 0 3.13.3-r2
Chainguard python-3.9 0 3.9.25-r0
Chainguard python-3.9-base 0 3.9.25-r0
Chainguard python-3.9-base-dev 0 3.9.25-r0
Chainguard python-3.9-dev 0 3.9.25-r0
Chainguard python-3.9-doc 0 3.9.25-r0
Debian:11 python3.9 0 No fix
Debian:12 python3.11 0 No fix
Debian:13 python3.13 0 No fix
Debian:14 python3.13 0 3.13.3-4
Mageia:9 python3 0 3.10.18-1.4.mga9
SUSE:Enterprise Storage 7.1 python3 0 3.6.15-150300.10.97.2
SUSE:Enterprise Storage 7.1 python3-core 0 3.6.15-150300.10.97.1
SUSE:Enterprise Storage 7.1 python39 0 3.9.23-150300.4.75.1
SUSE:Enterprise Storage 7.1 python39-core 0 3.9.23-150300.4.75.1
SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS python3 0 3.6.15-150300.10.97.2
SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS python3-core 0 3.6.15-150300.10.97.1
SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS python39 0 3.9.23-150300.4.75.1
SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS python39-core 0 3.9.23-150300.4.75.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS python3 0 3.6.15-150300.10.97.2
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS python3-core 0 3.6.15-150300.10.97.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS python310 0 3.10.18-150400.4.82.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS python310-core 0 3.10.18-150400.4.82.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS python311 0 3.11.13-150400.9.60.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS python311-core 0 3.11.13-150400.9.60.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS python311-documentation 0 3.11.13-150400.9.60.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS python3 0 3.6.15-150300.10.97.2
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS python3-core 0 3.6.15-150300.10.97.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS python310 0 3.10.18-150400.4.82.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS python310-core 0 3.10.18-150400.4.82.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS python311 0 3.11.13-150400.9.60.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS python311-core 0 3.11.13-150400.9.60.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS python311-documentation 0 3.11.13-150400.9.60.1
SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS python3 0 3.6.15-150300.10.97.2
SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS python3-core 0 3.6.15-150300.10.97.1
SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS python311 0 3.11.13-150400.9.60.1
SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS python311-core 0 3.11.13-150400.9.60.1
SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS python311-documentation 0 3.11.13-150400.9.60.1
SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS python3 0 3.6.15-150300.10.97.2
SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS python3-core 0 3.6.15-150300.10.97.1
SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS python311 0 3.11.13-150400.9.60.1
SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS python311-core 0 3.11.13-150400.9.60.1
SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS python311-documentation 0 3.11.13-150400.9.60.1
SUSE:Linux Enterprise Micro 5.1 python3 0 3.6.15-150000.3.176.1
SUSE:Linux Enterprise Micro 5.1 python3-core 0 3.6.15-150000.3.176.1
SUSE:Linux Enterprise Micro 5.2 python3 0 3.6.15-150300.10.97.2
SUSE:Linux Enterprise Micro 5.2 python3-core 0 3.6.15-150300.10.97.1
SUSE:Linux Enterprise Micro 5.3 python3 0 3.6.15-150300.10.97.2
SUSE:Linux Enterprise Micro 5.3 python3-core 0 3.6.15-150300.10.97.1
SUSE:Linux Enterprise Micro 5.4 python3 0 3.6.15-150300.10.97.2
SUSE:Linux Enterprise Micro 5.4 python3-core 0 3.6.15-150300.10.97.1
SUSE:Linux Enterprise Micro 5.5 python3 0 3.6.15-150300.10.97.2
SUSE:Linux Enterprise Micro 5.5 python3-core 0 3.6.15-150300.10.97.1
SUSE:Linux Enterprise Module for Basesystem 15 SP6 python3 0 3.6.15-150300.10.97.2
SUSE:Linux Enterprise Module for Basesystem 15 SP6 python3-core 0 3.6.15-150300.10.97.1
SUSE:Linux Enterprise Module for Basesystem 15 SP6 python311-core 0 3.11.13-150600.3.30.1
SUSE:Linux Enterprise Module for Basesystem 15 SP7 python3 0 3.6.15-150300.10.97.2
SUSE:Linux Enterprise Module for Basesystem 15 SP7 python3-core 0 3.6.15-150300.10.97.1
SUSE:Linux Enterprise Module for Basesystem 15 SP7 python311-core 0 3.11.13-150600.3.30.1
SUSE:Linux Enterprise Module for Development Tools 15 SP6 python3-core 0 3.6.15-150300.10.97.1
SUSE:Linux Enterprise Module for Development Tools 15 SP7 python3-core 0 3.6.15-150300.10.97.1
SUSE:Linux Enterprise Module for Public Cloud 15 SP4 python311 0 3.11.13-150400.9.60.1
SUSE:Linux Enterprise Module for Public Cloud 15 SP4 python311-core 0 3.11.13-150400.9.60.1
SUSE:Linux Enterprise Module for Python 3 15 SP6 python311 0 3.11.13-150600.3.30.1
SUSE:Linux Enterprise Module for Python 3 15 SP6 python311-core 0 3.11.13-150600.3.30.1
SUSE:Linux Enterprise Module for Python 3 15 SP6 python312 0 3.12.11-150600.3.30.1
SUSE:Linux Enterprise Module for Python 3 15 SP6 python312-core 0 3.12.11-150600.3.30.1
SUSE:Linux Enterprise Module for Python 3 15 SP7 python311 0 3.11.13-150600.3.30.1
SUSE:Linux Enterprise Module for Python 3 15 SP7 python311-core 0 3.11.13-150600.3.30.1
SUSE:Linux Enterprise Module for Python 3 15 SP7 python313 0 3.13.5-150700.4.11.1
SUSE:Linux Enterprise Module for Python 3 15 SP7 python313-core 0 3.13.5-150700.4.11.1
SUSE:Linux Enterprise Server 12 SP5-LTSS python36 0 3.6.15-84.1
SUSE:Linux Enterprise Server 12 SP5-LTSS python36-core 0 3.6.15-84.1
SUSE:Linux Enterprise Server 15 SP3-LTSS python3 0 3.6.15-150300.10.97.2
SUSE:Linux Enterprise Server 15 SP3-LTSS python3-core 0 3.6.15-150300.10.97.1
SUSE:Linux Enterprise Server 15 SP3-LTSS python39 0 3.9.23-150300.4.75.1
SUSE:Linux Enterprise Server 15 SP3-LTSS python39-core 0 3.9.23-150300.4.75.1
SUSE:Linux Enterprise Server 15 SP4-LTSS python3 0 3.6.15-150300.10.97.2
SUSE:Linux Enterprise Server 15 SP4-LTSS python3-core 0 3.6.15-150300.10.97.1
SUSE:Linux Enterprise Server 15 SP4-LTSS python310 0 3.10.18-150400.4.82.1
SUSE:Linux Enterprise Server 15 SP4-LTSS python310-core 0 3.10.18-150400.4.82.1
SUSE:Linux Enterprise Server 15 SP4-LTSS python311 0 3.11.13-150400.9.60.1
SUSE:Linux Enterprise Server 15 SP4-LTSS python311-core 0 3.11.13-150400.9.60.1
SUSE:Linux Enterprise Server 15 SP4-LTSS python311-documentation 0 3.11.13-150400.9.60.1
SUSE:Linux Enterprise Server 15 SP5-LTSS python3 0 3.6.15-150300.10.97.2
SUSE:Linux Enterprise Server 15 SP5-LTSS python3-core 0 3.6.15-150300.10.97.1
SUSE:Linux Enterprise Server 15 SP5-LTSS python311 0 3.11.13-150400.9.60.1
SUSE:Linux Enterprise Server 15 SP5-LTSS python311-core 0 3.11.13-150400.9.60.1
SUSE:Linux Enterprise Server 15 SP5-LTSS python311-documentation 0 3.11.13-150400.9.60.1
SUSE:Linux Enterprise Server 15 SP5-LTSS python39 0 3.9.23-150300.4.75.1
SUSE:Linux Enterprise Server 15 SP5-LTSS python39-core 0 3.9.23-150300.4.75.1
SUSE:Linux Enterprise Server LTSS Extended Security 12 SP5 python36 0 3.6.15-84.1
SUSE:Linux Enterprise Server LTSS Extended Security 12 SP5 python36-core 0 3.6.15-84.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP3 python3 0 3.6.15-150300.10.97.2
SUSE:Linux Enterprise Server for SAP Applications 15 SP3 python3-core 0 3.6.15-150300.10.97.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP3 python39 0 3.9.23-150300.4.75.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP3 python39-core 0 3.9.23-150300.4.75.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP4 python3 0 3.6.15-150300.10.97.2
SUSE:Linux Enterprise Server for SAP Applications 15 SP4 python3-core 0 3.6.15-150300.10.97.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP4 python310 0 3.10.18-150400.4.82.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP4 python310-core 0 3.10.18-150400.4.82.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP4 python311 0 3.11.13-150400.9.60.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP4 python311-core 0 3.11.13-150400.9.60.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP4 python311-documentation 0 3.11.13-150400.9.60.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP5 python3 0 3.6.15-150300.10.97.2
SUSE:Linux Enterprise Server for SAP Applications 15 SP5 python3-core 0 3.6.15-150300.10.97.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP5 python311 0 3.11.13-150400.9.60.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP5 python311-core 0 3.11.13-150400.9.60.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP5 python311-documentation 0 3.11.13-150400.9.60.1

Related vulnerabilities