Skip to content

node: local hardening — fs-origin outboard symlink/special-file guard, identity-key buffer zeroization #2775

Closed

Description

@yigitdot

1. fetch_outboard skips the symlink-containment and regular-file checks its siblings have

  • crates/cache/src/origin/fs.rs:348-396 — fetch, fetch_range_data and size canonicalize and check containment (:173-194); fetch_outboard does not. Its metadata() length gate rejects oversized regular files, but a symlink to a char device (/dev/zero: metadata length 0 passes, then tokio::fs::read grows unboundedly → OOM — the post-read TOCTOU re-check comes too late) or to a FIFO (blocks a blocking-pool thread forever) bypasses it, and a symlink out of the base directory reads foreign file contents into memory. Needs write access to the origin directory (the "hostile sibling" the module's own comments consider).
  • Apply the same containment check plus is_file(), and read through a take(outboard_max_bytes + 1) limit

2. The node identity key is read into a non-zeroized buffer

  • crates/common/src/identity.rs:597-608 — the key file is read into a Vec that is never zeroized, so key bytes linger in freed heap memory.
  • Zeroize the intermediate buffer (zeroize is the usual tool)

Activity

  1. added
    kind:security
    prio:low
    area:node
    area:cache
    on Oct 30, 2026
  2. moved this from Backlog to In progress in deCDNon Oct 30, 2026
  3. moved this from In progress to Done in deCDNon Nov 1, 2026
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

    area:cachearea:nodekind:securityprio:low

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions