/

CVE-2026-49297

Severity:

HIGH RISK

(8.1)

Path Traversal (CWE-22) in Airflow GCS File Operators

CVE-2026-49297

Analyzed

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Overwrite on SFTP or Worker Host

Severity:

HIGH RISK

(8.1)

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

Apache Airflow's Google provider file transfer operators improperly join GCS object names with destination paths without normalization or containment checks, allowing path traversal via .. segments.

When buckets are writable by less-trusted principals, an attacker can craft object names that cause blobs to be written outside the intended directory, potentially overwriting arbitrary files on the SFTP server or worker host.

Affected context

This vulnerability occurs in Apache Airflow deployments using the GCSToSFTPOperator or GCSTimeSpanFileTransformOperator from the Google provider to ingest objects from Google Cloud Storage.

It becomes relevant when the source GCS bucket is writable by principals other than the DAG author or core operators, such as partner-upload accounts, ingest-only service accounts, or public-data buckets.

In these scenarios, object names returned from bucket listings are directly concatenated onto destination filesystem paths (SFTP destination directories or worker-local temp directories) without enforcing path containment.

Exploit preconditions

  • Attack surface: Airflow DAG runs that use the affected operators to pull objects from GCS onto SFTP servers or worker hosts.
  • Required access: Ability to write or upload objects into the source GCS bucket used by the DAG (not necessarily access to Airflow itself).
  • Trigger point: Execution of an affected operator that lists the bucket and writes downloaded blobs using object names as suffixes.
  • Why exploitation is possible: Object names containing .. and path separator sequences are joined directly to destination paths without normalization or validation, allowing traversal out of the configured directory and into arbitrary filesystem locations.

Why this happens

The underlying issue is an improper handling of filesystem paths derived from external, potentially untrusted input, matching CWE-22: Path Traversal.

The operators rely on GCS object names returned by the listing API and assume they are safe to append to destination directories, instead of treating them as untrusted data requiring sanitization.

Because there is no normalization step and no check that the final path remains within the intended base directory, attackers can embed .. segments in object names to escape the target directory and reach arbitrary paths on the SFTP server or worker host.

Potential impact

  • An attacker may overwrite arbitrary files on the SFTP server reachable by the GCSToSFTPOperator.
  • An attacker could overwrite or replace files in the Airflow worker's filesystem, including logs, scripts, or configuration files.
  • The operator runs can be manipulated to corrupt or poison ingested datasets by writing them into unexpected locations.
  • In some environments, arbitrary file overwrite may be chained with other weaknesses to achieve code execution or privilege escalation.

General mitigation guidance

Effective mitigation focuses on treating GCS object names as untrusted path components and constraining how they are mapped to local or remote filesystems.

Common defensive patterns include:

  • Normalizing joined paths and enforcing that the resulting location remains strictly within a configured base directory before any write occurs.
  • Rejecting or neutralizing object names containing .., absolute path prefixes, or unexpected separators when constructing destination paths.
  • Decoupling user-controlled identifiers from filesystem layout by mapping object names to sanitized, controlled file names rather than using them verbatim.
  • Running workers and SFTP servers with least privilege and restrictive filesystem permissions to limit the blast radius of any unintended writes.
  • Segregating ingest buckets so that highly trusted workflows are not directly exposed to objects from less-trusted or public uploaders.

How teams detect issues like this

Detection typically involves a mix of code-level and runtime checks:

  • Static analysis rules or linters that flag direct concatenation of untrusted input (such as object names from storage APIs) with filesystem paths without normalization or containment checks.
  • Code review practices that scrutinize any logic building paths from external identifiers, verifying that normalization and base-directory enforcement are present.
  • Policy-based controls in CI/CD that disallow operators or utilities that map cloud storage object names directly into filesystem paths without sanitization.
  • Runtime monitoring and logging that can surface unexpected write locations, such as operators creating files outside configured directories or in sensitive system paths.

Sources

SourceLink
github.comgithub.com/apache/airflow/pull/67667
lists.apache.orglists.apache.org/thread/cb5nvoxsj1q7rv878cyqgtg150w0zglq?users@airflow.apache.org
openwall.comopenwall.com/lists/oss-security/2026/07/04/8

Frequently asked

questions

Exploitability depends on who can write to the source GCS bucket and what the destination environment exposes. If less-trusted principals can upload objects and the destination filesystem contains sensitive files, the vulnerability can be broadly exploitable.

Not necessarily. The main requirement is the ability to create or modify objects in the GCS bucket consumed by the affected operators. The Airflow DAG and worker infrastructure may remain inaccessible while still being impacted.

Enforce strict path containment whenever constructing filesystem paths from external inputs by normalizing paths, checking that they reside under a predefined base directory, and rejecting any object names that cannot be safely mapped.

Design ingestion and transfer code so that external identifiers are never used as raw filesystem paths, apply rigorous input validation and normalization, and embed checks into development and review processes that treat any path derived from external sources as untrusted data requiring containment enforcement.

Find out what's already
exploitable in your codebase.