Skip to content

fix(sample): reject unsafe manifest paths - #68

Open
efegokdemir wants to merge 1 commit into
Basekick-Labs:mainfrom
efegokdemir:efe/sample-path-safety
Open

efegokdemir wants to merge 1 commit into
Basekick-Labs:mainfrom
efegokdemir:efe/sample-path-safety

Conversation

@efegokdemir

Copy link
Copy Markdown
Contributor

Reject absolute, non-canonical and backslash-containing sample part keys before deriving local filenames. path.Base preserves backslashes, but Windows treats them as path separators, so a malformed manifest could target files outside the sample cache. Added regression coverage for traversal, absolute and Windows-style keys, plus a valid relative key. Verified on macOS with go test -race -count=1 ./..., go vet ./..., go build ./..., gofmt and git diff --check; the sample test package also cross-compiles for Windows amd64 and arm64, but was not run on Windows. The GoReleaser snapshot was not run locally because GoReleaser is unavailable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant