/

CVE-2026-48544

Severity:

HIGH RISK

(7.5)

Path Traversal in Taipy ElementLibrary.get_resource()

CVE-2026-48544

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Unauthorized File Read / Directory Traversal

Severity:

HIGH RISK

(7.5)

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

Taipy 4.1.1 contains a path traversal vulnerability in the ElementLibrary.get_resource() method, where an incomplete path containment check allows file requests to escape the intended module directory.

By crafting GET requests with traversal segments that still satisfy a flawed prefix check, unauthenticated attackers can access files outside the expected library directory on disk.

Affected context

This vulnerability affects applications built with Taipy 4.1.1 that expose the GUI extension library over HTTP and rely on ElementLibrary.get_resource() to serve static or library resources.

It is most relevant when the Taipy process has filesystem access to sensitive directories (configuration files, credentials, source code) that are adjacent to or above the intended module directory.

The issue arises when the directory containment check uses a simple startswith() comparison without enforcing a proper path boundary or trailing separator, while the web stack preserves traversal segments in the request path.

Exploit preconditions

  • Attack surface: HTTP(S) endpoint serving Taipy GUI extension resources via ElementLibrary.get_resource().
  • Required access: Network reachability to the Taipy application; no authentication is required for the vulnerable resource handler.
  • Trigger point: Crafted GET requests containing path traversal segments (e.g., "../") that navigate to files in a prefix-matching sibling or parent directory on disk.
  • Why exploitation is possible: The containment check relies on str.startswith() against a base directory path without a trailing separator, so any path sharing that prefix is treated as "inside" the directory even if traversal segments ultimately resolve outside it. Flask and Werkzeug preserve traversal sequences, allowing the request path to pass the flawed check while still referring to files beyond the intended library directory.

Why this happens

The root cause is an improper validation of file paths before use, mapping to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

Instead of using canonical, normalized filesystem paths and strict directory boundary checks, the code relies on string prefix comparison via str.startswith() to decide whether a requested resource is contained within a base directory.

Because no trailing path separator or canonicalization is enforced, paths that merely begin with the same character sequence as the base directory—or that include traversal segments resolving outside the directory—are incorrectly treated as safe.

This pattern trusts the textual form of the path rather than the resolved path in the filesystem namespace, enabling attackers to step outside the intended directory using crafted traversal sequences.

Potential impact

  • Unauthorized reading of files located outside the intended library directory but accessible to the Taipy process.
  • Exposure of configuration files, application source code, or environment-specific secrets stored in nearby directories.
  • Leakage of credentials, API keys, or tokens that may enable further compromise of the application or its backing services.
  • Collection of server-side logic and internal structure information that can support follow-on attacks such as RCE or privilege escalation in other components.

General mitigation guidance

Mitigation typically centers on enforcing strict directory containment and avoiding string-based path checks:

  • Use canonical, absolute paths (e.g., via os.path.realpath or equivalent) for both the requested resource and the base directory before comparison.
  • Enforce directory boundaries using robust checks (e.g., verifying that the resolved path is strictly within the base directory tree) rather than relying on startswith() or similar string prefix logic.
  • Normalize and reject any path containing traversal patterns or ambiguous components (e.g., "..", repeated separators) prior to file access.
  • Restrict which directories the application user can access at the OS level so that even if path validation fails, the process lacks permission to read sensitive locations.
  • Serve only from a dedicated, tightly controlled resource directory and avoid co-locating secrets or configuration files with web-accessible assets.

How teams detect issues like this

Effective detection combines code-level analysis with runtime monitoring:

  • Static analysis: Search for file-serving or resource-handling functions that:
  • Construct paths from user-controlled input and
  • Validate them with simple string operations (startswith, in, endswith) instead of canonical path checks.
  • Code review signals: Pay attention to:
  • Any use of os.path.join() or equivalent with request parameters.
  • Manual directory checks that omit realpath/resolve or a trailing separator.
  • Custom resource-serving logic instead of hardened framework utilities.
  • Dynamic testing: Use security testing tools or custom scripts to send requests containing "../" and similar traversal patterns to resource endpoints and verify that only intended paths are accessible.
  • Logging and monitoring: Capture requested resource paths and flag unusual sequences (e.g., "..", excessive nesting) or attempts to access known sensitive files.

Sources

SourceLink
github.comgithub.com/Avaiga/taipy/commit/129fd407ffca49ee4ab853772c88d0c873e038dd
github.comgithub.com/Avaiga/taipy/issues/2868
github.comgithub.com/Avaiga/taipy/pull/2871
vulncheck.comvulncheck.com/advisories/taipy-path-traversal-via-elementlibrary-get-resource

Frequently asked

questions

Yes. As long as the Taipy GUI endpoint is exposed over the network and the vulnerable resource handler is reachable, an attacker can exploit it remotely by sending crafted HTTP requests.

No inherent authentication is required by the vulnerability itself. If the resource endpoint is publicly accessible in the application, unauthenticated attackers can attempt path traversal attacks.

The most robust approach is to stop relying on string-based path checks and instead resolve both the base directory and requested path to canonical absolute paths, then verify that the requested path resides strictly within the allowed directory tree before any file access. Reject any request that fails this containment check.

Consistently treat any path influenced by user input as untrusted, normalize and canonicalize paths before use, and centralize file-access helpers that enforce strict directory boundaries. Pair this with regular security-focused code review and automated static analysis rules that flag prefix-based directory checks and any use of request parameters in filesystem operations.

Find out what's already
exploitable in your codebase.