Today, three new perl versions have been released:

The main reason is two fixed CVE's:

CVE-2023-47038 is only relevant during the use of \p in regexes. This is only a problem if you accept regular expressions from untrusted sources.

update 2023-11-29: Now that the CVE's are getting public, I could add one link.

update 2023-12-02:


CVE-2023-47038

Write past buffer end via illegal user-defined Unicode property

This vulnerability was reported directly to the Perl security team by Nathan Mills the.true.nathan.mills@...il.com.

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


CVE-2023-47039

Perl for Windows binary hijacking vulnerability

This vulnerability was reported to the Intel Product Security Incident Response Team (PSIRT) by GitHub user ycdxsb https://github.com/ycdxsb/WindowsPrivilegeEscalation. PSIRT then reported it to the Perl security team.

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.


Enjoy, Have FUN! H.Merijn

Replies are listed 'Best First'.
Re: THREE new perl releases
by Polyglot (Chaplain) on Nov 26, 2023 at 13:54 UTC
    CVE-2023-47038 is only relevant during the use of \p in regexes. This is only a problem if you accept regular expressions from untrusted sources.

    Interesting. I guess they can't blame me for this, as I haven't released my Thai module yet! (However, I have no idea why or how such an error could occur simply with the use of \p{...} characters in one's regex--how can a unicode property definition be illegal?)

    For what it's worth, I discovered that my nomenclature for the \p{...} characters was illegal--but they never produced an error message like that...they just didn't work, as if they had not been defined or imported. I learned that there are only two possibilities with names of unicode properties:

    \p{InProperty} \p{IsProperty}

    Using something like '\p{Property}' is illegal--it must be prefixed by either "In" or by "Is" or Perl will not accept it or recognize it.

    But the error shown here in the OP doesn't appear to have much to do with this, leaving me to wonder what it is for.

    Blessings,

    ~Polyglot~

      Its because perl regexp itself is coded in C. In this case the code for /p was stripping 'utf8::' from the string, but not adjusting the position/length of the buffer properly to account for that stripping along all code paths, allowing you to craft a buffer overflow exploit.
Re: THREE new perl releases [Updated releases!]
by kcott (Archbishop) on Nov 30, 2023 at 04:53 UTC

      5.38.1 installed normally for me on 10+ installations and works fine with the 100+ modules i installed.

      From what i can tell, the main change in the new release is Module::CoreList, which should be easily fixable by installing the new version on the existing 5.38.1 installation.

      But of course, since the new Perl release also comes with a new B::Op_private, ye olde cpan upgrade will fail with an error in the middle of the process :-(

      To be clear, i'm not complaining that perlporters had to make an emergency bugfix release; in fact i'm glad that everyone reacted quickly and efficiently. I'm just frustrated that all the work i did monday was now made worse-than-useless, and i have to run through that whole process again. If this problem had happened on a normal feature relase, i wouldn't have started the upgrade process for a couple of weeks. But since it was an important patch for some security problems, i started right away...

      Oh well, back to building pyramids.

      PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP

        G'day cavac,

        I posted "Updated releases!" as soon as I became aware of the newer versions. I did actually think of you, as you'd written:

        "Guess i'll be spending most of today reinstalling Perl+Modules on my 15+ systems i administrate..."

        Hoping 🏗️◭◮ is not too onerous.

        — Ken

      Having been burnt before, I had the luxury of being able to wait a few days (unlike cavac).

      With no new PM questions posted today, I decided to build perl v5.38.2 from source, using the same steps as last time (but installed into $HOME/my/p5382 this time, i.e. $ type perl - perl is hashed $HOME/my/p5382/bin/perl) and it seems to be working nicely so far, at least kcott's and Tux's superb Unicode utilities are both working flawlessly. :)

      Of course, having just completed that chore, I'm half expecting an urgent new perl v5.38.3 to be rushed out tomorrow (hope saying that doesn't jinx cavac's pyramid building :).

      See Also

      • Perl Download (perl.org) - getting started quickly (notes the latest stable version)
      • CPAN Perl source code (cpan.org) - how to build/install perl from source (notes the latest stable version)

      Extra Modules Installed Later (Update)

      Got errors using kcott's perlu alias (described at Re^2: Another Unicode/emoji question) ... to remedy, installed IPC::System::Simple:

      $ alias perlu='perl -Mstrict -Mwarnings -Mautodie=:all -Mutf8 -C -E' $ type perlu perlu is aliased to `perl -Mstrict -Mwarnings -Mautodie=:all -Mutf8 -C + -E' $ perlu 'say chr 0x1f436; say chr 128054;' IPC::System::Simple required for Fatalised/autodying system() at -e li +ne 0. main::BEGIN() called at -e line 0 eval {...} called at -e line 0 BEGIN failed--compilation aborted.

      As noted at SO question, it seems strange that a core functionality requires a non-core module, and quietly too (doesn't complain at installation). See also: perl-autodie missing dependency for IPC::System::Simple (RedHat bugzilla).

      This fixed my perlu issue:

      $ type perl perl is hashed ($HOME/my/p5382/bin/perl) $ cd $HOME/my/p5382 $ cpanm --from https://www.cpan.org/ --verify IPC::System::Simple 2>&1 + | tee IPC-System-Simple.tmp --> Working on IPC::System::Simple Fetching https://www.cpan.org/authors/id/J/JK/JKEENAN/IPC-System-Simpl +e-1.30.tar.gz ... OK Fetching https://www.cpan.org/authors/id/J/JK/JKEENAN/CHECKSUMS ... OK Configuring IPC-System-Simple-1.30 ... OK Building and testing IPC-System-Simple-1.30 ... OK Successfully installed IPC-System-Simple-1.30 1 distribution installed

      $ perlu 'say chr(0x1f436); say chr(128054);'
      🐶
      🐶
      $ perlu 'say "\x{1f436}"'
      🐶
      $ perlu 'say "\N{DOG FACE}"'
      🐶
      $ echo -e '\U1f436'
      🐶

      For more detail on perl character escapes see: perlrebackslash (perldoc)

      Later, installed Data::Dump and List::MoreUtils and Module::Starter:

      $ cd $HOME/my/p5382 $ cpanm --from https://www.cpan.org --verify Data::Dump 2>&1 | tee Dat +a-Dump.tmp $ cpanm --from https://www.cpan.org --verify List::MoreUtils 2>&1 | te +e List-MoreUtils.tmp $ cpanm --from https://www.cpan.org --verify Module::Starter 2>&1 | te +e Module-Starter.tmp

      TODO: Install more CPAN modules (e.g. List::AllUtils and stuff by PEVANS e.g. List::UtilsBy, List::Keywords, ...). Further analysis of perlrun and utf8.

      👁️🍾👍🦟
Re: THREE new perl releases
by kcott (Archbishop) on Nov 27, 2023 at 18:16 UTC

      Hah, changing the subject :)

      Test::CVE uses a database with known CPAN vulnerabilities and the versions in where these were fixed. By scanning <cpanfile</c>, Makefile.PL and possible other sources, the module looks for required and use modules/releases and possible declared versions. It will report if the declared version is open to CVE's. The advice from the security group would be to either require the version that fixed the CVE(s) or to make that version a recommendation and document that when using the older version, you are on your own.

      As you stated, \p{...} would *not* be picked up by this module.


      Enjoy, Have FUN! H.Merijn
Re: THREE new perl releases
by kcott (Archbishop) on Nov 28, 2023 at 21:30 UTC
Re: THREE new perl releases
by cavac (Prior) on Nov 27, 2023 at 06:53 UTC

    CVE-2023-47038 is only relevant during the use of \p in regexes.

    While im certain i don't use that construct in any of my codebases, i don't really have the week or so it takes to audit *all* my dependencies. Guess i'll be spending most of today reinstalling Perl+Modules on my 15+ systems i administrate...

    PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP