T03 · Remote Payload Retrieval and Execution
Warning
- Location
- moltbook.py:101
- Finding
- Mutable Remote Payload Retrieval and Execution<![CDATA[ ## Vulnerability Details **File Location**: `README.md:33-38`, `SKILL.md:38-44`, and `moltbook.py:101-132` **Vulnerability Type**: Remote payload retrieval and execution without cryptographic verification **Risk Level**: Medium ### Vulnerable Code `README.md:33-38`: ```bash # 1. Install (GitHub — always up to date) git clone https://github.com/ubgb/moltmemory ~/.openclaw/skills/moltmemory # Or single file: mkdir -p ~/.openclaw/skills/moltmemory curl -s https://raw.githubusercontent.com/ubgb/moltmemory/main/moltbook.py > ~/.openclaw/skills/moltmemory/moltbook.py ``` `SKILL.md:38-44`: ```bash # Clone to your skills folder mkdir -p ~/.openclaw/skills/moltmemory curl -s https://raw.githubusercontent.com/YOUR_REPO/moltmemory/main/SKILL.md > ~/.openclaw/skills/moltmemory/SKILL.md curl -s https://raw.githubusercontent.com/YOUR_REPO/moltmemory/main/moltbook.py > ~/.openclaw/skills/moltmemory/moltbook.py chmod +x ~/.openclaw/skills/moltmemory/moltbook.py ``` `moltbook.py:101-132`: ```python def check_for_updates(state, auto_update=None): """ Check GitHub for a newer version. Only runs every 12h to avoid rate limiting. If auto_update=True (or MOLTMEMORY_AUTO_UPDATE=1 env var), pulls automatically. Returns a status string, or None if current or check failed. """ should_auto = auto_update if auto_update is not None else AUTO_UPDATE now = datetime.now(timezone.utc) last = state.get("last_version_check") if last: diff = (now - datetime.fromisoformat(last)).total_seconds() if diff < 43200: # 12 hours return None try: req = urllib.request.Request( f"https://api.github.com/repos/{GITHUB_REPO}/releases/latest", headers={"User-Agent": f"moltmemory/{CURRENT_VERSION}"}, ) with urllib.request.urlopen(req, timeout=5) as r: data = json.load(r) latest = data.get("tag_name", "").lstrip("v") state["last_version_check"] = now.iso ...[truncated 3289 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin installation commands to a specific audited commit SHA or immutable, versioned release artifact rather than `main`. 2. Publish SHA-256 checksums or signed release manifests and verify them before placing files in the executable skill directory. 3. Replace every `YOUR_REPO` placeholder with the canonical repository URL, or remove the unsafe single-file installation path. 4. Use failure-aware download options such as `curl --fail --show-error --location` and download to a temporary file before verification and atomic installation. 5. Keep automatic updates disabled by default, as currently configured, and clearly document their code-execution implications. 6. If automatic updates are retained, verify signed tags or commits against an explicitly trusted maintainer key before applying them. 7. Stage updates outside the active skill directory, validate their origin and integrity, and require explicit approval before activation. ]]>
