Home / Alt manpages / perl5163delta(1)

  • perl5163delta(1)
  • User command
  • linux

Audit a Perl 5.16.3 Upgrade for Security Fixes

You will finish with a short, evidence-based check for whether a Perl installation is older than 5.16.3, what the release fixed, and which module versions the release notes mention. The local manpage is rendered by Perl 5.38.2, but its subject is the historical upgrade from Perl 5.16.2 to 5.16.3.

Allow about 15 minutes for a single host, plus whatever time your normal package change process requires. You need a shell and a Perl interpreter. The inspection steps are read-only. Installing or upgrading Perl changes system state and may affect applications, so take a package-manager backup or use your normal maintenance window before doing that part.

1. Record the Perl version in use

Start with the interpreter that your application or shell will actually run. Do not infer the version from a distribution name or from a module directory:

$ command -v perl
/usr/bin/perl
$ perl -e 'printf "%vd\n", $^V'
v5.38.2

The $^V value is the Perl interpreter version. This host reports 5.38.2, which is newer than 5.16.3. That answers the narrow version question, but it does not prove that an application is using this interpreter. A service may have its own Perl in a virtual environment, a container or a separately configured path.

Checkpoint

Save both the path and the version in your change notes. If command -v points somewhere unexpected, stop and inspect the service definition before assessing the result.

2. Compare the result with the release boundary

Use a numeric comparison instead of sorting version strings as text. This command exits successfully when the running interpreter is at least 5.16.3:

if perl -e 'exit $^V ge v5.16.3 ? 0 : 1'; then
    printf '%s\n' 'Perl is at least 5.16.3'
else
    printf '%s\n' 'Perl is older than 5.16.3'
fi

Perl's version objects make the comparison numeric by component, so 5.16.10 is not mistaken for an older release than 5.16.3. This check is a decision aid, not a vulnerability scanner. It does not identify backported distribution fixes, vendor patches or application-specific dependencies. Ask the package maintainer for that information when the version is supplied by an operating system.

3. Understand what 5.16.3 fixed

The perl5163delta page describes differences from 5.16.2. It reports no new core enhancements, no intentional incompatibilities with 5.16.0, no new deprecations and no known problems. The useful change is in security and in the bundled module versions.

  • CVE-2013-1667 allowed carefully crafted hash keys, such as URL arguments, to consume excessive memory and CPU. The release notes describe this as a possible denial-of-service condition and say it was fixed.
  • Input or output strings larger than 2**31 bytes could segfault because of integer wrap-around. That issue was fixed.
  • A memory leak in the UTF-8 implementation in Encode was fixed.

These are historical release notes, not permission to treat every Perl 5.16.3-or-newer interpreter as current. A modern supported Perl release and a current operating system package are the safer target. If a legacy application must remain on 5.16, record why and keep its exposure, input limits and patch source under review.

4. Check the named module versions

The release notes list three updated components. Inspect the first two directly with the interpreter you recorded:

$ perl -MEncode -e 'print "$Encode::VERSION\n"'
3.19
$ perl -MModule::CoreList -e 'print "$Module::CoreList::VERSION\n"'
5.20231129

On this host, those versions are much newer than the 5.16.3 module versions, which were Encode 2.44_01 and Module::CoreList 2.76_02. The third entry, XS::APItest 0.39, is a test module rather than a normal application dependency. It may not be installed at all:

$ perl -MXS::APItest -e 'print "$XS::APItest::VERSION\n"'
Can't locate XS/APItest.pm in @INC ...

A missing XS::APItest is not evidence that the Perl interpreter lacks the 5.16.3 fixes. Do not install it merely to make this audit look complete. Install test modules only when a build or test suite explicitly requires them.

5. Check the application boundary

Repeat the version check in the account and environment that launch the application. For a systemd service, inspect its configured executable and environment before changing anything:

$ systemctl cat YOUR_SERVICE.service
$ sudo -u YOUR_SERVICE_USER command -v perl
$ sudo -u YOUR_SERVICE_USER perl -e 'printf "%vd\n", $^V'

Replace the two uppercase placeholders with real values. The first command is read-only. The last command uses sudo only if the service account cannot be selected without it. Do not copy a service name from an example and do not restart the service as part of this audit.

Compare this result with the interactive shell result. If they differ, the service may use an absolute interpreter path, a wrapper or a different container image. Fix the deployment source that actually controls the process, then rerun the check. Checking /usr/bin/perl alone is not enough.

6. Plan and verify the change

If a host is below 5.16.3, use the operating system's supported package or a reviewed, reproducible build. Do not replace /usr/bin/perl by hand while services are running. Before an upgrade, capture package state and run the application's tests. After it, run the same version command under the application account and verify the service's health checks.

There is no undo command in this guide because no upgrade command is supplied. Recovery depends on the package manager or deployment system: use its recorded package version or release artefact to roll back, then restore the previous service configuration and rerun the health checks. Treat a failed rollback as an incident rather than repeatedly changing Perl installations in place.

Done means

  • You recorded the actual Perl path and interpreter version.
  • You compared the interpreter with the 5.16.3 boundary without parsing text output.
  • You accounted for the hash-key denial-of-service, large-string wrap-around and Encode leak fixes.
  • You checked the Perl environment used by the application, not only your shell.
  • You have a supported upgrade and rollback path before changing a legacy host.