Security Advisories (2)
CVE-2024-56406 (2025-04-13)

A heap buffer overflow vulnerability was discovered in Perl. Release branches 5.34, 5.36, 5.38 and 5.40 are affected, including development versions from 5.33.1 through 5.41.10. When there are non-ASCII bytes in the left-hand-side of the `tr` operator, `S_do_trans_invmap` can overflow the destination pointer `d`.    $ perl -e '$_ = "\x{FF}" x 1000000; tr/\xFF/\x{100}/;'    Segmentation fault (core dumped) It is believed that this vulnerability can enable Denial of Service and possibly Code Execution attacks on platforms that lack sufficient defenses.

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

Foo

Bar

Baz

Drink

Sip

Ouch

Drip EOF

is $results, <<'EOF', 'And it should work!'; <ul id="index"> <li> <ul> <li><a href="#Foo">Foo</a> <ul> <li><a href="#Bar">Bar</a></li> </ul> </li> </ul> </li> <li><a href="#Baz">Baz</a> <ul> <li> <ul> <li> <ul> <li><a href="#Drink">Drink</a></li> </ul> </li> <li><a href="#Sip">Sip</a> <ul> <li><a href="#Ouch">Ouch</a></li> </ul> </li> </ul> </li> </ul> </li> <li><a href="#Drip">Drip</a></li> </ul>

<h2 id="Foo">Foo</h2>

<h3 id="Bar">Bar</h3>

<h1 id="Baz">Baz</h1>

<h4 id="Drink">Drink</h4>

<h3 id="Sip">Sip</h3>

<h4 id="Ouch">Ouch</h4>

<h1 id="Drip">Drip</h1>

EOF

initialize($parser, $results); $parser->html_header($header); $parser->html_footer($footer); $parser->backlink(1); ok $parser->parse_string_document( '=head1 Foo' ), 'Parse a header'; is $results, <<'EOF', 'Should have the index and a backlink';

<html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> </head> <body id="_podtop_">

<ul id="index"> <li><a href="#Foo">Foo</a></li> </ul>

<a href="#_podtop_"><h1 id="Foo">Foo</h1></a>

</body> </html>

EOF

initialize($parser, $results); $parser->html_header($header); $parser->html_footer($footer); $parser->backlink(1); ok $parser->parse_string_document( "=head1 Foo \n\n=head2 Bar \n\n=head1 Baz" ), 'Parse headers'; is $results, <<'EOF', 'Should have the index and backlinks';

<html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> </head> <body id="_podtop_">

<ul id="index"> <li><a href="#Foo">Foo</a> <ul> <li><a href="#Bar">Bar</a></li> </ul> </li> <li><a href="#Baz">Baz</a></li> </ul>

<a href="#_podtop_"><h1 id="Foo">Foo</h1></a>

<h2 id="Bar">Bar</h2>

<a href="#_podtop_"><h1 id="Baz">Baz</h1></a>

</body> </html>

EOF

initialize($parser, $results); $parser->html_header($header); $parser->html_footer($footer); $parser->index(0); $parser->backlink(1); ok $parser->parse_string_document( "=head1 Foo \n\n=head1 Bar" ), 'Parse headers'; is $results, <<'EOF', 'Should have backlinks but no index';

<html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> </head> <body id="_podtop_">

<a href="#_podtop_"><h1 id="Foo">Foo</h1></a>

<a href="#_podtop_"><h1 id="Bar">Bar</h1></a>

</body> </html>

EOF

initialize($parser, $results); $parser->html_header($header); $parser->html_footer($footer); $parser->backlink(1); $parser->html_h_level(2); ok $parser->parse_string_document( "=head1 Foo \n\n=head1 Bar" ), 'Parse headers'; is $results, <<'EOF', 'Should have index and backlinks around h2 elements';

<html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> </head> <body id="_podtop_">

<ul id="index"> <li> <ul> <li><a href="#Foo">Foo</a></li> <li><a href="#Bar">Bar</a></li> </ul> </li> </ul>

<a href="#_podtop_"><h2 id="Foo">Foo</h2></a>

<a href="#_podtop_"><h2 id="Bar">Bar</h2></a>

</body> </html>

EOF

initialize($parser, $results); $parser->anchor_items(1); ok $parser->parse_string_document( <<'EOPOD' ), 'Parse POD'; =head1 Foo

test
Test 2

body of item

  • not anchored

  1. still not anchored

is $results, <<'EOF', 'Anchor =item directives'; <ul id="index"> <li><a href="#Foo">Foo</a></li> </ul>

<h1 id="Foo">Foo</h1>

<dl>

<dt id="test">test</dt> <dd>

</dd> <dt id="Test-2">Test 2</dt> <dd>

<p>body of item</p>

</dd> </dl>

<ul>

<li><p>not anchored</p>

</li> </ul>

<ol>

<li><p>still not anchored</p>

</li> </ol>

EOF

initialize($parser, $results); $parser->anchor_items(0); ok $parser->parse_string_document( <<'EOPOD' ), 'Parse POD'; =head1 Foo

test
Test 2

body of item

  • not anchored

  1. still not anchored

<h1 id="Foo">Foo</h1>

<dl>

<dt>test</dt> <dd>

</dd> <dt>Test 2</dt> <dd>

<p>body of item</p>

</dd> </dl>

<ul>

<li><p>not anchored</p>

</li> </ul>

<ol>

<li><p>still not anchored</p>

</li> </ol>

EOF

$ENV{FOO}= 1;

initialize($parser, $results); ok $parser->parse_string_document( <<'EOPOD' ), 'Parse POD'; =head1 Foo

Test links from perlpodspec: "About L<...> Codes"

About L<...> Codes

Here it is EOPOD

my $id = 'About-L...-Codes'; # what should this be?

is $results, <<EOF, 'anchor and h1 use same section id for complex sections'; <ul id="index"> <li><a href="#Foo">Foo</a></li> <li><a href="#$id">About L&lt;...&gt; Codes</a></li> </ul>

<h1 id="Foo">Foo</h1>

<p>Test links from perlpodspec: <a href="#$id">&quot;About L&lt;...&gt; Codes&quot;</a></p>

<h1 id="$id">About L&lt;...&gt; Codes</h1>

<p>Here it is</p>

EOF

sub initialize { $_[0] = Pod::Simple::XHTML->new; $_[0]->html_header(''); $_[0]->html_footer(''); $_[0]->index(1); $_[0]->output_string( \$results ); # Send the resulting output to a string $_[1] = ''; return; }

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 599:

=back doesn't take any parameters, but you said =back EOPOD

Around line 668:

=back doesn't take any parameters, but you said =back EOPOD is $results, <<'EOF', 'Do not anchor =item directives'; <ul id="index"> <li><a href="#Foo">Foo</a></li> </ul>