一、 漏洞 CVE-2025-4516 基础信息
漏洞信息
                                        # 带有错误处理程序的“unicode_escape”解码器中的使用后释放漏洞

## 漏洞概述
在使用 `bytes.decode("unicode_escape", error="ignore|replace")` 时,CPython 存在一个问题。如果未使用 "unicode_escape" 编码或错误处理器,你的使用情况不受影响。

## 影响版本
未指定具体版本

## 细节
当使用 `bytes.decode` 方法时,如果 `${error}` 参数设置为 `"ignore"` 或 `"replace"`,并且编码方式为 `"unicode_escape"`, 可能会引发潜在问题。

## 影响
通过将 `bytes.decode()` 调用包在尝试捕获 `DecodeError` 的 try-except 语句中,可以解决这个问题。不再使用 `error=` 处理器也是一个解决办法。
                                        
神龙判断

是否为 Web 类漏洞:

判断理由:

否。这个漏洞与Web服务的服务端无直接关系,而是存在于CPython(Python的官方解释器)中,具体涉及`bytes.decode`方法在使用特定编码和错误处理器时的行为。这是一个解释器级别的安全或功能问题,而非Web服务端特有的漏洞。
提示
尽管我们采用了先进的大模型技术,但其输出仍可能包含不准确或过时的信息。
神龙会尽力确保数据准确,但也请结合实际情况进行甄别与判断。
神龙祝您一切顺利!
漏洞标题
Use-after-free in "unicode_escape" decoder with error handler
来源:美国国家漏洞数据库 NVD
漏洞描述信息
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.
来源:美国国家漏洞数据库 NVD
CVSS信息
N/A
来源:美国国家漏洞数据库 NVD
漏洞类别
释放后使用
来源:美国国家漏洞数据库 NVD
漏洞标题
Python 资源管理错误漏洞
来源:中国国家信息安全漏洞库 CNNVD
漏洞描述信息
Python是Python基金会的一套开源的、面向对象的程序设计语言。该语言具有可扩展、支持模块和包、支持多种平台等特点。 Python存在资源管理错误漏洞,该漏洞源于使用bytes.decode(unicode_escape)时错误处理不当,可能导致解码错误。
来源:中国国家信息安全漏洞库 CNNVD
CVSS信息
N/A
来源:中国国家信息安全漏洞库 CNNVD
漏洞类别
资源管理错误
来源:中国国家信息安全漏洞库 CNNVD
二、漏洞 CVE-2025-4516 的公开POC
# POC 描述 源链接 神龙链接
三、漏洞 CVE-2025-4516 的情报信息
  • 标题: Use-after-free in `unicode_escape` decoder with error handler · Issue #133767 · python/cpython -- 🔗来源链接

    标签: issue-tracking

    神龙速读
  • 标题: gh-133767: Fix use-after-free in the unicode-escape decoder with an error handler by serhiy-storchaka · Pull Request #129648 · python/cpython · GitHub -- 🔗来源链接

    标签: patch

    神龙速读
  • 标题: Mailman 3 [CVE-2025-4516] Use-after-free crash using bytes.decode("unicode_escape", error="ignore|replace") - Security-announce - python.org -- 🔗来源链接

    标签: vendor-advisory

    神龙速读
  • 标题: [3.14] gh-133767: Fix use-after-free in the unicode-escape decoder wi… · python/cpython@69b4387 · GitHub -- 🔗来源链接

    标签: patch

    神龙速读
  • 标题: gh-133767: Fix use-after-free in the unicode-escape decoder with an e… · python/cpython@9f69a58 · GitHub -- 🔗来源链接

    标签: patch

    神龙速读
  • 标题: [3.12] gh-133767: Fix use-after-free in the unicode-escape decoder wi… · python/cpython@4398b78 · GitHub -- 🔗来源链接

    标签: patch

    神龙速读
  • 标题: [3.13] gh-133767: Fix use-after-free in the unicode-escape decoder wi… · python/cpython@6279eb8 · GitHub -- 🔗来源链接

    标签: patch

    神龙速读
  • 标题: [3.11] gh-133767: Fix use-after-free in the unicode-escape decoder wi… · python/cpython@73b3040 · GitHub -- 🔗来源链接

    标签: patch

    神龙速读
  • 标题: [3.9] gh-133767: Fix use-after-free in the unicode-escape decoder wit… · python/cpython@8d35fd1 · GitHub -- 🔗来源链接

    标签: patch

    神龙速读
  • 标题: [3.10] gh-133767: Fix use-after-free in the unicode-escape decoder wi… · python/cpython@ab9893c · GitHub -- 🔗来源链接

    标签: patch

    神龙速读
  • https://nvd.nist.gov/vuln/detail/CVE-2025-4516
四、漏洞 CVE-2025-4516 的评论

暂无评论


发表评论