Repository navigation
WKS-3613 - Reject manifest sourceCodePath outside the worker directory - #71
Merged
Merged
Conversation
vitaliil-jfrog
approved these changes
Nov 4, 2026
ehl-jf
force-pushed
the
bugfix/WKS-3613
branch
from
November 4, 2026 16:35
7380f09 to
c0586d0
Compare
Contributor
This branch is waiting to be deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mainbranch.go vet ./....go fmt ./....What
jf worker deployandjf worker test-runnow only readsourceCodePathfrom inside the worker directory (the directory holdingmanifest.json).common.ReadSourceCode, the single function both commands go through:..(filepath.IsLocal) before touching the filesystem:invalid manifest: sourceCodePath '<p>' must be a relative path inside the worker directoryos.OpenRoot("."), so symlinks leaving the directory are rejected too (invalid manifest: cannot read sourceCodePath '<p>': ... path escapes from parent)Why
sourceCodePathwas passed straight toos.ReadFile, so a manifest could point at any file readable by the user running the CLI, and that content was sent to the Platform as the worker source.Behaviour change
These manifests now fail with a clear error, with no opt-out:
sourceCodePath, even when it points inside the project../...pathsThe scaffolded default
./worker.ts, subfolders, and in-project symlinks keep working.Tests
TestManifest_ReadSourceCode: nested path, in-dir symlink, absolute (inside and outside),..traversal, escaping symlink, directory instead of a fileTestDeployCommand/TestDryRun: the escaping-path case runs against a server stub with no upload endpoint and fails with the containment error