Two ways a buggy/malicious hub could corrupt the local tree: - writeEntry/deleteFile joined hub-supplied Entry.Path into root with no containment check, so '../../.ssh/authorized_keys' wrote/deleted OUTSIDE the mount. New safeJoin() uses filepath.IsLocal to refuse absolute/.. /escaping paths before any write or delete. - GetBlob returned bytes with only an HTTP-status check. Blobs (chunks AND manifests) are content-addressed, so now verify chunk.Hash(body)==hash — a corrupt/truncated transfer or hostile hub can't write wrong content undetected. (manifest ID == chunk.Hash(Marshal()), so the check holds there.) Regression tests for both. |
||
|---|---|---|
| .. | ||
| chunk | ||
| config | ||
| daemon | ||
| hooks | ||
| hub | ||
| identity | ||
| ignore | ||
| manifest | ||
| secret | ||
| syncer | ||
| transport | ||
| watch | ||