Security Advisories (3)
CVE-2026-57432 (2026-07-13)

Perl versions through 5.43.10 have an integer overflow in S_measure_struct leading to an out-of-bounds heap read in pack and unpack. S_measure_struct adds each item's size times its repeat count to a running total with no overflow check, so a large repeat count in a pack or unpack template wraps the signed SSize_t total negative. The @, X, and x position codes then guard their moves with a signed length comparison that passes when the length is negative, advancing the buffer pointer out of bounds. A template derived from untrusted input can read heap memory past the buffer and return it to the caller.

CVE-2026-13221 (2026-07-13)

Perl versions through 5.43.9 produce silently incorrect regular expression matches when an alternation of more than 65535 fixed string branches is compiled into a trie in Perl_study_chunk. When such branches are combined into a trie, the delta between the first branch and the shared tail is stored in a 16-bit field. A branch count above 65535 overflows the field, and the trie's match decision table is truncated with no warning or error. A pattern of this shape produces false positive matches (matching strings it should not) and false negative matches (failing to match strings it should). When such a pattern gates an access or filtering decision, the result is wrong.

CVE-2026-8376 (2026-05-25)

Perl versions through 5.43.10 have a heap buffer overflow when compiling regular expressions with a repeated fixed string on 32-bit builds. Perl_study_chunk in regcomp_study.c checked the size of the joined substring buffer in characters rather than bytes. For a quantified fixed substring with a large minimum count, the byte length mincount * l could overflow SSize_t, producing an undersized SvGROW allocation; the subsequent copy writes past the end of the buffer. A caller that compiles an attacker-controlled regular expression on a 32-bit perl build triggers a heap buffer overflow at compile time.

NAME

sort - perl pragma to control sort() behaviour

SYNOPSIS

The sort pragma is now a no-op, and its use is discouraged. These three operations are valid, but have no effect:

use sort 'stable';          # guarantee stability
use sort 'defaults';        # revert to default behavior
no  sort 'stable';          # stability not important

DESCRIPTION

Historically the sort pragma you can control the behaviour of the builtin sort() function.

Prior to v5.28.0 there were two other options:

use sort '_mergesort';
use sort '_qsort';          # or '_quicksort'

If you try and specify either of these in v5.28+ it will croak.

The default sort has been stable since v5.8.0, and given this consistent behaviour for almost two decades, everyone has come to assume stability.

Stability will remain the default - hence there is no need for a pragma for code to opt into stability "just in case" this changes - it won't.

We do not foresee going back to offering multiple implementations of general purpose sorting - hence there is no future need to offer a pragma to choose between them.

If you know that you care that much about performance of your sorting, and that for your use case and your data, it was worth investigating alternatives, possible to identify an alternative from our default that was better, and the cost of switching was worth it, then you know more than we do. Likely whatever choices we can give are not as good as implementing your own. (For example, a Radix sort can be faster than O(n log n), but can't be used for all keys and has larger overheads.)

We are not averse to changing the sort algorithm, but we don't see the benefit in offering the choice of two general purpose implementations.

CAVEATS

The function sort::current() was provided to report the current state of the sort pragmata. This function was not exported, and there is no code to call it on CPAN. It is now deprecated, and will warn by default.

As we no longer store any sort "state", it can no longer return the correct value, so it will always return the string stable, as this is consistent with what we actually have implemented.