Skip to content

feat(verify-build): pass --base-image and --features through build/verify#2

Draft
stegaBOB wants to merge 4 commits into
mainfrom
feat/base-image-input
Draft

feat(verify-build): pass --base-image and --features through build/verify#2
stegaBOB wants to merge 4 commits into
mainfrom
feat/base-image-input

Conversation

@stegaBOB

@stegaBOB stegaBOB commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds two passthrough inputs to keep the built .so aligned with the verify PDA, and hardens the shell in both touched actions.

Passthroughs (independent of the remote-verification flow):

  • base-image — on build-verified and verify-build, forwarded as --base-image to solana-verify build / verify-from-repo / export-pda-tx. Lets callers pin the build image when a program's Solana version isn't in solana-verify's built-in image map (otherwise the build errors and asks for --base-image).
  • features — on verify-build, forwarded as cargo args (-- --features …) to verify-from-repo and export-pda-tx (build-verified already had one).

Both must match between the build and verify steps, or the verify-PDA won't align with the built .so.

Commits

  1. feat — add base-image passthrough.
  2. feat — add features passthrough.
  3. style — standardize empty checks on [ -n ] (addresses Greptile P2).
  4. fixshell-injection hardening (addresses Greptile P1, security): every ${{ inputs.* }} / ${{ github.event.inputs.* }} used inside a run: block is moved to a step-level env: block and referenced as a quoted $VAR, so values are data rather than script text. Covers both the new inputs and the pre-existing interpolations in the same steps. Behavior is unchanged — $ARGS / $CARGO_ARGS / $BASE_IMAGE_ARG stay unquoted for intentional flag word-splitting, and single-value args are quoted.

🤖 Generated with Claude Code

stegaBOB added 2 commits July 1, 2026 18:13
Adds an optional 'base-image' input to both actions, forwarded to
solana-verify's --base-image flag in three call sites:
  - build-verified  → solana-verify build
  - verify-build    → solana-verify verify-from-repo  (devnet path)
  - verify-build    → solana-verify export-pda-tx     (Squads path)

Consumers that don't set the input keep the existing behavior
(solana-verify falls back to [workspace.metadata.cli] solana in
Cargo.toml). Consumers that DO set it can drive both the local
verified build and the on-chain verify-PDA from a single value
(e.g. Anchor.toml [toolchain] solana_version), avoiding the
two-source-of-truth drift between Cargo.toml and Anchor.toml.

Must be passed identically to both actions — if only one side gets
the override, OtterSec re-builds with the PDA's image, which won't
match the .so produced locally, and verification fails.
…xport-pda-tx

Mirrors build-verified's features input. Forwarded as trailing
'-- --features <value>' so the verify-PDA's 'args' field records
the cargo args used — OtterSec then replays the build with the
same features and the hash matches.

Without this, build-verified with --features X produces a .so
whose hash won't match what a verifier rebuilds without features:
silent failure on any release that toggles a feature flag.
stegaBOB and others added 2 commits July 16, 2026 14:10
Standardize on '[ -n ]' instead of the '[ ! -z ]' spelling used by the
existing FEATURES guard. Functionally identical; addresses Greptile P2.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…injection

Every ${{ inputs.* }} / ${{ github.event.inputs.* }} used inside a run:
block is expanded into the script text by the Actions template engine
before bash parses it, so shell metacharacters in a value execute. Move
all such values to step-level env: blocks and reference them as quoted
shell variables ($VAR), so values are data, not code. Single-value args
are quoted; $ARGS/$CARGO_ARGS/$BASE_IMAGE_ARG stay unquoted for
intentional flag word-splitting. Addresses Greptile P1 (security), and
hardens the pre-existing interpolations in the same steps too.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant