/

CVE-2026-15392

Severity:

HIGH RISK

(7.7)

Path Traversal (CWE-22) via Symlinks in Perl DBD::File

CVE-2026-15392

Deferred

Vulnerability type

Category:

Path Traversal / Directory Traversal

CWE:

CWE-22, CWE-59

Impact:

Arbitrary File Read/Write Outside Data Directory

Severity:

HIGH RISK

(7.7)

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

DBD::File for Perl fails to prevent table files from being symbolic links pointing outside the configured data directories, enabling path traversal via symlink abuse.

Under deployments where attackers can create or influence table files, this can allow reading from or writing to arbitrary files on the filesystem outside the intended data directory.

Affected context

The vulnerability affects applications using Perl's DBD::File and related file-based DBI drivers that rely on a designated data directory for table storage.

It is relevant when table files within this directory may be created, modified, or influenced by less-trusted users or processes, such as multi-tenant file stores, shared hosting, or applications exposing table creation through user-controlled parameters.

In such cases, a symlink placed within the data directory can silently redirect database operations to files anywhere on the filesystem, bypassing the logical confinement intended by f_dir and f_dir_search.

Exploit preconditions

  • Attack surface: File-based database backends using DBD::File as the storage layer.
  • Required access: Ability to create or manipulate table files or entries within the configured data directory (e.g., creating symlinks, influencing table names, or interacting with a feature that writes table files from user input).
  • Trigger point: Any operation that resolves a table name to a file path using complete_table_name and then performs read or write operations on that file.
  • Why exploitation is possible: The driver constructs absolute paths for table files but does not verify whether the resulting path is a symbolic link targeting locations outside the configured data directories, allowing attacker-controlled symlinks to redirect database I/O.

Why this happens

The core issue is a lack of path canonicalization and validation when resolving table names to filesystem paths.

complete_table_name assumes that any file within the data directory is safe without checking for symbolic links or verifying that the final resolved path remains under f_dir or f_dir_search.

This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory and CWE-59: Improper Link Resolution Before File Access, where the code trusts filesystem links and relative paths without enforcing directory boundaries.

Conceptually, the component treats file-based tables as implicitly trusted just because they originate from the data directory, but it does not confirm that the underlying filesystem object matches that assumption.

Potential impact

  • Reading arbitrary files on the host system that are accessible to the DBD::File process.
  • Overwriting or corrupting files outside the intended data directory, potentially impacting application or system behavior.
  • Exfiltration of sensitive configuration files, credentials, or application data stored elsewhere on the filesystem.
  • Escalation of impact when combined with other weaknesses, such as using writable configuration files or scripts that are later executed.
  • Bypassing logical tenant or application isolation that relies on directory boundaries for separation.

General mitigation guidance

Effective mitigation focuses on enforcing strict filesystem boundaries and treating table paths as untrusted until proven otherwise:

  • Resolve and canonicalize table file paths (e.g., using realpath-like functions) and ensure the final resolved path remains within the configured f_dir or f_dir_search directories before any file I/O.
  • Explicitly reject table paths that are symlinks, or restrict them to symlinks targeting whitelisted locations, depending on deployment requirements.
  • Apply least-privilege principles to the process using DBD::File, limiting its filesystem permissions so even if redirection occurs, accessible files are minimally sensitive.
  • Avoid exposing raw file- or table-name controls directly to end users; introduce validation layers that enforce naming policies and deny potentially malicious patterns.
  • Where feasible, separate data directories per tenant or trust level, and ensure the directories have controlled ownership and permissions that prevent low-privileged users from inserting symlinks.

How teams detect issues like this

Organizations can look for this class of issue using a combination of code, configuration, and runtime checks:

  • Code review: Identify code paths where DBD::File or similar file-based DBI drivers are used; verify that after complete_table_name or equivalent resolution, symlink checks and directory boundary validations are consistently enforced.
  • Static analysis: Implement custom rules or patterns that flag filesystem accesses in database driver code which lack canonicalization, symlink checks, or directory traversal safeguards.
  • Runtime monitoring: Inspect data directories for unexpected symlinks pointing outside the tree; periodically audit directory contents and permissions for anomalies or unowned entries.
  • Policy enforcement: Define internal guidelines for use of file-based database drivers, including mandatory path validation helpers and wrappers, and enforce them via automated checks in CI/CD where possible.

Sources

SourceLink
github.comgithub.com/perl5-dbi/dbi/commit/96d62dfe4528bf56fe13f413ed323d4252531728.patch
github.comgithub.com/perl5-dbi/dbi/security/advisories/GHSA-mh3j-xwf4-jrqw
metacpan.orgmetacpan.org/release/HMBRAND/DBI-1.651/changes
openwall.comopenwall.com/lists/oss-security/2026/07/14/15

Frequently asked

questions

It can be, depending on the application design. If remote users can influence table creation, table names, or write into the data directory (directly or indirectly), then the issue can be exposed over the network; otherwise, it may be limited to local users with filesystem access.

An attacker generally needs the ability to create or manipulate files within the data directory used by DBD::File, or to control table names that the application resolves into files in that directory. This can come from local shell access, misconfigured permissions, or application features that serialize user data into table files.

The safest pattern is to treat all table file paths as untrusted: fully resolve paths, deny symlinks or links that resolve outside the allowed directories, and perform these checks immediately before file open operations. Complement this with strict directory ownership and permission controls to reduce who can create or modify table files.

Adopt a standard approach for filesystem confinement in components that map logical resources to files: use canonical paths, enforce directory whitelisting, disallow or tightly control symlinks, and combine these with least-privilege execution. Establish code review and testing practices specifically focused on path traversal and link resolution behaviors for any file-based storage layer.

Find out what's already
exploitable in your codebase.