CVE-2025-12781 (CNNVD-202601-3361)

MEDIUM
中文标题:
CPython 安全漏洞
英文标题:
base64.b64decode() always accepts "+/" characters, despite setting altchars
CVSS分数: 6.3
发布时间: 2026-01-21 19:34:47
漏洞类型: 其他
状态: PUBLISHED
数据质量分数: 0.40
数据版本: v4
漏洞描述
中文描述:

CPython是Python基金会的一个用C语言实现的Python解释器。 CPython存在安全漏洞,该漏洞源于b64decode、standard_b64decode和urlsafe_b64decode函数始终接受+和/字符,可能导致数据完整性问题。

英文描述:

When passing data to the b64decode(), standard_b64decode(), and urlsafe_b64decode() functions in the "base64" module the characters "+/" will always be accepted, regardless of the value of "altchars" parameter, typically used to establish an "alternative base64 alphabet" such as the URL safe alphabet. This behavior matches what is recommended in earlier base64 RFCs, but newer RFCs now recommend either dropping characters outside the specified base64 alphabet or raising an error. The old behavior has the possibility of causing data integrity issues. This behavior can only be insecure if your application uses an alternate base64 alphabet (without "+/"). If your application does not use the "altchars" parameter or the urlsafe_b64decode() function, then your application does not use an alternative base64 alphabet. The attached patches DOES NOT make the base64-decode behavior raise an error, as this would be a change in behavior and break existing programs. Instead, the patch deprecates the behavior which will be replaced with the newly recommended behavior in a future version of Python. Users are recommended to mitigate by verifying user-controlled inputs match the base64 alphabet they are expecting or verify that their application would not be affected if the b64decode() functions accepted "+" or "/" outside of altchars.

CWE类型:
CWE-704
标签:
(暂无数据)
受影响产品
厂商 产品 版本 版本范围 平台 CPE
Python Software Foundation CPython - < 3.15.0 - cpe:2.3:a:python_software_foundation:cpython:*:*:*:*:*:*:*:*
解决方案
中文解决方案:
(暂无数据)
英文解决方案:
(暂无数据)
临时解决方案:
(暂无数据)
参考链接
无标题 patch
cve.org
访问
无标题 issue-tracking
cve.org
访问
无标题 vendor-advisory
cve.org
访问
cna@python.org OTHER
nvd.nist.gov
访问
cna@python.org OTHER
nvd.nist.gov
访问
cna@python.org OTHER
nvd.nist.gov
访问
cna@python.org OTHER
nvd.nist.gov
访问
cna@python.org OTHER
nvd.nist.gov
访问
CVSS评分详情
4.0 (cna)
MEDIUM
6.3
CVSS向量: CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
机密性
NONE
完整性
LOW
可用性
NONE
后续系统影响 (Subsequent):
机密性
NONE
完整性
NONE
可用性
NONE
时间信息
发布时间:
2026-01-21 19:34:47
修改时间:
2026-01-21 19:38:08
创建时间:
2026-01-22 06:00:05
更新时间:
2026-01-27 06:00:14
利用信息
暂无可利用代码信息
数据源详情
数据源 记录ID 版本 提取时间
CVE cve_CVE-2025-12781 2026-01-22 03:16:55 2026-01-21 22:00:05
NVD nvd_CVE-2025-12781 2026-01-22 02:00:05 2026-01-21 22:00:13
CNNVD cnnvd_CNNVD-202601-3361 2026-01-26 02:10:03 2026-01-25 18:11:55
版本与语言
当前版本: v4
主要语言: EN
支持语言:
EN ZH
安全公告
暂无安全公告信息
变更历史
v4 CNNVD
2026-01-26 02:11:55
vulnerability_type: 未提取 → 其他; cnnvd_id: 未提取 → CNNVD-202601-3361; data_sources: ['cve', 'nvd'] → ['cnnvd', 'cve', 'nvd']
查看详细变更
  • vulnerability_type: 未提取 -> 其他
  • cnnvd_id: 未提取 -> CNNVD-202601-3361
  • data_sources: ['cve', 'nvd'] -> ['cnnvd', 'cve', 'nvd']
v3 NVD
2026-01-23 06:00:15
references_count: 3 → 8
查看详细变更
  • references_count: 3 -> 8
v2 NVD
2026-01-22 06:00:13
data_sources: ['cve'] → ['cve', 'nvd']
查看详细变更
  • data_sources: ['cve'] -> ['cve', 'nvd']