spawn/shared
A 24c705cd27
fix: validate env-loaded tokens to prevent curl config injection (#1687)
* fix: validate env-loaded tokens to prevent curl config injection

_load_token_from_env() performed zero validation on API token values
from environment variables before they reached _curl_api(), which
passes auth headers via curl's -K stdin config. A token containing a
double-quote could break out of the config's quoted string and inject
additional curl directives (e.g., redirecting the request to an
attacker-controlled server).

_load_token_from_config() already validates with the same regex
(^[a-zA-Z0-9._/@:+=, -]+$). This adds the same check to the env
path, closing the defense-in-depth gap across all token-loading paths.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat: pre-built Docker image for OpenClaw on Fly.io (#1686)

Eliminates the slow waitForCloudInit() + bun install phase by booting
a pre-built image with Node.js, bun, and openclaw already installed.
The image is rebuilt daily via GitHub Actions to pick up new releases.

Other agents are unaffected — they still use ubuntu:24.04 + cloud-init.

Co-authored-by: spawn-bot <spawn-bot@openrouter.ai>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* fix: use positional params in macOS curl path to prevent command injection (#1685)

**Why:** The macOS fallback in `request_missing_cloud_keys()` used
`${providers_json}` directly in a curl `-d` argument. If `providers_json`
contained shell metacharacters (e.g., from a failed python3 call), this
could execute arbitrary commands. The Linux path already used the safe
positional parameter pattern (`bash -c '...' -- "$1" "$2" "$3"`).

Unifies both code paths to use the safe positional parameter pattern.

Fixes #1684

Agent: team-lead

Co-authored-by: B <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix: update test to expect rejection of tokens with newlines

The _load_token_from_env validation now rejects tokens containing
newline characters to prevent curl config injection. Update the test
to expect exit code 1 and verify the warning message is emitted.

Agent: pr-maintainer
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

---------

Co-authored-by: B <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: spawn-bot <spawn-bot@openrouter.ai>
2026-02-22 03:51:30 -05:00
..
common.sh fix: validate env-loaded tokens to prevent curl config injection (#1687) 2026-02-22 03:51:30 -05:00
github-auth.sh fix: add --no-install-recommends to all apt calls across clouds (#1631) 2026-02-21 18:12:19 -05:00
key-request.sh fix: use positional params in macOS curl path to prevent command injection (#1685) 2026-02-22 02:54:32 -05:00