Security Advisories (5)
CVE-2023-47038 (2023-10-30)

A crafted regular expression when compiled by perl 5.30.0 through 5.38.0 can cause a one attacker controlled byte buffer overflow in a heap allocated buffer

CVE-2023-47100

In Perl before 5.38.2, S_parse_uniprop_string in regcomp.c can write to unallocated space because a property name associated with a \p{...} regular expression construct is mishandled. The earliest affected version is 5.30.0.

CVE-2024-56406 (2025-04-13)

A heap buffer overflow vulnerability was discovered in Perl. When there are non-ASCII bytes in the left-hand-side of the `tr` operator, `S_do_trans_invmap` can overflow the destination pointer `d`.    $ perl -e '$_ = "\x{FF}" x 1000000; tr/\xFF/\x{100}/;'    Segmentation fault (core dumped) It is believed that this vulnerability can enable Denial of Service and possibly Code Execution attacks on platforms that lack sufficient defenses.

CVE-2025-40909 (2025-05-30)

Perl threads have a working directory race condition where file operations may target unintended paths. If a directory handle is open at thread creation, the process-wide current working directory is temporarily changed in order to clone that handle for the new thread, which is visible from any third (or more) thread already running. This may lead to unintended operations such as loading code or accessing files from unexpected locations, which a local attacker may be able to exploit. The bug was introduced in commit 11a11ecf4bea72b17d250cfb43c897be1341861e and released in Perl version 5.13.6

CVE-2023-47039 (2023-10-30)

Perl for Windows relies on the system path environment variable to find the shell (cmd.exe). When running an executable which uses Windows Perl interpreter, Perl attempts to find and execute cmd.exe within the operating system. However, due to path search order issues, Perl initially looks for cmd.exe in the current working directory. An attacker with limited privileges can exploit this behavior by placing cmd.exe in locations with weak permissions, such as C:\ProgramData. By doing so, when an administrator attempts to use this executable from these compromised locations, arbitrary code can be executed.

NAME

Math::BigInt::Calc - pure Perl module to support Math::BigInt

SYNOPSIS

# to use it with Math::BigInt
use Math::BigInt lib => 'Calc';

# to use it with Math::BigFloat
use Math::BigFloat lib => 'Calc';

# to use it with Math::BigRat
use Math::BigRat lib => 'Calc';

# explicitly set base length and whether to "use integer"
use Math::BigInt::Calc base_len => 4, use_int => 1;
use Math::BigInt lib => 'Calc';

DESCRIPTION

Math::BigInt::Calc inherits from Math::BigInt::Lib.

In this library, the numbers are represented interenally in base B = 10**N, where N is the largest possible integer that does not cause overflow in the intermediate computations. The base B elements are stored in an array, with the least significant element stored in array element zero. There are no leading zero elements, except a single zero element when the number is zero. For instance, if B = 10000, the number 1234567890 is represented internally as [7890, 3456, 12].

OPTIONS

When the module is loaded, it computes the maximum exponent, i.e., power of 10, that can be used with and without "use integer" in the computations. The default is to use this maximum exponent. If the combination of the 'base_len' value and the 'use_int' value exceeds the maximum value, an error is thrown.

base_len

The base length can be specified explicitly with the 'base_len' option. The value must be a positive integer.

use Math::BigInt::Calc base_len => 4;  # use 10000 as internal base
use_int

This option is used to specify whether "use integer" should be used in the internal computations. The value is interpreted as a boolean value, so use 0 or "" for false and anything else for true. If the 'base_len' is not specified together with 'use_int', the current value for the base length is used.

use Math::BigInt::Calc use_int => 1;   # use "use integer" internally

METHODS

This overview constains only the methods that are specific to Math::BigInt::Calc. For the other methods, see Math::BigInt::Lib.

_base_len()

Specify the desired base length and whether to enable "use integer" in the computations.

Math::BigInt::Calc -> _base_len($base_len, $use_int);

Note that it is better to specify the base length and whether to use integers as options when the module is loaded, for example like this

use Math::BigInt::Calc base_len => 6, use_int => 1;

SEE ALSO

Math::BigInt::Lib for a description of the API.

Alternative libraries Math::BigInt::FastCalc, Math::BigInt::GMP, Math::BigInt::Pari, Math::BigInt::GMPz, and Math::BigInt::BitVect.

Some of the modules that use these libraries Math::BigInt, Math::BigFloat, and Math::BigRat.