Security Advisories (1)
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

NAME

test-dist-modules.pl - test modules in dist/ against the perl invoked with

SYNOPSIS

# from a checked out clean perl source tree
# test all dist/ modules, abort on first failure
path/to/perl test-dist-modules.pl

# test all dist/ modules, continue on failure
path/to/perl test-dist-modules.pl -c

# test all dist/ modules, and install into path/to/perl's site_perl
path/to/perl test-dist-modules.pl -i

DESCRIPTION

Porting/test-dist-modules.pl is used by the Github workflow to test modules from dist/ against the perl it is invoked with, within a git clone of a development perl. This clone must be a clean clone, ie. as with git clean -dxf .

That perl should have any prerequisites needed by those modules installed, at this point this includes sufficiently recent versions of:

ExtUtils::MakeMaker
Perl::OSType
Scalar::Util
Socket
version

test-dist-modules.pl will always test Devel::PPPort first and then use that when testing the other modules, even if invoked with a distribution list.

INVOKING test-dist-modules.pl

By default test-dist-modules.pl will test each directory in dist/, but you can test specific distributions by supplying them on the command-line:

path/to/perl test-dist-modules.pl threads

which will test Devel-PPPort and threads.

Options:

  • -i

  • -install

    Install the modules to the invoking perl's site_perl. This may require privileges such as running as root.

  • -c

  • -continue

    Continue testing modules even if one fails.

  • -s

  • -separate

    Install to a temp tree instead of to the invoking perl's site_perl. This is now the default.

  • -h

  • -help

    Produce a help message.