p PatchFirst

CVE-2026-19487

CVE-2026-19487 · Perl versions from 5.9.4 before 5.41.9 produce incorrect regular expression match results when a stale failure flag ends the Aho-Corasick prescan early in S_find_byclass

CVSS 5.3 · Medium · EPSS 0.6% · Fix available

Compare with your installed version

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

  • perl Debian 12Update to 5.36.0-7+deb12u4
  • perl Debian 13Update to 5.40.1-6+deb13u1
  • perl Debian 14Update to 5.42.2-3
  • perl Ubuntu Pro 14.04 LTSUpdate to 5.18.2-2ubuntu1.7+esm9
  • 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 versions from 5.9.4 before 5.41.9 produce incorrect regular expression match results when a stale failure flag ends the Aho-Corasick prescan early in S_find_byclass.

The prescan walks the subject for positions where the full pattern could match, and the engine tries it from the leftmost one recorded. A failing transition sets the failed flag, and a later successful transition does not clear it, so the prescan reads the stale flag as a failure and stops before it can record a candidate that starts earlier. It takes a subject where one candidate is recorded and a later character then forces a fallback through a fail link that succeeds.

Example:

"ABCDE" =~ m/ABCF|BCDE|C/; # matches C at offset 2, not BCDE "ABCDE" =~ m/ABCF|BCDE|C(G)/; # no match, BCDE missed

An alternation like this can miss input it should match, or match it on the wrong branch, so an access or filtering decision made from the result can be wrong.

Published
Updated

Fixes in distributions

  • DLA-4821-1 · Debian 12 ·
  • USN-8736-2 · Ubuntu 24.04 LTS ·
  • USN-8736-1 · Ubuntu 22.04 LTS, Ubuntu 26.04 LTS, Ubuntu Pro 14.04 LTS, Ubuntu Pro 16.04 LTS, Ubuntu Pro 18.04 LTS, Ubuntu Pro 20.04 LTS ·

Stack: system

Affected products and versions

  • perl Debian 12

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

    Update to 5.36.0-7+deb12u4

  • perl Debian 13

    Versions
    • 5.40.1-6
    Affected ranges
    • ECOSYSTEM: < 5.40.1-6+deb13u1

    Update to 5.40.1-6+deb13u1

  • perl Debian 14

    Versions
    • 5.40.1-6
    • 5.40.1-7
    • 5.40.1-8
    • 5.42.0-1
    • 5.42.0-2
    • 5.42.0-3
    All versions (8)
    • 5.42.2-1
    • 5.42.2-2
    Affected ranges
    • ECOSYSTEM: < 5.42.2-3

    Update to 5.42.2-3

  • 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 (16)
    • 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
    Affected ranges
    • ECOSYSTEM: < 5.18.2-2ubuntu1.7+esm9

    Update to 5.18.2-2ubuntu1.7+esm9

  • 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 (15)
    • 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
    Affected ranges
    • ECOSYSTEM: < 5.22.1-9ubuntu0.9+esm4

    Update to 5.22.1-9ubuntu0.9+esm4

  • 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 (15)
    • 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
    Affected ranges
    • ECOSYSTEM: < 5.26.1-6ubuntu0.7+esm4

    Update to 5.26.1-6ubuntu0.7+esm4

  • 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 (10)
    • 5.30.0-9ubuntu0.4
    • 5.30.0-9ubuntu0.5
    • 5.30.0-9ubuntu0.5+esm2
    • 5.30.0-9ubuntu0.5+esm3
    Affected ranges
    • ECOSYSTEM: < 5.30.0-9ubuntu0.5+esm4

    Update to 5.30.0-9ubuntu0.5+esm4

  • 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
    All versions (9)
    • 5.34.0-3ubuntu1.5
    • 5.34.0-3ubuntu1.7
    • 5.34.0-3ubuntu1.8
    Affected ranges
    • ECOSYSTEM: < 5.34.0-3ubuntu1.9

    Update to 5.34.0-3ubuntu1.9

  • 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 (11)
    • 5.38.2-3.2build2.1
    • 5.38.2-3.2ubuntu0.1
    • 5.38.2-3.2ubuntu0.2
    • 5.38.2-3.2ubuntu0.3
    • 5.38.2-3.2ubuntu0.4
    Affected ranges
    • ECOSYSTEM: < 5.38.2-3.2ubuntu0.6

    Update to 5.38.2-3.2ubuntu0.6

  • perl Ubuntu 26.04 LTS

    Versions
    • 5.40.1-6build1
    • 5.40.1-7build1
    • 5.40.1-7ubuntu0.1
    Affected ranges
    • ECOSYSTEM: < 5.40.1-7ubuntu0.2

    Update to 5.40.1-7ubuntu0.2

Original sources

Check your server →