Repository navigation
fix: harden config UI, rate limiting, command execution and hook parsing - #208
Merged
Merged
Conversation
Security - Config UI save API requires -config-ui-token, JSON content type and a same-origin request; disabled when no token is configured - Rate limiting ignores X-Forwarded-For / X-Real-IP unless the peer is listed in -trusted-proxies; add per-IP quota flags - HMAC signature rules cover the raw multipart/form-data body - Empty configured value in a `value` match rule never matches - Command allowlist matches by path component and resolves symlinks - Client X-Request-Id is discarded unless -x-request-id is set, and -x-request-id-limit is enforced - Sanitize command arguments in execution error logs Reliability - Kill the whole process group on hook timeout (Unix) and bound Wait - Async hooks reserve an execution slot before responding; 503 with Retry-After when saturated - Remove pass-file-to-command temp files when no working directory is set - Fix ip-whitelist with mixed address families, panics in signature helpers and parse-parameters-as-json, body aliasing in the Scalr check and a data race in ExtractCommandArgumentsForFile - Warn about unknown hook file keys in compatible mode - Redis health check sends a real PING - Shut down the HTTP server before audit logging and tracing - Apply -max-header-bytes when set to a non-default value Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c87a51792
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ed-usr Linux - Requests rejected by the per-IP quota no longer consume global capacity (in-memory and Redis paths), so one client over its limit cannot starve others. - Allowlist tests no longer use /bin/sh as the "outside" path: on systems where /bin is a symlink to /usr/bin it really is inside /usr/bin. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The flagged constants are an HTTP header name and an environment variable name, not credentials. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This was referenced Nov 13, 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
Security and reliability fixes found in a code audit. Details per change are in the
Unreleasedsection ofCHANGELOG.md.Security
POST {config-ui-path}/api/save) was unauthenticated: anyone reaching the port could write a hook file and trigger it. It is now disabled unless-config-ui-token/CONFIG_UI_TOKENis set, and requires the token inX-Config-UI-Token, a JSON content type and a same-origin request.X-Forwarded-For/X-Real-IPunless the peer is listed in the new-trusted-proxies. New-rate-limit-per-ip-rps/-rate-limit-per-ip-burst(default0= same as global).multipart/form-datarequests (previously an empty body was signed).valuematch rule with an empty configured value never matches./opt/hooksused to allow/opt/hooks-evil/run.sh).X-Request-Idis discarded unless-x-request-idis on;-x-request-id-limitis enforced.Reliability
Waitis bounded, so the executor slot is always released.503+Retry-Afterwhen saturated instead of 200-then-drop.pass-file-to-commandtemp files are removed when no working directory is set.ip-whitelistwith mixed address families, panics in signature helpers andparse-parameters-as-json, body aliasing in the Scalr check, a data race inExtractCommandArgumentsForFile.PING.-max-header-bytesapplies when set to a non-default value;-read-header-timeout-secondslogs a warning (cannot be applied on fasthttp).Behaviour changes to review
-config-ui-tokenis configured.-trusted-proxies, otherwise all requests share the proxy's quota.503under saturation.Testing
go test ./...passes (24 packages),go vetandgofmtclean,-racerun onhook,server,security,middleware.app.js, not exercised in a browser), RedisPINGhealth check (no Redis available), unknown-key warning, shutdown ordering,-max-header-bytesmapping.🤖 Generated with Claude Code