安全案例研究:Apache Airflow 实验性 API 未认证访问(CVE-2020-13927)的可达性分析 PoE → 修复 → PoNE,真实代码在历史提交中重建。仅供演示,请勿使用。
baseline⚠️ 演示 / 案例研究分支
特定历史提交处 真实 Apache Airflow 源码的逐字节快照, 仅用于安全分析演示。不得用于任何真实或生产用途。 请勿部署、安装或依赖它。
最后仍存在漏洞的状态:Apache Airflow 位于提交 e35ae2db7c,
即删除实验性 REST API 的那个提交的直接父提交。可触达的未认证读取汇聚点
早于该提交数年,因此 baseline 已经包含它,并**同时充当
可利用性证明(PoE)**状态——此案例没有单独的 vulnerability-introduced
分支。
| 上游提交 | e35ae2db7c56a23b2f7abbd7c4269221ed98ead6("Airflow 3: airflow date utils date_range and days_ago deprecations removal (#41496)") |
| 日期 | 2024-08-16 |
| 快照树 OID | ba25dae90e003040ec1220f566a2773e151c4746 |
| 预期静态判定 | reachable_candidate(PoE) |
airflow/www/api/experimental/endpoints.py 在一个 Flask 蓝图上注册了 18 条路由。
所选的入口→汇聚点配对:
# airflow/www/api/experimental/endpoints.py
from airflow.api.common.experimental.get_code import get_code
...
@api_experimental.route("/dags/<string:dag_id>/code", methods=["GET"])
@requires_authentication
def get_dag_code(dag_id): # <-- INGRESS (http_route)
"""Return python code of a given dag_id."""
try:
return get_code(dag_id) # <-- calls the sink
except AirflowException as err:
...
# airflow/api/common/experimental/get_code.py
@deprecated(
reason="Use DagCode().get_code_by_fileloc() instead",
version="2.2.4",
category=RemovedInAirflow3Warning,
)
def get_code(dag_id: str) -> str: # <-- SINK (reachable)
"""Return python code of a given dag_id."""
dag = check_and_get_dag(dag_id=dag_id)
try:
return DagCode.get_code_by_fileloc(dag.fileloc) # arbitrary DAG source, no ACL
...
@requires_authentication 仅检查是否存在某个已认证身份——蓝图注册函数上的代码注释直言不讳地写道:“实验性 API 没有访问控制。已认证用户拥有完全访问权限。” 任何已认证用户(或者,取决于所配置的认证后端,任何调用者)都可以读取实例上任何 DAG 的源代码。
ResolveDependencySymbols(["airflow.api.common.experimental.get_code.get_code"])
→ 此处有 1 处匹配;该节点是从 http_route 入口(get_dag_code 上的 @api_experimental.route(...))反向可达的调用图顶点 ⇒
reachable_candidate。
get_code 自 2021-12-16 起就带有 @deprecated(...) 装饰器(上游 6239ae91a4,“Deprecate some functions in the experimental API”),并且当实验性 API 启用时,init_api_experimental() 会在每次进程启动时发出运行时 RemovedInAirflow3Warning。两者都没有关闭可达路径:装饰器只记录日志,路由仍然注册,接收点仍然可解析。此分支表明,多年的弃用通知并不是修复——只有 fix 中的彻底删除才是。
fix 的区别fix(8807f73dfd)删除了整个
airflow/www/api/experimental/ 包(蓝图 + 全部 18 个路由处理器)
以及整个 airflow/api/common/experimental/ 包(包括
get_code.py),外加 init_api_experimental() 注册调用。真实的
代码差异是开放的 PR
baseline ← fix (#1)。
不是 fork——而是真实的源代码快照;没有上游远程仓库或 git 父提交。
上游:https://github.com/apache/airflow @
e35ae2db7c56a23b2f7abbd7c4269221ed98ead6。上游 LICENSE(Apache-2.0)
逐字保留。README.md 是此分支上唯一编写的文件;所有
其他文件均为上游树,未作修改。
完整索引:main。