/

CVE-2026-42351

Severity:

HIGH RISK

(7.5)

Path Traversal in pygeoapi STAC FileSystemProvider

CVE-2026-42351

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Unauthorized Directory and File Access

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

A path traversal issue in pygeoapi's STAC FileSystemProvider plugin allows crafted collection requests to traverse directories using raw string path concatenation.

When pygeoapi is deployed without a front-end that normalizes .. segments, unauthenticated clients may be able to access directories and files outside the intended STAC collection paths.

Affected context

This vulnerability appears in pygeoapi deployments that:

  • Use a resource of type stac-collection backed by the FileSystemProvider plugin
  • Rely on raw filesystem paths derived from HTTP request paths
  • Are deployed directly (e.g., via a built-in server or minimal reverse proxy) without URL normalization that strips or resolves .. path segments

In such setups, the STAC collection endpoint can inadvertently expose directory listings or file content beyond the intended STAC collection root.

Exploit preconditions

  • Attack surface: HTTP(S) interface of pygeoapi, specifically STAC collection endpoints using the FileSystemProvider.
  • Required access: Network access to the affected pygeoapi instance; no authentication is needed if the STAC collection endpoint is publicly exposed.
  • Trigger point: An HTTP request to a STAC collection URL that includes crafted relative path components such as ../ in the path.
  • Why exploitation is possible: The plugin concatenates user-controlled URL path segments directly to a filesystem base path without normalizing or validating against a fixed root, allowing traversal outside the intended directory.

Why this happens

The underlying flaw is improper validation and sanitization of path components derived from user-controlled URLs.

Instead of resolving and enforcing paths against a fixed, canonical root directory, the STAC FileSystemProvider performs raw string concatenation when mapping request paths to the filesystem.

This behavior corresponds to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where relative path elements like .. are not rejected or normalized, enabling an attacker to traverse up the directory tree and access unintended locations.

Potential impact

  • Exposure of directory structures that may reveal file names, layouts, or internal organization
  • Read access to configuration files, metadata, or other non-public assets located near or above the STAC collection root
  • Leakage of sensitive information that could aid further attacks (e.g., credentials stored in files, internal endpoints, or system paths)
  • Violation of data segregation between collections or tenants if multiple datasets share the same filesystem

General mitigation guidance

Effective mitigation focuses on constraining filesystem access and normalizing paths before use:

  • Canonicalize and validate request-derived paths against a fixed STAC root directory, rejecting any path that escapes the configured base.
  • Avoid raw string concatenation of user-controlled segments; instead, use path-joining utilities that operate on canonicalized components and enforce that the resulting path remains within the allowed root.
  • Apply strict configuration of which directories are exposed via the STAC FileSystemProvider, limiting file types and subdirectories where possible.
  • Place pygeoapi behind a capable reverse proxy or web server that normalizes and rejects URLs containing .. or other potentially dangerous path patterns.
  • Run the pygeoapi process with least-privilege filesystem permissions so that even if traversal occurs, access to sensitive system files is constrained.

How teams detect issues like this

Organizations can identify and monitor for this class of issue using a mix of code- and runtime-based techniques:

  • Static analysis and code review:
  • Flag any use of raw string concatenation to build filesystem paths from HTTP route parameters or query values.
  • Check that all path-manipulation logic canonicalizes inputs and enforces containment within a configured root directory.
  • Review plugin implementations (such as FileSystemProvider) for direct use of untrusted path components.
  • Configuration and policy checks:
  • Validate that reverse proxies or web servers are configured to normalize URLs and reject suspicious path patterns, including .., encoded traversals, or repeated slashes.
  • Enforce policies that disallow exposing backend filesystem roots directly via HTTP.
  • Runtime monitoring and logging:
  • Log requests containing .. or encoded equivalents in STAC collection paths and alert on unusual access patterns.
  • Use web application firewalls (WAF) or API gateways with rules that detect and block path traversal signatures.
  • Automated tooling:
  • Incorporate security scanners or SAST tools that specifically check for CWE-22 patterns in Python web applications.

Sources

SourceLink
github.comgithub.com/geopython/pygeoapi/commit/bf25b8695edbdd5476eeffc102b633d1d3e45f52
github.comgithub.com/geopython/pygeoapi/releases/tag/0.23.3
github.comgithub.com/geopython/pygeoapi/security/advisories/GHSA-f6pr-83pg-ghh6

Frequently asked

questions

Yes. If the affected STAC collection endpoint is exposed over the network without authentication and without front-end path normalization, an attacker can exploit the issue remotely using crafted URLs.

Not necessarily. The vulnerability can affect unauthenticated STAC collection endpoints. If access controls are not enforced at the route or proxy layer, any network client with reachability to the service could attempt exploitation.

Ensure that all filesystem paths derived from request URLs are canonicalized and strictly confined to a configured root directory. Reject requests that attempt to escape this root, and avoid direct string concatenation of user-controlled path segments.

Adopt a defense-in-depth approach: use safe path-joining utilities, add unit and integration tests for traversal attempts, place APIs behind proxies that normalize and validate URLs, and include automated security checks for path traversal patterns in code review and CI pipelines.

Find out what's already
exploitable in your codebase.