Skip to content

bug(scripts): verify.sh still sources .env unsafely via shell source #612

Description

@K1NGD4VID

Summary

scripts/verify.sh loads its configuration with source .env (line 18), which executes the file as arbitrary shell code. scripts/deploy.sh had this exact vulnerability and was fixed (see closed issue #455) by replacing source with a safe line-by-line load_env parser that only accepts KEY=VALUE pairs. That fix was never applied to verify.sh.

Current Behavior

scripts/verify.sh:18 runs:

source .env

Any shell metacharacters, command substitutions, or malicious lines in .env (which may be populated from copy-pasted testnet output or third-party contributions) are executed with the privileges of whoever runs verify.sh.

Expected Behavior

verify.sh should load .env using the same safe load_env line-by-line parser already implemented in deploy.sh, ideally by extracting it into a shared helper both scripts source, so verify.sh gets the same CVE-class protection.

Acceptance Criteria

  • verify.sh no longer calls source .env directly
  • .env is parsed with the same safe KEY=VALUE-only logic used in deploy.sh
  • Shell metacharacters in .env values cannot cause code execution when running verify.sh
  • Existing verify.sh behavior (env var checks, contract invocations) is unchanged for well-formed .env files

Tech Stack

Bash — scripts/verify.sh, cross-reference scripts/deploy.sh's load_env function

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions