Skip to content

fix(aztec-up): add truncation protection to install scripts#21896

Merged
nchamo merged 1 commit intomerge-train/fairiesfrom
fix/install-truncation-protection
Mar 24, 2026
Merged

fix(aztec-up): add truncation protection to install scripts#21896
nchamo merged 1 commit intomerge-train/fairiesfrom
fix/install-truncation-protection

Conversation

@nchamo
Copy link
Copy Markdown
Contributor

@nchamo nchamo commented Mar 23, 2026

Problem

The install and aztec-install scripts are both fetched and executed via curl | bash (e.g. bash -i <(curl -s https://install.aztec.network) for aztec-install, and curl -fsSL "$install_url" | bash in aztec-up line 163 for install).

When bash reads from a pipe, it processes input incrementally. If the download is truncated mid-stream (network drop, CDN timeout, partial response), bash can execute the portion it has already read, leaving the system in a broken or partially-configured state. For example, a truncated install script could create the version directory and download the versions manifest but never install the actual toolchain binaries, leaving users with a seemingly-installed but non-functional version.

aztec-up itself already has this protection (lines 4-6 and 496-498), but the two scripts it downloads and pipes to bash did not.

Fix

Wrapped both scripts in { ... exit; }, the same pattern already used by aztec-up:

#!/usr/bin/env bash
# Guard against truncated curl downloads: bash must parse the entire {} block before executing any of it.
{
set -euo pipefail

# ... script body ...

main "$@"

# Explicit exit prevents bash from reading past the closing brace.
exit
}

The {} grouping forces bash to read and parse the entire block before executing any of it. If the download is truncated, bash hits a parse error (unclosed {) and refuses to run anything. The explicit exit before } ensures the shell terminates cleanly and doesn't attempt to parse any trailing data.

Files changed:

  • aztec-install: the root bootstrap script users invoke directly via curl
  • install: the per-version installer that aztec-up downloads and pipes to bash

Fixes F-481

@nchamo nchamo requested a review from charlielye as a code owner March 23, 2026 13:28
@nchamo nchamo self-assigned this Mar 23, 2026
@nchamo nchamo requested review from mverzilli and nventuro March 23, 2026 13:43
Copy link
Copy Markdown
Contributor

@mverzilli mverzilli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@nchamo nchamo merged commit 3d32a8f into merge-train/fairies Mar 24, 2026
12 checks passed
@nchamo nchamo deleted the fix/install-truncation-protection branch March 24, 2026 14:30
@AztecBot
Copy link
Copy Markdown
Collaborator

✅ Successfully backported to backport-to-v4-next-staging #21899.

AztecBot added a commit that referenced this pull request Mar 25, 2026
BEGIN_COMMIT_OVERRIDE
fix(aztec-up): narrow PATH cleanup regex to avoid removing user PATH
entries (#21828)
fix: consolidate blob source test into single summary log with supernode
detection (#21719)
fix: use anchor block on getL1ToL2MsgWitness (#21872)
fix: make sure queries are not made ahead of the anchor block (#21874)
chore(docs): backport docs infrastructure changes to v4 (#21437)
chore: backport PR #21836 (fix: explicitly handle initial block case for
getBlockHashMembershipWitness) to v4-next (#21891)
chore: backport PR #21813 (fix(aztec-up): strip leading v prefix from
version strings) to v4-next (#21912)
docs: document defi-wonderland immutable macro (#21764)
fix: pin typescript and harden lockfile check in docs examples CI (v4
backport) (#21914)
docs: expand circuit profiling guide and document kernel gate cost
overhead (#21770)
feat: cli-wallet (#21757)
chore: sync backport staging with v4-next HEAD (#21931)
fix: bot gas estimations (backport #21945) (#21947)
refactor(aztec-nr): use logging wrappers in
compute_note_hash_and_nullifier (#21897)
fix: backport v4 next staging (#21934)
fix: make PXE#getSyncedBlockHeader a concurrency=1 job to prevent IDB tx
liveness issues (#21944)
feat: add error page mapping for incompatible oracles (#21943)
fix(aztec-up): validate semver in uninstall to prevent path traversal
(#21892)
chore: merge v4-next into backport staging (fix ancestry) (#21954)
fix(aztec-up): add truncation protection to install scripts (#21896)
fix: noir format in compute_note_hash_and_nullifier.nr (#21956)
fix(stdlib): decode `EthAddress`, `FunctionSelector` and wrapped field
structs in `AbiDecoder` (#21926)
chore: update noir to nightly-2026-02-12-patch.1 (#21960)
fix: ensure empty docs examples does not populate yarn lock backport
(#21963)
fix: docs examples does not build on simple bootstrap backport (#21964)
fix: add rc/testnet version detection to API reference pages (#21966)
docs: document EmbeddedWallet automatic gas estimation and private
authwits (#21790)
fix(pxe): robust error handling in message processing (backport #21093)
(#21981)
chore: manually recreate backport (#21969)
chore: (A-779) load all accounts before calling
LogService.#getSecretsForSenders (#21923)
END_COMMIT_OVERRIDE
github-merge-queue Bot pushed a commit that referenced this pull request Mar 25, 2026
BEGIN_COMMIT_OVERRIDE
fix: interactions clean up (#21933)
fix(stdlib): decode `EthAddress`, `FunctionSelector` and wrapped field
structs in `AbiDecoder` (#21926)
fix: bot gas estimations (#21945)
refactor(aztec-nr): use logging wrappers in
compute_note_hash_and_nullifier (#21897)
feat: add error page mapping for incompatible oracles (#21943)
fix(pxe): robust error handling in message processing (#21093)
fix: make PXE#getSyncedBlockHeader a concurrency=1 job to prevent IDB tx
liveness issues (#21944)
fix(aztec-up): validate semver in uninstall to prevent path traversal
(#21892)
fix(aztec-up): add truncation protection to install scripts (#21896)
feat!: scoped capsules (#21533)
END_COMMIT_OVERRIDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants