fix: update vulnerable sandbox dependencies#268
Merged
Conversation
wylswz
approved these changes
Jun 3, 2026
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.
Summary
golang.org/x/nettov0.53.0and refresh relatedgolang.org/x/*module versions.requestspackage to2.33.0across Docker version configuration and templates.Background / Rationale
The vulnerable
golang.org/x/netversion is fixed byv0.53.0, whose module metadata requires Go1.25.0. After the Go toolchain was aligned with that requirement, CI started failing withsignal: bad system callduring basic Python and Node.js execution tests.The failures were not caused by
requestsorx/netcode paths directly. The sandbox loads Go c-shared libraries (python.so/nodejs.so) into Python and Node.js child processes to install seccomp. Once seccomp is active, any Go runtime background/housekeeping syscall that is not in the allowlist can terminate the process.Go 1.25 enables or expands runtime behavior that can issue additional housekeeping syscalls, including:
prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, ...);GOMAXPROCSsetup/update paths that can inspect CPU/container state;eventfd2.This PR uses:
only for the sandbox child process while loading the Go c-shared seccomp library. The prescripts remove
GODEBUGbefore evaluating user code, so the user execution environment is not intentionally polluted.This is preferred over simply allowing every syscall Go 1.25 may use. In particular, avoiding
decoratemappingsprevents the need to broadly allowprctl. The current seccomp helper only allows syscall-level rules, not argument-filtered rules, so allowingprctlwould allow allprctloperations instead of onlyPR_SET_VMA. That is broader than necessary for the sandbox.The allowlist changes are limited to low-risk runtime housekeeping syscalls:
eventfd2for Go runtime netpoll support;madvisefor Go/Python memory-management paths;sched_getaffinityfor Go runtime CPU-affinity/container probing paths.The Go runtime-related allowlist updates are applied consistently to both Python and Node.js sides because both runners load Go c-shared libraries and can be affected by the same Go runtime behavior. Language-specific syscall differences remain separate.
Related Issue
Closes #267
Test Plan
docker build --progress=plain -f docker/amd64-test.gen.dockerfile --build-arg TARGETARCH=amd64 -t dify-sandbox:test-ci-fix .docker run --rm dify-sandbox:test-ci-fix python3 -c 'import requests; print("python-ok", requests.__version__)'docker run --rm dify-sandbox:test-ci-fix node -e 'console.log("javascript-ok", process.version)'Test (amd64)andTest (arm64)passed.Note: direct local
go test ./internal/core/runner/... ./internal/service/...fails outside Docker because the test initialization requires creating sandbox users.This PR is drafted by
gpt-5.4andgpt-5.5. I'm responsible for all the changes. I have reviewed the code and varified the behavior, while breaks may still exist. Reach me to fix in this case.