Cloudanix VulnDB

CVE-2016-1238

High · 7.8

CVSS

7.8

EPSS

0.8%

Published

Aug 2, 2016

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

Certain helper programs that come with older versions of a common scripting language can be tricked into running attacker-supplied code instead of the legitimate version when launched from the wrong folder.

Exploitation
Local Privilege
Attacker needs
Local User
Complexity
Low
Impact
Privilege Gain
Component
Application
Class
Privilege Escalation
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

The flaw fails to strip trailing dot characters from the @INC array in multiple Perl utility scripts, allowing a module named after a core module to be loaded from the current working directory instead of the intended system path.

Why it matters to the business

Local attackers can execute arbitrary code with the privileges of the user running the affected Perl tools, leading to unauthorized access, data tampering, or further system compromise on any system using the vulnerable Perl distribution or dependent packages.

How an attack unfolds

An attacker places a malicious Perl module with the same name as a standard library module in a directory from which a vulnerable Perl script is executed; when the script runs, the unstripped dot in @INC causes the malicious module to be loaded, granting the attacker code execution in the context of the calling user.

How to fix it

Upgrade affected Perl installations to 5.22.3-RC2 or 5.24.1-RC2 (or later stable releases) and apply the corresponding phpmyadmin/phpmyadmin GIT commit 8b48c1998d9f898a17b810ccaa396ae4da863176 or newer to ensure bundled utilities are corrected.

How to confirm the fix worked

Confirm Perl version is at or above the fixed releases, verify that the listed scripts no longer contain the trailing-dot handling bug in their @INC processing, and test that modules are no longer loaded from the current working directory when a system copy exists.

Typical attack path

  1. Identify a user or process that executes one of the listed Perl utilities from an attacker-writable directory.
  2. Create a Trojan horse .pm file matching a module name imported by the target script.
  3. Trigger execution of the vulnerable Perl script so that the current directory is searched first.
  4. Execute attacker-controlled code with the privileges of the script runner.

How to detect it

Review process creation logs and command-line history for execution of the listed Perl utilities (ptar, prove, perldoc, etc.) from user-writable directories; inspect recent .pm files created in working directories alongside those executions; correlate with unexpected privilege changes or new processes spawned by the same user context.

What your security team should do

  • Apply the fixed Perl and phpmyadmin versions immediately on all systems that ship or invoke the affected utilities.
  • Audit scheduled jobs and user workflows that execute Perl scripts from untrusted directories and relocate them to trusted paths.
  • Disable or remove unnecessary Perl development and utility scripts from production environments.
  • Monitor for new local accounts or unexpected module loads following any execution of the listed scripts.

The record

(1) cpan/Archive-Tar/bin/ptar, (2) cpan/Archive-Tar/bin/ptardiff, (3) cpan/Archive-Tar/bin/ptargrep, (4) cpan/CPAN/scripts/cpan, (5) cpan/Digest-SHA/shasum, (6) cpan/Encode/bin/enc2xs, (7) cpan/Encode/bin/encguess, (8) cpan/Encode/bin/piconv, (9) cpan/Encode/bin/ucmlint, (10) cpan/Encode/bin/unidump, (11) cpan/ExtUtils-MakeMaker/bin/instmodsh, (12) cpan/IO-Compress/bin/zipdetails, (13) cpan/JSON-PP/bin/json_pp, (14) cpan/Test-Harness/bin/prove, (15) dist/ExtUtils-ParseXS/lib/ExtUtils/xsubpp, (16) dist/Module-CoreList/corelist, (17) ext/Pod-Html/bin/pod2html, (18) utils/c2ph.PL, (19) utils/h2ph.PL, (20) utils/h2xs.PL, (21) utils/libnetcfg.PL, (22) utils/perlbug.PL, (23) utils/perldoc.PL, (24) utils/perlivp.PL, and (25) utils/splain.PL in Perl 5.x before 5.22.3-RC2 and 5.24 before 5.24.1-RC2 do not properly remove . (period) characters from the end of the includes directory array, which might allow local users to gain privileges via a Trojan horse module under the current working directory.

Affected packages

Ecosystem Package Introduced Fixed
Alpine:v3.10 spamassassin 0 3.4.2-r0
Alpine:v3.11 spamassassin 0 3.4.2-r0
Alpine:v3.12 spamassassin 0 3.4.2-r0
Alpine:v3.13 spamassassin 0 3.4.2-r0
Alpine:v3.14 spamassassin 0 3.4.2-r0
Alpine:v3.15 spamassassin 0 3.4.2-r0
Alpine:v3.16 spamassassin 0 3.4.2-r0
Alpine:v3.17 spamassassin 0 3.4.2-r0
Alpine:v3.18 spamassassin 0 3.4.2-r0
Alpine:v3.19 spamassassin 0 3.4.2-r0
Alpine:v3.20 spamassassin 0 3.4.2-r0
Alpine:v3.21 spamassassin 0 3.4.2-r0
Alpine:v3.22 spamassassin 0 3.4.2-r0
Alpine:v3.3 perl 0 5.22.3-r0
Alpine:v3.4 perl 0 5.22.3-r0
Alpine:v3.8 spamassassin 0 3.4.3-r0
Alpine:v3.9 spamassassin 0 3.4.2-r0
Debian:11 perl 0 5.22.2-3
Debian:12 perl 0 5.22.2-3
Debian:13 perl 0 5.22.2-3
Debian:14 perl 0 5.22.2-3
Debian:7 libsys-syslog-perl 0 0.29-1+deb7u1
Debian:7 perl 0 5.14.2-21+deb7u4
Debian:8 perl 0 5.20.2-3+deb8u6
Debian:8 spamassassin 0 3.4.2-0+deb8u1
Mageia:5 perl 0 5.20.1-8.7.mga5
Mageia:5 perl-File-Path 0 2.90.0-4.1.mga5
Mageia:5 perl-MIME-Charset 0 1.11.1-4.1.mga5
Mageia:5 perl-MIME-EncWords 0 1.14.2-4.1.mga5
Mageia:5 perl-Module-Build 0 0.421.0-5.1.mga5
Mageia:5 perl-Module-Load-Conditional 0 0.680.0-1.mga5
Mageia:5 perl-Net-DNS 0 1.90.0-0.mga5
Mageia:5 perl-Sys-Syslog 0 0.330.0-7.1.mga5
Mageia:5 perl-Unicode-LineBreak 0 2014.60.0-5.1.mga5
Mageia:5 perl-libintl-perl 0 1.230.0-6.1.mga5
Mageia:6 spamassassin 0 3.4.2-1.5.mga6
Mageia:6 spamassassin-rules 0 3.4.2-1.1.mga6
SUSE:Linux Enterprise Desktop 12 SP1 perl 0 5.18.2-11.1
SUSE:Linux Enterprise Desktop 12 SP4 spamassassin 0 3.4.2-44.3.1
SUSE:Linux Enterprise Module for Basesystem 15 amavisd-new 0 2.11.1-6.3.1
SUSE:Linux Enterprise Module for Basesystem 15 spamassassin 0 3.4.2-7.4.1
SUSE:Linux Enterprise Module for Development Tools 15 spamassassin 0 3.4.2-7.4.1
SUSE:Linux Enterprise Server 11 SP4 perl 0 5.10.0-64.80.1
SUSE:Linux Enterprise Server 12 SP1 perl 0 5.18.2-11.1
SUSE:Linux Enterprise Server 12 SP4 spamassassin 0 3.4.2-44.3.1
SUSE:Linux Enterprise Server for SAP Applications 11 SP4 perl 0 5.10.0-64.80.1
SUSE:Linux Enterprise Server for SAP Applications 12 SP1 perl 0 5.18.2-11.1
SUSE:Linux Enterprise Server for SAP Applications 12 SP4 spamassassin 0 3.4.2-44.3.1
SUSE:Linux Enterprise Software Development Kit 11 SP4 perl 0 5.10.0-64.80.1
Ubuntu:14.04:LTS libsys-syslog-perl 0 0.33-1+deb8u1build0.14.04.1
Ubuntu:Pro:14.04:LTS perl 0 No fix
Ubuntu:Pro:16.04:LTS perl 0 No fix
openSUSE:Leap 15.0 spamassassin 0 3.4.2-lp150.6.3.1
openSUSE:Tumbleweed ikiwiki 0 3.20200202.3-2.7
openSUSE:Tumbleweed perl-ExtUtils-MakeMaker 0 7.64-1.1
openSUSE:Tumbleweed perl-IO-Compress 0 2.213.0-1.1
openSUSE:Tumbleweed perl-MIME-Charset 0 1.012.2-1.16
openSUSE:Tumbleweed perl-Test-File 0 1.448-1.5

Related vulnerabilities