Severity:

HIGH RISK

(7.3)

Path Traversal in IOPaint File Manager _get_file Function

CVE-2026-5258

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Unauthorized File System Access

Severity:

HIGH RISK

(7.3)

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

A path traversal vulnerability in the IOPaint File Manager's _get_file function allows attackers to manipulate the filename parameter to access arbitrary files on the server.

When exposed over the network, this flaw can enable remote attackers to read files outside the intended directory scope, depending on the server's filesystem permissions.

Affected context

The issue occurs within the File Manager component of Sanster IOPaint 1.5.3, specifically in iopaint/file_manager/file_manager.py in the _get_file function.

It is relevant when the application:

  • Accepts a filename parameter from an HTTP or remote request
  • Uses this value to construct filesystem paths
  • Lacks strict normalization and restriction to a defined base directory

Any deployment exposing the File Manager endpoint over a network may be affected, especially if the process has read access to sensitive files.

Exploit preconditions

  • Attack surface: Remote HTTP or API interface exposing the File Manager functionality
  • Required access: Ability to send crafted requests that control the filename parameter (no local shell access required)
  • Trigger point: Invocation of the _get_file function when the server processes a file retrieval request
  • Why exploitation is possible: User-controlled path segments are concatenated or resolved into filesystem paths without robust validation, allowing directory traversal sequences (e.g., parent directory references) to escape the intended directory.

Why this happens

This vulnerability stems from improper restriction of relative paths when constructing filesystem paths, aligning with CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

The _get_file function likely trusts the filename parameter and combines it with a base directory without:

  • Canonicalizing the path and checking it remains within an allowed root
  • Filtering or rejecting directory traversal sequences
  • Enforcing a whitelist of permitted paths or file identifiers

As a result, attackers can craft a filename value that navigates out of the intended directory and into other locations on the server's filesystem, potentially exposing sensitive application or system files.

Potential impact

  • May allow reading of configuration files containing secrets, API keys, or database credentials
  • Could expose source code, internal scripts, or templates revealing further vulnerabilities
  • Can leak system files and environment details that aid in reconnaissance
  • Might bypass logical access controls on files that should not be directly accessible to the requester
  • In chained attacks, could facilitate credential theft or support escalation to remote code execution via other weaknesses

General mitigation guidance

Effective mitigation focuses on treating file paths derived from user input as untrusted and constraining them to a well-defined directory.

Common defensive patterns include:

  • Resolving requested paths to their canonical/absolute form and verifying they remain under a configured base directory
  • Rejecting any input containing directory traversal tokens or unexpected path separators when not explicitly required
  • Using an internal identifier (e.g., file IDs or database keys) instead of directly passing filenames or paths from clients
  • Providing access only to whitelisted directories or explicitly enumerated files
  • Running the application under a dedicated, least-privileged account with restricted filesystem permissions so that even if traversal is attempted, sensitive system locations are not readable

How teams detect issues like this

Detection can combine code-centric and runtime approaches:

  • Static analysis: Scan for file operations where user-controlled data flows into functions like open, os.path.join, or similar APIs without normalization and boundary checks; flag concatenation of request parameters into paths.
  • Code review signals: Look for endpoints that expose file download or preview features, especially where path construction uses raw request parameters or lacks base-directory enforcement.
  • Policy enforcement: Apply secure coding guidelines requiring canonicalization and base-directory validation for all file access routines; enforce these via automated linters or pre-commit hooks.
  • Runtime monitoring: Inspect logs for suspicious filename values containing traversal patterns; configure WAF rules to flag or block requests with repeated parent-directory sequences.

Sources

SourceLink
github.comgithub.com/August829/CVEP/issues/11
vuldb.comvuldb.com/submit/780666
vuldb.comvuldb.com/vuln/354448
vuldb.comvuldb.com/vuln/354448/cti

Frequently asked

questions

Yes. As described, the vulnerability can be exploited remotely if the IOPaint File Manager endpoints are exposed over the network and accept user-controlled filename parameters.

That depends on how the application is deployed and configured. If the file retrieval functionality is available to unauthenticated users, exploitation can be anonymous; if it is behind login, attackers would need whatever level of access is required to reach that endpoint.

Implement strict path handling by canonicalizing requested file paths, enforcing that they remain within a configured base directory, and rejecting any request that attempts to escape that directory. Where possible, replace direct filename parameters with indirect identifiers that are mapped to known-safe locations.

Establish and enforce a standard pattern for file access: never trust client-supplied paths, always validate against a whitelist or a base directory, and integrate static analysis and code review checklists that specifically flag user input influencing filesystem paths.

Find out what's already
exploitable in your codebase.