CVE-2016-2381
High · 7.5CVSS
7.5
EPSS
9.1%
Published
Apr 8, 2016
CISA due date
—
Cloudanix analysis
A long-standing issue in Perl lets attackers sneak untrusted data past safety checks when starting helper programs, which could let bad input affect how those programs behave.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Data Tampering
- Component
- Application
- Class
- Improper Input Validation
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
The flaw permits duplicate environment variables in envp to be passed to a child process, allowing context-dependent attackers to bypass Perl's taint protection mechanism and supply untrusted data that would otherwise be rejected.
Why it matters to the business
Organizations running affected Perl versions risk integrity violations in child processes that rely on taint checking, potentially allowing malicious input to influence execution in long-lived or legacy deployments that have not applied the 2016 fix.
How an attack unfolds
An attacker supplies a crafted environment containing duplicate variable entries when spawning a Perl child process; the duplicate bypasses taint validation, letting untrusted data reach code paths that assume sanitized input.
How to fix it
Upgrade perl/perl5 to the commit 8f6d78186d3cbb6ae14697aeb3f10a2273fcbd6f or later; rebuild and redeploy any embedded or packaged Perl interpreters; verify the fix is present before re-enabling taint-dependent workflows.
How to confirm the fix worked
Confirm the installed Perl source contains commit 8f6d78186d3cbb6ae14697aeb3f10a2273fcbd6f; run regression tests that exercise taint checks with duplicate environment variables to ensure bypass is no longer possible.
Typical attack path
- Identify a Perl application or script that forks child processes and relies on taint mode for input validation.
- Craft a request or invocation that injects duplicate environment variables into envp.
- Trigger the child process creation so the duplicate entries reach the taint-checking logic.
- Supply attacker-controlled values that would normally be rejected, achieving integrity impact on the child process.
How to detect it
Review process creation logs and environment-variable dumps around Perl child-process invocations for duplicate variable names; correlate with application error or taint-warning logs that suddenly disappear after an unexpected environment change.
What your security team should do
- Apply the fixed commit immediately on any internet-facing or multi-tenant Perl deployments.
- Inventory all Perl-based services and scripts that enable taint mode and schedule upgrades.
- Add environment-variable sanitization at the process-launch layer as a defense-in-depth measure.
- Monitor upstream Perl releases for any related taint or environment-handling changes.
The record
Perl might allow context-dependent attackers to bypass the taint protection mechanism in a child process via duplicate environment variables in envp.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | perl | 0 | 5.22.1-8 |
| Debian:12 | perl | 0 | 5.22.1-8 |
| Debian:13 | perl | 0 | 5.22.1-8 |
| Debian:7 | perl | 0 | 5.14.2-21+deb7u3 |
| Debian:8 | perl | 0 | 5.20.2-3+deb8u4 |
| Mageia:5 | perl | 0 | 5.20.1-8.2.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.1 |
| Ubuntu:16.04:LTS | perl | 0 | 5.22.1-8 |
Related vulnerabilities
- CVE-2025-40909 Perl threads have a working directory race condition where file operations may target… Also affects perl
- CVE-2020-16156 CPAN 2.28 allows Signature Verification Bypass. Also affects perl
- CVE-2017-12883 Buffer overflow in the S_grok_bslash_N function in regcomp.c in Perl 5 before 5.24.3-RC1… Also affects perl
- CVE-2017-12837 Heap-based buffer overflow in the S_regatom function in regcomp.c in Perl 5 before… Also affects perl
- CVE-2017-6512 Race condition in the rmtree and remove_tree functions in the File-Path module before… Also affects perl
- CVE-2016-6185 The XSLoader::load method in XSLoader in Perl does not properly locate .so files when… Also affects perl
- CVE-2016-1238 (1) cpan/Archive-Tar/bin/ptar, (2) cpan/Archive-Tar/bin/ptardiff, (3)… Also affects perl
- CVE-2015-8853 The (1) S_reghop3, (2) S_reghop4, and (3) S_reghopmaybe3 functions in regexec.c in Perl… Also affects perl