feat(verify-build): pass --base-image and --features through build/verify#2
Draft
stegaBOB wants to merge 4 commits into
Draft
feat(verify-build): pass --base-image and --features through build/verify#2stegaBOB wants to merge 4 commits into
stegaBOB wants to merge 4 commits into
Conversation
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.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two passthrough inputs to keep the built
.soaligned with the verify PDA, and hardens the shell in both touched actions.Passthroughs (independent of the remote-verification flow):
base-image— onbuild-verifiedandverify-build, forwarded as--base-imagetosolana-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— onverify-build, forwarded as cargo args (-- --features …) toverify-from-repoandexport-pda-tx(build-verifiedalready had one).Both must match between the build and verify steps, or the verify-PDA won't align with the built
.so.Commits
feat— addbase-imagepassthrough.feat— addfeaturespassthrough.style— standardize empty checks on[ -n ](addresses Greptile P2).fix— shell-injection hardening (addresses Greptile P1, security): every${{ inputs.* }}/${{ github.event.inputs.* }}used inside arun:block is moved to a step-levelenv: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_ARGstay unquoted for intentional flag word-splitting, and single-value args are quoted.🤖 Generated with Claude Code