Security hardening: shell injection, Nginx proxy, download integrity, Avalanchego binding#99
Closed
Security hardening: shell injection, Nginx proxy, download integrity, Avalanchego binding#99
Conversation
…tegrity, Avalanchego host binding Co-authored-by: numbers-official <181934381+numbers-official@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Harden Nginx proxy security configurations for API
Security hardening: shell injection, Nginx proxy, download integrity, Avalanchego binding
Feb 28, 2026
Contributor
|
關閉此 PR。此 PR 為 copilot-swe-agent 自動生成,未經人工審查,且帶入過多未驗證的變更(新增腳本、CI pipeline、runbook 等)。相關的底層需求若確認必要,將以精準的獨立修復處理。 |
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.
Four high-severity security issues across API scripts, Nginx configs, download scripts, and Avalanchego configuration docs.
Shell injection in API scripts
Replaced unsafe
$1string interpolation incurlJSON payloads withjq -n --argacross all six affected scripts:Input validation for subnet-cli scripts
Added allowlist regex validation on
$1before passing to CLI tools; quoted all variable interpolations:^[a-zA-Z0-9_-]+$^[a-km-zA-HJ-NP-Z1-9]+$(base58)Download integrity verification
Added
EXPECTED_SHA256variable andsha256sum -c -verification to all four install/update scripts. Script aborts on mismatch; warns if the variable is left empty (backward-compatible).Nginx proxy hardening (
rpc/testnet,faucet)limit_req_zone+limit_req(10 r/s RPC, 5 r/s faucet)X-Frame-Options,X-Content-Type-Options,Content-Security-Policy,HSTSclient_max_body_size 1mproxy_set_header X-Real-IPandX-Forwarded-Foron all proxy locationsAvalanchego host binding (README)
Changed all example invocations from
--http-host=0.0.0.0 --http-allowed-hosts="*"to--http-host=127.0.0.1 --http-allowed-hosts="localhost,127.0.0.1,<rpc-hostname>", with a note to front with a reverse proxy.Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.