p PatchFirst

CVE-2025-40909

CVE-2025-40909 · Perl threads have a working directory race condition where file operations may target unintended paths

CVSS 5.9 · Medium · EPSS 0.5% · Fix available

Compare with your installed version

Affected products and known fixed versions are public information. Compare them with your installed version.

  • perlUpdate to 5.41.13
  • perl Debian 12Update to 5.36.0-7+deb12u3
  • perl Debian 13Update to 5.40.1-5
  • perl Debian 14Update to 5.40.1-5
  • and 6 more

Check the installed version:

dpkg-query -W -f='${source:Package} ${binary:Package} ${Version}\n' | awk '$1=="perl"'

Assess your server’s risks

The free check gives you a rating and a risk summary by technology stack, without signing up. It does not answer whether this particular vulnerability affects you.

Monitoring matches public information against your servers’ software. Detailed findings for your servers include the order of updates.

curl -fsSL https://patchfirst.dev/check.sh | sh
Check your server for free →

Channels carry general technology news; monitoring reports new findings on your servers in your dashboard, through browser notifications, in Telegram or via a webhook.

This page contains facts from public vulnerability sources. Check the original advisory before updating.

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

Published
Updated

Fixes in distributions

  • RHSA-2026:50262 · Red Hat rhel e4s 8.8 appstream, Red Hat rhel tus 8.8 appstream ·
  • RHSA-2026:37070 · Red Hat rhel aus 8.6 appstream, Red Hat rhel eus long life 8.6 appstream ·
  • DLA-4538-1 · Debian 11 ·
  • RHSA-2026:8096 · Red Hat Enterprise Linux 8 appstream ·
  • RLSA-2026:8096 · Rocky Linux 8 ·
  • ALSA-2026:8096 · AlmaLinux 8 ·
  • RLSA-2025:11804 · Rocky Linux 9 ·
  • RLSA-2025:12056 · Rocky Linux 10 ·
  • RHSA-2025:12056 · Red Hat Enterprise Linux 10.0 ·
  • RLSA-2025:11805 · Rocky Linux 8 ·
  • USN-7678-1 · Ubuntu 22.04 LTS, Ubuntu 24.04 LTS ·
  • SUSE-SU-2025:20532-1 · SUSE Linux Micro 6.1 ·
  • RHSA-2025:11804 · Red Hat Enterprise Linux 9 appstream ·
  • RHSA-2025:11805 · Red Hat Enterprise Linux 8 appstream, Red Hat Enterprise Linux 8 baseos ·
  • ALSA-2025:11805 · AlmaLinux 8 ·
  • RHSA-2025:11545 · Red Hat rhel eus 9.4 appstream ·
  • openSUSE-SU-2025:15258-1 · openSUSE Tumbleweed ·
  • SUSE-SU-2025:20456-1 · SUSE Linux Micro 6.0 ·
  • SUSE-SU-2025:02051-1 · SUSE Linux Enterprise Server LTSS Extended Security 12 SP5 ·
  • SUSE-SU-2025:02027-1 · openSUSE Leap 15.6, SUSE Linux Enterprise Micro 5.1, SUSE Linux Enterprise Micro 5.2, SUSE Linux Enterprise Micro 5.3, SUSE Linux Enterprise Micro 5.4, SUSE Linux Enterprise Micro 5.5, SUSE Linux Enterprise Module for Basesystem 15 SP6, SUSE Linux Enterprise Module for Basesystem 15 SP7, SUSE Linux Enterprise Module for Development Tools 15 SP6, SUSE Linux Enterprise Module for Development Tools 15 SP7, SUSE Linux Enterprise Module for Package Hub 15 SP6, SUSE Linux Enterprise Module for Package Hub 15 SP7 ·

Stack: system

Affected products and versions

  • perl

    Versions
    • ≥ 5.13.6, < 5.41.13: Affected (custom)

    Update to 5.41.13

  • perl Debian 12

    Versions
    • 5.36.0-7
    • 5.36.0-7+deb12u1
    • 5.36.0-7+deb12u2
    Affected ranges
    • ECOSYSTEM: < 5.36.0-7+deb12u3

    Update to 5.36.0-7+deb12u3

  • perl Debian 13

    Affected ranges
    • ECOSYSTEM: < 5.40.1-5

    Update to 5.40.1-5

  • perl Debian 14

    Affected ranges
    • ECOSYSTEM: < 5.40.1-5

    Update to 5.40.1-5

  • perl Ubuntu Pro 14.04 LTS

    Versions
    • 5.14.2-21build1
    • 5.18.1-4
    • 5.18.1-4build1
    • 5.18.1-5
    • 5.18.2-2
    • 5.18.2-2ubuntu1
    All versions (18)
    • 5.18.2-2ubuntu1.1
    • 5.18.2-2ubuntu1.3
    • 5.18.2-2ubuntu1.4
    • 5.18.2-2ubuntu1.6
    • 5.18.2-2ubuntu1.7
    • 5.18.2-2ubuntu1.7+esm3
    • 5.18.2-2ubuntu1.7+esm4
    • 5.18.2-2ubuntu1.7+esm5
    • 5.18.2-2ubuntu1.7+esm7
    • 5.18.2-2ubuntu1.7+esm8
    • 5.18.2-2ubuntu1.7+esm9
    • 5.18.2-2ubuntu1.7+esm10
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • perl Ubuntu Pro 16.04 LTS

    Versions
    • 5.20.2-6
    • 5.22.1-3
    • 5.22.1-4
    • 5.22.1-5
    • 5.22.1-7
    • 5.22.1-8
    All versions (17)
    • 5.22.1-9
    • 5.22.1-9ubuntu0.2
    • 5.22.1-9ubuntu0.3
    • 5.22.1-9ubuntu0.5
    • 5.22.1-9ubuntu0.6
    • 5.22.1-9ubuntu0.9
    • 5.22.1-9ubuntu0.9+esm1
    • 5.22.1-9ubuntu0.9+esm2
    • 5.22.1-9ubuntu0.9+esm3
    • 5.22.1-9ubuntu0.9+esm4
    • 5.22.1-9ubuntu0.9+esm5
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • perl Ubuntu Pro 18.04 LTS

    Versions
    • 5.26.0-8ubuntu1
    • 5.26.1-2ubuntu1
    • 5.26.1-3
    • 5.26.1-4
    • 5.26.1-4build1
    • 5.26.1-5
    All versions (17)
    • 5.26.1-6
    • 5.26.1-6ubuntu0.1
    • 5.26.1-6ubuntu0.2
    • 5.26.1-6ubuntu0.3
    • 5.26.1-6ubuntu0.5
    • 5.26.1-6ubuntu0.6
    • 5.26.1-6ubuntu0.7
    • 5.26.1-6ubuntu0.7+esm2
    • 5.26.1-6ubuntu0.7+esm3
    • 5.26.1-6ubuntu0.7+esm4
    • 5.26.1-6ubuntu0.7+esm5
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • perl Ubuntu Pro 20.04 LTS

    Versions
    • 5.28.1-6build1
    • 5.30.0-7
    • 5.30.0-9
    • 5.30.0-9build1
    • 5.30.0-9ubuntu0.2
    • 5.30.0-9ubuntu0.3
    All versions (12)
    • 5.30.0-9ubuntu0.4
    • 5.30.0-9ubuntu0.5
    • 5.30.0-9ubuntu0.5+esm2
    • 5.30.0-9ubuntu0.5+esm3
    • 5.30.0-9ubuntu0.5+esm4
    • 5.30.0-9ubuntu0.5+esm5
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • perl Ubuntu 22.04 LTS

    Versions
    • 5.32.1-3ubuntu3
    • 5.34.0-3ubuntu1
    • 5.34.0-3ubuntu1.1
    • 5.34.0-3ubuntu1.2
    • 5.34.0-3ubuntu1.3
    • 5.34.0-3ubuntu1.4
    Affected ranges
    • ECOSYSTEM: < 5.34.0-3ubuntu1.5

    Update to 5.34.0-3ubuntu1.5

  • perl Ubuntu 24.04 LTS

    Versions
    • 5.36.0-9ubuntu1
    • 5.36.0-10ubuntu1
    • 5.38.2-3
    • 5.38.2-3.2
    • 5.38.2-3.2build1
    • 5.38.2-3.2build2
    All versions (8)
    • 5.38.2-3.2build2.1
    • 5.38.2-3.2ubuntu0.1
    Affected ranges
    • ECOSYSTEM: < 5.38.2-3.2ubuntu0.2

    Update to 5.38.2-3.2ubuntu0.2

Original sources

Check your server →