Cyber Resilience

CVE-2025-12781

Python ≤ 3.13.10

Public PoC
Published
21 January 2026
Modified
02 February 2026
Patch / advisory
CVSS Score v4 6.3
Click a component to see what it means
Raw vectorCVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/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
EPSS Score 0.0051 41th percentile
Risk Priority 35 floored blend · peak EPSS

Summary

CVE-2025-12781 is a medium-severity Incorrect Type Conversion or Cast (CWE-704) vulnerability in Python Python. Its CVSS base score is 6.3 (Medium).

Operationally, ranked at the 41th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog; a public proof-of-concept is referenced.

The strongest mitigations our analysis identified map to SI-10 (Information Input Validation) and SI-7 (Software, Firmware, and Information Integrity) — see the control section below for these in your framework.

EU & UK References

Vulnerability Data

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…

more

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(s)

Related Threats

CVEs Like This One

CVE-2024-7592Same product: Python Python
CVE-2024-6232Same product: Python Python
CVE-2023-33595Same product: Python Python
CVE-2026-3644Same product: Python Python
CVE-2026-6019Same product: Python Python
CVE-2026-4360Same product: Python Python
CVE-2023-40217Same product: Python Python
CVE-2025-13462Same product: Python Python
CVE-2024-9287Same product: Python Python
CVE-2025-13837Same product: Python Python

Affected Assets

python
python
3.15.0 · ≤ 3.13.10 · 3.14.0 — 3.14.1

Mitigating Controls

Control response

Prevent
Stop it (NIST 800-53)
  • SI-10 Information Input Validation
  • SI-7 Software, Firmware, and Information Integrity
Detect
Catch it (NIST detect / respond)
Harden
Shrink the surface (DISA STIG)

Validate
Prove the fix (OWASP ASVS)

Mitigating Controls (NIST 800-53 r5) AI

prevent

Directly requires validation of user-controlled base64 inputs against the expected alphabet before b64decode() variants are called.

prevent

Requires mechanisms to detect and protect against unauthorized or unexpected changes to information resulting from the non-compliant decode behavior.

detect

Supports consistent error handling when unexpected characters are encountered during decoding, aiding detection of the integrity issue.

Mitigating Controls (NIST CSF 2.0) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→CSF cross-walk (authority under review) — links open the control.

PR.PS-06 mostly match
prevents

Secure SDLC practices directly prevent type-conversion flaws via coding standards, reviews, and testing.

Mitigating Controls (ISO/IEC 27001:2022 Annex A) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→ISO cross-walk (authority under review) — links open the control.

detects

Security testing can uncover type-conversion defects before release.

prevents

Secure development lifecycle includes type-safety reviews that reduce incorrect casts.

prevents

Application security requirements can mandate strong typing and safe casting rules.

degrades

Secure architecture principles discourage unsafe type conversions in design.

prevents

Secure coding standards directly forbid or detect incorrect type casts.

References