CVE-2026-81914 Apache Airflow Google provider 注入漏洞
影响攻击者可注入查询子句,篡改文件上传或下载目标
Apache Airflow 的 Google provider 在构造 Google Drive 搜索表达式时,将文件和文件夹名直接插入单引号字符串字面量,未转义引号字符。名称中若含单引号会提前终止字面量,并追加攻击者构造的查询子句。该漏洞影响将外部来源名称传入 Google Drive hook 的部署场景。
影响范围
受影响组件为 apache-airflow-providers-google(Google provider)。具体受影响版本范围暂无公开信息,建议参考官方公告确认。
漏洞详情
漏洞类型为查询注入(类似 SQL 注入的表达式注入)。成因是拼接搜索表达式时未对单引号进行转义,导致名称中的撇号可闭合字符串并注入额外子句。在通配符 gcs_to_gdrive 传输中,名称来自源存储桶列表,任何能向该桶写入对象的人都能控制这些名称,从而扩大匹配范围、改变 hook 解析到的文件或文件夹。
利用条件与风险
利用前提是部署将外部可控名称传入 Google Drive hook,例如从低信任主体可写的桶执行通配符 gcs_to_gdrive 传输。实战中可导致上传被重定向到攻击者指定的文件夹,或下载返回攻击者放置的文件而非 Dag 预期的文件。
修复建议
官方建议升级到修复后的 apache-airflow-providers-google 版本(具体版本号见官方公告)。临时缓解措施包括:避免将外部可控的名称传入 Google Drive hook,限制源存储桶的写入权限,或对名称中的引号字符进行过滤/转义。
Apache Airflow’s Google provider built Google Drive search expressions by interpolating file and folder names directly into single-quoted string literals, without escaping the quote character that delimits them. A name containing an apostrophe therefore terminated the literal early and appended clauses of the attacker’s choosing to the query.
The names are frequently not written by the Dag author. In a wildcard `gcs_to_gdrive` transfer they come from the source bucket listing, so anyone able to create objects in that bucket controls them — typically an external data producer or an ingest-only service account, a different trust principal from the Dag author. An injected clause can broaden the match and so steer which file or folder the hook resolves: an upload can be directed into a folder the attacker named, and, because downloads select the most recently modified match, a download can return a file they placed rather than the one the Dag asked for.
Affects deployments passing externally-sourced names to the Google Drive hook, including wildcard `gcs_to_gdrive` transfers from buckets writable by less-trusted principals. Users are advised to upgrade to `apache-airflow-providers-google` `22.6.0` or later, which escapes quote and backslash characters in every value interpolated into a Drive query.