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. |
||
|---|---|---|
| .. | ||
| deploy_test.go | ||
| hooks_integration_test.go | ||
| pull.go | ||
| pull_test.go | ||
| restore_test.go | ||
| safejoin_test.go | ||
| syncer.go | ||
| syncer_test.go | ||