T09 · Insecure Skill Coding Practices
- Location
SKILL.md:159- Finding
Unvalidated Remote Bootnode Data Is Injected into an Executable Shell Script
- Content
View full analysis
~/rydberg-agent/start-bg.sh << 'SCRIPT' #!/usr/bin/env bash cd ~/rydberg-agent ./gprobe \ --datadir ./data \ --networkid 8004 \ --port 30398 \ --http --http.addr 127.0.0.1 --http.port 8549 \ --http.api "probe,net,web3,pob,txpool" \ --http.corsdomain "http://localhost:*" \ --consensus pob \ --miner.probebase ADDR_PLACEHOLDER \ --password ./password.txt \ --ipcpath ~/rydberg-agent/gprobe.ipc \ --bootnodes "ENODE_PLACEHOLDER" \ --verbosity 3 > node.log 2>&1 & ./gprobe attach ~/rydberg-agent/gprobe.ipc --exec "admin.addPeer('ENODE_PLACEHOLDER')" 2>/dev/null SCRIPT sed -i.bak "s|ADDR_PLACEHOLDER|$ADDR|g; s|ENODE_PLACEHOLDER|$ENODE|g" ~/rydberg-agent/start-bg.sh rm -f ~/rydberg-agent/start-bg.sh.bak chmod +x ~/rydberg-agent/start-bg.sh ``` ### Technical Analysis The first line of the remotely hosted `bootnodes.txt` file is assigned to `ENODE` and substituted directly into an executable shell script using `sed`. The value is not validated against the expected enode URI syntax and is not escaped for either of the contexts in which it is embedded: 1. A double-quoted shell argument to `--bootnodes`. 2. A quoted JavaScript expression supplied to the local IPC console. Although the URL uses HTTPS and references a release tag, the tag and repository remain under upstream control. A release tag is not necessarily an immutable commit. If the repository, maintainer account, tag, or retrieved file ...[truncated 1518 chars]- Remediation
View remediation
