Cloudanix VulnDB

CVE-2016-6185

High · 7.8

CVSS

7.8

EPSS

0.8%

Published

Aug 2, 2016

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A problem in the Perl programming language lets someone who already has access to a computer run their own code by leaving a fake library file in the folder where programs are running.

Exploit Available
Exploitation
Local Privilege
Attacker needs
Local User
Complexity
Low
Impact
Full Compromise
Component
Library
Class
Other
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

XSLoader::load fails to resolve .so paths correctly inside string eval, causing Perl to load a library from the current working directory instead of the system path and enabling local arbitrary code execution.

Why it matters to the business

Local attackers can execute arbitrary code on any system running affected Perl versions, leading to full host compromise, data theft, or lateral movement; the issue affects widely used Perl deployments and downstream packages but carries low exploitation likelihood.

How an attack unfolds

An attacker with local access places a malicious .so file matching the expected module name in a directory from which a Perl process will later run, then triggers XSLoader::load inside a string eval context so that the Trojan library is loaded instead of the legitimate one.

How to fix it

Upgrade perl/perl5 to commit c137098022dcef5e7ea32608e5299276efea6457 or later; for prometheus-postgres-exporter-0.10 (Chainguard) upgrade to the fixed 0 release that bundles the patched Perl.

How to confirm the fix worked

Confirm the perl5 source contains commit c137098022dcef5e7ea32608e5299276efea6457; run a test script that calls XSLoader::load in string eval and verify it no longer searches the current working directory.

Typical attack path

  1. Locate or create a Perl script or module that invokes XSLoader::load inside a string eval
  2. Compile or copy a malicious .so into the current working directory using the expected module name
  3. Cause the vulnerable Perl code path to execute (via cron, web request, or scheduled task)
  4. Malicious library is loaded and attacker code runs with the privileges of the Perl process

How to detect it

Search application and system logs for Perl processes loading unexpected shared libraries; inspect working directories of Perl processes for recently added .so files whose names match modules loaded via XSLoader.

  • unexpected .so file matching XSLoader module name in cwd
  • Perl process loading library from current working directory instead of system path

What your security team should do

  • Immediately patch all Perl installations to the fixed commit or newer release
  • Audit codebases for XSLoader usage inside string eval and refactor to avoid the pattern
  • Restrict write access to directories used as working directories by Perl processes
  • Add filesystem monitoring for unexpected .so files in application working directories

The record

The XSLoader::load method in XSLoader in Perl does not properly locate .so files when called in a string eval, which might allow local users to execute arbitrary code via a Trojan horse library under the current working directory.

Affected packages

Ecosystem Package Introduced Fixed
Debian:11 perl 0 5.22.2-2
Debian:12 perl 0 5.22.2-2
Debian:13 perl 0 5.22.2-2
Debian:7 perl 0 5.14.2-21+deb7u4
Debian:8 perl 0 5.20.2-3+deb8u6
Mageia:5 perl-XSLoader 0 0.160.0-7.1.mga5
SUSE:Linux Enterprise Desktop 12 SP1 perl 0 5.18.2-11.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 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 Software Development Kit 11 SP4 perl 0 5.10.0-64.80.1
Ubuntu:14.04:LTS perl 0 5.18.2-2ubuntu1.4
Ubuntu:16.04:LTS perl 0 5.22.1-9ubuntu0.3

Related vulnerabilities