Intel

AIKIDO-2026-401924

bigdecimal is vulnerable to Out-of-bounds Write

Out-of-bounds Write Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Today

39

Low Risk

This Affects:

RUBYbigdecimal
4.1.0 - 4.1.2
Fixed in 4.1.3
Are you affected? Scan for Free

TL;DR

BigDecimal division routes higher-precision operations through a Newton-Raphson algorithm whose slice_copy helper in div.h computes copy offsets that can fall outside the source fraction buffer. When operand magnitude and precision produce a negative or oversized start index, slice_copy performs a heap memcpy past the bounds of the frac array, corrupting adjacent heap memory. Zero-valued intermediate results also retain stale exponents, compounding the miscalculation during division. The fix clamps the copy range to the valid window and normalizes the exponent of zero values.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and your application performs division on BigDecimal values whose magnitude or precision can be influenced by untrusted input.

Background info

bigdecimal is vulnerable to Out-of-bounds Write in versions 4.1.0 - 4.1.2.

How to fix this

Upgrade the bigdecimal library to the patch version.

Are You Affected?

Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.

Free. No credit card required.

Aikido Platform