T03 · Remote Payload Retrieval and Execution
Error
- Location
- scripts/setup.sh:12
- Finding
- Unpinned Remote Source Is Retrieved, Built, and Executed## Vulnerability Details **File Location**: `scripts/setup.sh:12-18` and `scripts/setup.sh:48-68` **Vulnerability Type**: Mutable remote payload retrieval and execution **Risk Level**: High The installation metadata also initiates the same unpinned clone at `SKILL.md:9-15`. ### Vulnerable Code ```bash # 0. Clone ATL if needed if [ ! -d "$ATL_ROOT" ]; then echo "" echo "0️⃣ Cloning ATL repository..." git clone https://github.com/JordanCoin/Atl "$ATL_ROOT" echo " ✅ Cloned to $ATL_ROOT" fi ``` The retrieved source is subsequently built and installed: ```bash # 2. Build ATL (if repo exists) echo "" echo "2️⃣ Building ATL..." if [ -d "$ATL_REPO" ]; then cd "$ATL_REPO" # Build targeting the booted simulator xcodebuild -workspace AtlBrowser.xcworkspace \ -scheme AtlBrowser \ -destination "id=$UDID" \ -derivedDataPath /tmp/atl-dd \ build 2>/dev/null | grep -E "^(Build|Compile|Link|===)" || true echo " ✅ Build complete" # 3. Install echo "" echo "3️⃣ Installing ATL..." APP_PATH="/tmp/atl-dd/Build/Products/Debug-iphonesimulator/AtlBrowser.app" if [ -d "$APP_PATH" ]; then xcrun simctl install "$UDID" "$APP_PATH" echo " ✅ Installed" else echo " ⚠️ App not found at $APP_PATH" echo " Try building manually: cd $ATL_REPO && xcodebuild ..." fi ``` The Skill installation metadata contains an equivalent mutable retrieval instruction: ```yaml install: - id: "atl-clone" kind: "shell" command: "git clone https://github.com/JordanCoin/Atl ~/Atl" label: "Clone ATL repository" - id: "atl-setup" kind: "shell" command: "~/.openclaw/skills/atl-browser/scripts/setup.sh" label: "Build and install ATL to simulator" ``` ### Technical Analysis The setup process clones the mutable default branch of an external GitHub repository. It does not pin a reviewed commit SHA, validate a cryptographic checksum, or verify a signed release or tag before invoking `xcodebuild`. Consequ ...[truncated 2552 chars]
- Remediation
- ## Remediation Suggestions 1. Pin the dependency to a reviewed full commit SHA rather than cloning the current default branch. ```bash ATL_COMMIT="REVIEWED_FULL_COMMIT_SHA" git clone --no-checkout https://github.com/JordanCoin/Atl "$ATL_ROOT" git -C "$ATL_ROOT" checkout --detach "$ATL_COMMIT" ``` 2. Verify the checked-out revision before building and abort on any mismatch. ```bash actual_commit=$(git -C "$ATL_ROOT" rev-parse HEAD) if [ "$actual_commit" != "$ATL_COMMIT" ]; then echo "Unexpected ATL revision: $actual_commit" >&2 exit 1 fi ``` 3. Prefer a signed, immutable release artifact. Verify its signature and a hardcoded SHA-256 checksum before extraction or execution. 4. Review all Xcode build phases, package dependencies, scripts, and generated configuration at the pinned revision. Document the approved revision in both `SKILL.md` and `scripts/setup.sh`. 5. Where practical, vendor the reviewed source into the Skill package so that the audited files are the files that will be built. 6. Preserve and validate the actual `xcodebuild` exit status. Do not hide errors with `2>/dev/null` and `|| true`. If output filtering is required, inspect `PIPESTATUS[0]` and terminate when the build fails. 7. Perform the build in an isolated environment with minimal credentials and filesystem access. Avoid building remote source in a user session containing sensitive development credentials. 8. Require an explicit update and review process when changing the pinned revision rather than silently consuming upstream changes.
