Skip to content

fix(security): blob_store path injection, sandbox escape, and data integrity #545

Closed

Description

@Sinity

Cluster: Storage security and data integrity

Findings from the post-hoc bot review audit (#544).

CONFIRMED

  1. blob_store.py:38 — path injection via hash_hex (CodeRabbit, Critical)
    blob_path() constructs filesystem path from hash_hex with zero validation. A malformed raw_id containing ../ or / would escape the blob root directory.

  2. blob_store.py:127 — partial write corruption (Copilot)
    os.write(fd, chunk) can perform partial writes. For large chunks, a partial write would silently corrupt the blob since the hasher was already updated.

  3. blob_store.py:171 — temp file leakage (CodeRabbit, Major)
    iter_all() uses prefix_dir.iterdir() without filtering .blob.* temp files. Crash-left temp files are yielded as valid blobs.

  4. blob_store.py:72 — heartbeat exception aborts write (CodeRabbit, Major)
    Exception in heartbeat() callback propagates and aborts the entire blob write.

  5. lib/security.py:55-56 — sandbox escape via absolute paths (Copilot)
    sanitize_path() preserves absolute paths like /etc/passwd — no allowlist for safe directories.

  6. storage/blob_store.py:88,94 — TOCTOU race (Both, UNCERTAIN)
    File could change between hash check and write. Appears partially mitigated in HEAD but needs verification.

Ref #544

Activity

  1. added a commit that references this issue on May 7, 2026
    a37e008
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions