fix(api,chart): resolve stack trace leaks, drop NET_BIND_SERVICE capability - #613
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR hardens the deployment and API error handling by removing an unnecessary Linux capability from the frontend container and ensuring API 500 responses don’t echo raw error objects back to clients.
Changes:
- Removed
NET_BIND_SERVICEcapability from the frontend container’s securityContext in the Helm values. - Replaced
res.status(500).json(error)responses with a generic{ message: "Internal server error" }payload in the pub-code service.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| charts/pubcode/values.yaml | Drops the NET_BIND_SERVICE capability from the frontend container configuration. |
| api/src/services/pub-code-service.js | Prevents error object/stack details from being returned in 500 responses by returning a generic message. |
mishraomp
approved these changes
Jul 17, 2026
…cution without capabilities
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
This PR addresses the 4 remaining open Code Scanning alerts in the repository, resolving security and configuration quality issues:
Information Exposure through Stack Trace (
js/stack-trace-exposure/ Alerts code changes for adding rate limiting. #93, Hook up Crawler to post data to API #94, upgrade to rjsf 5.1.0 #95):res.status(500).json(error)in four route handlers insidepub-code-service.js. This leaks internal database structures, paths, and stack trace metadata to clients.{ message: "Internal server error" }payload while keeping detailed logs on the server side (logger.error(...)).Specific capabilities added (
KSV-0022/ Alert logs #157):capabilities.add: ["NET_BIND_SERVICE"].3000and3001(which are unprivileged ports >= 1024), standard non-root processes can bind to them natively. The capability was leftover boilerplate and is no longer needed.exec /usr/bin/caddy: operation not permitted) because the binary in the official image had file capabilities set. We have updatedfrontend/Dockerfileto strip capabilities from the binary (setcap -r /usr/bin/caddy) during the build, allowing it to execute safely with dropped capabilities.Verification
securityContext.capabilities.addblock.Thanks for the PR!
Any successful deployments (not always required) will be available below.
API available
Frontend available
Once merged, code will be promoted and handed off to following workflow run.
Main Merge Workflow