T03 · Remote Payload Retrieval and Execution
- Location
scripts/build_from_source.sh:5- Finding
Mutable Remote Repository Code Is Executed with Root Privileges
- Content
View full analysis
/dev/null; then UBUNTU_VER=$(grep VERSION_ID /etc/os-release | cut -d= -f2 | tr -d '"' | tr -d '.') echo "Installing deps for Ubuntu $UBUNTU_VER..." sudo make -C Build depend-ubuntu${UBUNTU_VER} || \ sudo make -C Build depend-ubuntu22 echo "Building..." make -C Build ubuntu${UBUNTU_VER} || make -C Build ubuntu22 elif grep -qi debian /etc/os-release 2>/dev/null; then sudo make -C Build depend-raspios12 make -C Build raspios12 ``` ### Technical Analysis The build script clones code from a mutable Git branch and immediately executes Makefile targets supplied by the downloaded repository. It does not pin the source to a reviewed commit, verify a signed commit or tag, or validate the downloaded content against a trusted checksum. Both `REPO_URL` and `BRANCH` are inherited from environment variables. A caller capable of influencing the script environment can redirect the clone to an attacker-controlled repository. Even without environment manipulation, compromise or malicious modification of the upstream mutable branch would alter ...[truncated 2439 chars]- Remediation
View remediation
