Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix(deploy): prevent application privilege gains - #5033

#5033
Open
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#5033
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

@Ricardo-binZzz

@Ricardo-binZzz Ricardo-binZzz commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • enable no-new-privileges for the Sub2API application in all four Compose variants
  • add a shell contract test that keeps the setting scoped to the application service
  • run the contract in the existing deployment CI job

Rationale

The application entrypoint starts as root only to repair /app/data ownership and then drops to the sub2api user. Without no-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

  • current release image 0.1.168 completed an isolated su-exec sub2api transition with no-new-privileges:true
  • production application container was recreated with this setting and verified healthy with PID 1 at UID 1000 and NoNewPrivs: 1
  • all four Compose files pass docker compose config --quiet
  • positive shell contract and missing-setting negative fixture pass
  • git diff --check
  • refreshed v0.1.168 rebase: shell, backend unit/integration tests, golangci-lint, frontend, backend/frontend security, and CLA all pass

@Ricardo-binZzz

Copy link
Copy Markdown
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
Ricardo-binZzz force-pushed the fix/sub2api-no-new-privileges branch from a5b02cf to 0010894 Compare July 29, 2026 05:27
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.