security: harden defaults for network-exposed deployments#69
Merged
RaghavChamadiya merged 2 commits intomainfrom Apr 11, 2026
Merged
security: harden defaults for network-exposed deployments#69RaghavChamadiya merged 2 commits intomainfrom
RaghavChamadiya merged 2 commits intomainfrom
Conversation
Addresses a chain of vulnerabilities that combine into unauthenticated root RCE when repowise is deployed via Docker with default settings. Changes: - deps.py: fail-closed auth when binding 0.0.0.0 without API key, use hmac.compare_digest() for constant-time key comparison - schemas.py: validate local_path in RepoCreate (must be a real git repo, no path traversal via '..') - tool_why.py: sanitize stem passed to git log --grep, add '--' separator to prevent argument injection - Dockerfile: run as non-root user, copy Node.js from builder stage instead of piping curl|bash - docker-compose.yml: bind ports to 127.0.0.1, require REPOWISE_API_KEY and REPO_PATH, mount repos read-only Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7 tasks
swati510
approved these changes
Apr 11, 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
Rebased and updated version of #26 by @phjlljp. Applied the 503 to 403 status code fix. All credit to the original author.
Addresses a chain of vulnerabilities that combine into unauthenticated root RCE when repowise is deployed via Docker with default settings.
Changes
REPOWISE_HOST=0.0.0.0and no API key is set (returns 403). Useshmac.compare_digest()for constant-time key comparison. Localhost deployments remain open.RepoCreate.local_path: rejects..path segments, requires directory to exist and contain.git. Returns resolved absolute path.stemto[a-zA-Z0-9_\-.]before passing togit log --grep. Adds--separator to prevent argument injection.repowiseuser. Copies Node.js from builder stage instead of pipingcurl | bash.127.0.0.1. RequiresREPOWISE_API_KEYandREPO_PATHenv vars. Mounts repos read-only.Based on #26 by @phjlljp