CVE-2026-141548: pymonocypher: argon2i_32 can overflow the heap on 32-bit builds when nb_blocks >= 2**22 (work area size wraps)

Published Dec 2, 2026
·
Updated

pymonocypher uses cython to wrap the Monocypher C library. From 4.0.2.4 until 4.0.3.6, argon2i32 in cmonocypher.pyx multiplies nbblocks by 1024 in a 32-bit sizet, causing the allocated work-area size to wrap when nbblocks is at least 222. When the smaller allocation succeeds, cryptoargon2 fills 1024-byte blocks up to nbblocks rounded down to a multiple of four, causing an out-of-bounds heap write that can crash the calling process. If the allocation fails, the call instead raises MemoryError. An affected application must run a 32-bit build and pass an attacker-influenced nbblocks value without bounding it below 222; 64-bit builds and callers enforcing that bound are not affected. This issue is fixed in version 4.0.3.6.

Affected Software

1 affected component
pypi/pymonocypher>=4.0.2.4<4.0.3.6

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 4.0.3.6

Event History

Dec 2, 2026
CVE Published
via MITRE·07:31 PM
Data Sourced
via MITRE·07:31 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·08:20 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are exposed to this issue?

Only 32-bit builds are affected, and only when the application can pass an attacker-influenced nb_blocks value of at least 2**22 to argon2i_32. 64-bit builds and callers that enforce a lower bound are not affected.

2

What does an attacker need to trigger the flaw?

An attacker needs a way to influence the nb_blocks argument passed to argon2i_32 and set it to at least 2**22. Exploitation also requires user interaction according to the supplied severity vector.

3

What happens when the vulnerable call is made?

If the undersized wrapped allocation succeeds, crypto_argon2 writes beyond the heap allocation and can crash the calling process. If allocation fails instead, the call raises MemoryError.

4

What can be done before upgrading?

Ensure nb_blocks is bounded below 2**22 before it reaches argon2i_32, particularly for values derived from untrusted input. Upgrading to version 4.0.3.6 fixes the issue.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203