Repository navigation
Release v0.7.2: Remote Path Boundary Hardening & Symlinked CWD Confinement
Release v0.7.2 is a security and stability patch release hardening remote path containment across okf hub pull, okf hub sync, okf pull, okf restore, and okf vendor remove, introducing staging-directory atomic rollbacks for registry installations, and resolving a false-positive traversal error when mutating relative bundles from a symlinked working directory.
1. Security Hardening & Bug Fixes
Remote Input Write Containment in Hub Sync & Registry Installs (#64)
- Problem:
okf hub pull,okf hub sync,okf pull, andokf restorederived filesystem destination paths from remote data (hub tree manifests, registry bundle IDs,okf.lockentries, and archive headers) without uniformly rejecting parent traversal (..), absolute paths, hidden dotfiles (e.g..git/hooks/*,.okf-vault.json), or symlinks resolving outside the bundle or workspace. Furthermore,okf pull --forceandokf restore --forceunpacked directly into the target path and executedos.RemoveAllon validation failure, allowing an escaping bundle ID or symlink to delete directories outside the workspace or wipe a preexisting installation. - Resolution:
- Hub Sync Tree & State Confinement (
pkg/sync): AddedvalidateTreePath/validateTreePathsto reject empty, absolute, volume-qualified, non-canonical (.,..,//), hidden (.git,.okf-vault.json,.okf), NUL-byte, and backslash paths before any blob is fetched. AddedhubTargetsandcontainedPathto pre-verify every write and delete destination viafilepath.EvalSymlinksandfilepath.Rel(all-or-nothing commit application). Confined.okf/sync-state.jsonreads and writes to the resolved bundle root and ignored poisoned delete bases in stored state. - Registry Bundle ID & Archive Confinement (
pkg/registry): AddedValidateBundleIDandResolveVendorDirto enforce canonical relative slash-separated IDs (preserving legitimate scoped and nested IDs such as@peter/django-5-rulesandacme/tools/linter) and verify that.okf/vendorresolves within the workspace and each bundle resolves strictly inside.okf/vendor. HardenedDownloadAndExtractto pre-verify all archive entries lexically and through symlinks prior to extraction. - Staged Installations & Safe Rollback (
internal/cli,pkg/registry): AddedStaging(NewStaging,Commit,Discard).okf pullandokf restorenow extract and validate bundles inside a fresh.okf/.vendor-staging-*directory before atomically committing them into.okf/vendor. Failed installs discard only the staging directory created by that invocation, preserving any previous--forceinstallation and never following symlinks during rollback orokf vendor remove.
- Hub Sync Tree & State Confinement (
- Credit: Reported via responsible disclosure with reproduction fixtures and implemented by Nick Hodulik (@nhod) in PR #64.
Symlinked Working Directory Bundle Root Resolution (#62, #63)
-
Problem:
ensureWithinRootinpkg/okf(andcontainedPathinpkg/sync) calledfilepath.EvalSymlinksbeforefilepath.Abs. Whenokfwas invoked with a relative bundle root (e.g.knowledge) from a symlinked working directory (such as macOS/tmp$\rightarrow$ /private/tmp),EvalSymlinksreturned a relative path while target paths resolved to their canonical target under/private/tmp, causing legitimate writes to be refused as path traversal escapes. -
Resolution: Normalized the bundle root to an absolute path via
filepath.Absbefore callingfilepath.EvalSymlinks, ensuring both root and target resolve through the same working-directory symlinks. - Credit: Reported in #62 and implemented in PR #63 by Nick Hodulik (@nhod).
2. Knowledge & Architecture
- Updated architecture/security-boundaries documenting remote input write containment (
validateTreePath,ValidateBundleID,ResolveVendorDir,Staging) and pre-symlink root absolutisation under symlinked working directories. - Synchronized knowledge/architecture/index.md and knowledge/log.md with all architectural mutations and release history.
3. Community & Special Thanks
- Nick Hodulik (@nhod): For responsible security disclosure, comprehensive boundary test suites, and implementing remote path containment & staged registry rollbacks in #64, as well as diagnosing and fixing symlinked working directory root resolution in #62 and #63.
🌐 Discover & Share Knowledge: OKF Registry
Scale persistent memory across projects and agent sessions with the decentralized OKF Registry:
- Browse & Share: Discover curated, quality-scored memory packages (e.g. framework best practices, architecture rules, compliance guidelines) at registry.okf-memory.dev.
- Install in Seconds: Pull external knowledge directly into
.okf/vendor/with zero dependencies:okf pull <bundle-id>
- Guaranteed Conformance: Every package is verifiable against Open Knowledge Quality Scorecards (
--min-score) with atomic rollback to ensure deterministic agent consumption.
Pre-built Binaries & Verification
Release binaries are automatically built by GitHub Actions:
- Download: v0.7.2 Release Binaries
Full Changelog
Full Changelog: v0.7.1...v0.7.2