/

CVE-2026-11527

Severity:

HIGH RISK

(8.6)

Command Injection (CWE-78) in Perl Config::IniFiles

CVE-2026-11527

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-73, CWE-78

Impact:

Remote Code Execution and File Overwrite

Severity:

HIGH RISK

(8.6)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Config::IniFiles for Perl uses Perl's 2-arg open() on the -file argument, allowing specially crafted filenames to be interpreted as shell commands or redirects.

When untrusted input is passed to the -file parameter, attackers may execute arbitrary OS commands or overwrite files under the process UID.

Affected context

This vulnerability occurs in Perl applications that use Config::IniFiles and pass user-controlled or otherwise untrusted data into the -file argument of Config::IniFiles->new (or related helpers that call _make_filehandle).

The helper uses Perl's two-argument open with the -file value, so any value that looks like a shell pipeline or redirection is treated as a command or redirect rather than a plain filename.

Configurations that only pass static, trusted filenames or scalar references (-file => \$text) are not affected by this behavior.

Exploit preconditions

  • Attack surface: Any Perl code path that calls Config::IniFiles->new(-file => $user_supplied_value) or similar with untrusted input.
  • Required access: Ability to influence the value of the -file argument, such as via HTTP parameters, CLI arguments, environment variables, or config paths.
  • Trigger point: Invocation of _make_filehandle / ReadConfig that passes the attacker-controlled value into Perl's two-argument open.
  • Why exploitation is possible: Two-argument open in Perl interprets filenames starting/ending with | as shell pipelines and those beginning with > or >> as redirections, enabling command execution or file overwrite instead of safe file opening.

Why this happens

The root cause is the use of Perl's two-argument open on a value that can contain untrusted content, without any validation or neutralization of metacharacters.

In this pattern, a nominal "filename" is actually a command string where special prefixes and suffixes (|cmd, cmd|, >file, >>file) change semantics from file access to shell command execution or file redirection.

This maps to CWE-78 (Improper Neutralization of Special Elements used in an OS Command) because shell semantics are implicitly invoked by untrusted data, and to CWE-73 (External Control of File Name or Path) because an attacker controls which file or command the library attempts to access.

The abstraction of a convenient -file parameter hides the underlying open behavior, making it easy for application code to accidentally pass untrusted data into a dangerous sink.

Potential impact

  • Execution of arbitrary OS commands with the privileges of the affected Perl process
  • Overwriting or truncating arbitrary files writable by the process UID
  • Destruction or corruption of configuration, log, or application data
  • Use of the compromised process as a pivot to move laterally within the environment
  • Potential escalation of impact if the application runs with elevated or service-level privileges

General mitigation guidance

Effective mitigation typically involves removing the reliance on two-argument open and treating the -file parameter as a strictly validated filename rather than a free-form command string.

Common defensive patterns include:

  • Ensuring that only trusted, static paths are passed to -file, and never forwarding raw user input or environment values.
  • Validating and normalizing filenames with allowlists (e.g., checking for expected directories and disallowing characters like |, >, <, &, ;).
  • Prefer in-memory parsing with scalar references (-file => \$config_text) when configuration content is generated or received dynamically.
  • Running the Perl process with least privilege, restricting filesystem permissions to limit damage from potential overwrites.
  • Centralizing configuration file handling so the set of permitted file locations and names is narrowly defined and easier to audit.

How teams detect issues like this

Detection efforts can focus on both code-level patterns and runtime behavior.

Typical approaches include:

  • Static analysis checks for uses of Config::IniFiles->new and related functions where -file derives from parameters, environment variables, or other untrusted sources.
  • Grep- or query-based code review to locate -file => call sites and inspect data flow into that argument.
  • Security code review guidelines that flag any two-argument open usage and demand justification, particularly when joined with library helpers that abstract file handling.
  • Runtime logging or security monitoring that alerts on unexpected shell-like tokens (|, >, >>) appearing in configuration file path variables.
  • Incorporating automated scanning tools in CI that can detect dangerous open idioms and unsafe filename handling in Perl codebases.

Sources

SourceLink
github.comgithub.com/shlomif/perl-Config-IniFiles/commit/3e48f9627fbba4dae5de35be1f735cdeb7e47fb8.patch
metacpan.orgmetacpan.org/release/SHLOMIF/Config-IniFiles-3.001000/changes
openwall.comopenwall.com/lists/oss-security/2026/06/14/5
lists.debian.orglists.debian.org/debian-lts-announce/2026/06/msg00026.html

Frequently asked

questions

It can be, if remote inputs (such as HTTP request parameters or data from external systems) are forwarded into the -file argument without proper validation. If all values for -file are locally defined and trusted, remote exploitation is unlikely.

The attacker needs a way to influence or control the value passed to -file. This may be via user-supplied configuration paths, command-line arguments for a script, environment variables, or any other input that flows into the Config::IniFiles constructor.

The safest pattern is to avoid passing untrusted data into -file entirely, validate and constrain all filenames to known-safe directories and formats, and avoid two-argument open semantics for anything that might carry user influence.

Establish a policy that treats all filename and command-related parameters as high-risk, bans or heavily restricts two-argument open, and requires input validation plus code review for any place where libraries accept paths or system-level arguments on behalf of the application.

Find out what's already
exploitable in your codebase.