Skip to content

Security hygiene: gitignore, redact hardcoded secrets, update versions, add rate limiting and WS origin validation#100

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-gitignore-security-issues
Draft

Security hygiene: gitignore, redact hardcoded secrets, update versions, add rate limiting and WS origin validation#100
Copilot wants to merge 2 commits intomainfrom
copilot/fix-gitignore-security-issues

Conversation

Copy link

Copilot AI commented Feb 28, 2026

Six medium-severity findings around information exposure and configuration hygiene. Changes address all actionable items.

.gitignore

Was a single entry (.subnet-cli.pk). Added standard sensitive-file patterns: .env, *.pem, *.key, *.crt, *.log, .DS_Store, node_modules/.

README — sensitive data exposure

  • Removed internal Asana task URL (app.asana.com/0/1202305127727547/...)
  • Redacted hardcoded nodeID, BLS publicKey, and proofOfPossession from example info.getNodeID output — replaced with placeholder tokens

Outdated software versions in update scripts

chains/update-validator-{mainnet,testnet}.sh were pinned to AvalancheGo v1.10.11 / subnet-evm v0.5.6. Updated to match README-documented production versions:

-AVALANCHEGO_PREVIOUS_VERSION="1.10.7"
-AVALANCHEGO_VERSION="1.10.11"
-SUBNET_EVM_VERSION="0.5.6"
+AVALANCHEGO_PREVIOUS_VERSION="1.10.11"
+AVALANCHEGO_VERSION="1.14.1"
+SUBNET_EVM_VERSION="0.8.0"

Faucet Nginx — rate limiting on /api/

/api/ proxy had no access controls. Added limit_req_zone (10 req/min per IP, burst 5):

limit_req_zone $binary_remote_addr zone=faucet_api:10m rate=10r/m;
...
location /api/ {
    limit_req zone=faucet_api burst=5 nodelay;
    proxy_pass http://faucet;
}

RPC Nginx — WebSocket origin validation and timeouts

/ws proxy forwarded upgrade headers with no origin filtering and used nginx's default 60s read timeout (breaks long-lived connections). Added HTTPS-only origin allowlist via map and explicit timeouts:

map $http_origin $allowed_ws_origin {
    default "";
    "~^https://(testnetrpc\.num\.network|testnetrpc\.numbersprotocol\.io)$" $http_origin;
}
...
proxy_set_header Origin $allowed_ws_origin;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
Original prompt

This section details on the original issue you should resolve

<issue_title>[Security][Medium] Minimal .gitignore, hardcoded infrastructure details, outdated software versions</issue_title>
<issue_description>## Summary

Six medium-severity security findings related to information exposure and configuration hygiene:

1. Weak .gitignore (only 1 entry)

.gitignore only contains .subnet-cli.pk. Missing coverage for .env, *.pem, *.key, *.crt, staker.crt, staker.key, *.log, .DS_Store, node_modules/.

2. Hardcoded Infrastructure Details in Public Repository

README exposes internal Asana URL (https://app.asana.com/0/1202305127727547/...), P-Chain wallet addresses, BLS keys, transaction signature values (r, s), and Nginx templates revealing validator count (5 for testnet).

Suggested fix: Remove internal links, redact signature values, move Nginx templates to a private ops repo.

3. Outdated Software Versions in Scripts

Update scripts hardcode avalanchego v1.10.11 / subnet-evm v0.5.6, while README documents v1.14.1 / v0.8.0. The install-subnet-cli.sh pins v0.0.2 (extremely outdated).

Files: chains/update-validator-mainnet.sh (lines 3-5), chains/update-validator-testnet.sh (lines 3-5)

4. Genesis Files Allocate Entire Supply to Single Address

All genesis files allocate 100% of initial token supply to a single address. Combined with the single admin key controlling minting, this creates concentrated risk.

5. Faucet API Missing Rate Limiting

faucet/default (lines 127-129) proxies /api/ to backend without rate limiting, CAPTCHA, or authentication.

6. Websocket Proxy Missing Origin Validation

rpc/testnet/.../default (lines 134-140) passes upgrade headers without Origin validation or timeout configuration.

🤖 Generated with Claude Code</issue_description>

Comments on the Issue (you are @copilot in this section)


🔒 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.

…sions, rate limiting, WS validation

Co-authored-by: numbers-official <181934381+numbers-official@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix security issues in .gitignore and hardcoded details Security hygiene: gitignore, redact hardcoded secrets, update versions, add rate limiting and WS origin validation Feb 28, 2026
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.

[Security][Medium] Minimal .gitignore, hardcoded infrastructure details, outdated software versions

2 participants