fix(deploy): prevent application privilege gains - #5033
#5033Open
Ricardo-binZzz wants to merge 1 commit into
Wei-Shaw:mainWei-Shaw/sub2api:mainfrom
Ricardo-binZzz:fix/sub2api-no-new-privilegesRicardo-binZzz/sub2api:fix/sub2api-no-new-privilegesCopy head branch name to clipboard
Open
fix(deploy): prevent application privilege gains#5033Ricardo-binZzz wants to merge 1 commit intoWei-Shaw:mainWei-Shaw/sub2api:mainfrom Ricardo-binZzz:fix/sub2api-no-new-privilegesRicardo-binZzz/sub2api:fix/sub2api-no-new-privilegesCopy head branch name to clipboard
Ricardo-binZzz wants to merge 1 commit into
Wei-Shaw:mainWei-Shaw/sub2api:mainfrom
Ricardo-binZzz:fix/sub2api-no-new-privilegesRicardo-binZzz/sub2api:fix/sub2api-no-new-privilegesCopy head branch name to clipboard
Conversation
Contributor
Author
|
All checks except golangci-lint pass. The lint job reports only the same three pre-existing main-branch SA5011 diagnostics in payment_handler_test.go, proxyurl/parse_test.go, and openai_images_incomplete_test.go; this PR changes only Compose files, deployment CI wiring, and a shell contract test. The isolated baseline fix is #5027, after which this deployment hardening PR can be rebased for a fully green run. |
Ricardo-binZzz
force-pushed
the
fix/sub2api-no-new-privileges
branch
from
July 29, 2026 05:27
a5b02cf to
0010894
Compare
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
no-new-privilegesfor the Sub2API application in all four Compose variantsRationale
The application entrypoint starts as root only to repair
/app/dataownership and then drops to thesub2apiuser. Withoutno-new-privileges, a compromised application process retains a path to gain privileges through future setuid/file-capability additions in the runtime image.This change does not alter PostgreSQL or Redis, resource limits, networking, volumes, or application configuration.
Verification
0.1.168completed an isolatedsu-exec sub2apitransition withno-new-privileges:trueNoNewPrivs: 1docker compose config --quietgit diff --checkv0.1.168rebase: shell, backend unit/integration tests, golangci-lint, frontend, backend/frontend security, and CLA all pass