dfx 0.33.1 patches asset‑canister evidence collision and enforces length‑prefixed encoding

·

A critical encoding flaw in the asset canister’s proposal evidence was fixed in dfx 0.33.1, requiring coordinated upgrades of both the canister module and the SDK for all DAO‑controlled front‑ends. The 0.33.0 SDK introduced a new evidence format for the asset canister: every variable‑length field (asset keys, content types, header names/values, declared SHA‑256, and the asset payload) is now length‑prefixed and hashed behind a version‑tagged domain separator. This change makes the digest injective over the batch changes and raises the canister’s API version to 3, causing dfx deploy commands to reject mismatched canister versions. [1] Shortly after release, a security advisory disclosed that the new encoding in versions prior to 0.33.1 was still vulnerable: two distinct batches could generate the same SHA‑256 evidence, allowing a holder of only the Prepare permission to alter a batch after voters had approved it. The flaw could be abused to drop security headers or replace an approved asset with a no‑op, while the evidence hash remained unchanged. The impact is limited to asset canisters where Commit is governed (e.g., SNS front‑ends) and Prepare is delegated to developers or CI keys. [2] What changed in 0.33.1 dfx 0.33.1 fully length‑prefixes every field, hashes the header count, and tags the encoding with a version identifier. Evidence is now discarded whenever any batch argument changes, and the commit operation is performed in a single message, preventing a stale batch from being applied after a failed commit. The asset‑canister module hash was updated to aa4d4bf302178a281b7590e2bf8a275fbcfb3a17ba0eb27bd04429124d06edb0. [2] Because the evidence computation differs from earlier releases, any batch proposed before the upgrade becomes invalid. Developers must recompute and re‑verify evidence with the new SDK, and proposals must be re‑submitted after the canister upgrade. [1] [2] Migration steps for DAO‑controlled front‑ends Upgrade the asset canister to the 0.33.1 assetstorage.wasm.gz module (module hash above). [2] Submit an UpgradeSnsControlledCanister proposal so voters can verify the new module hash. [2] Upgrade all developer machines and CI pipelines to dfx 0.33.1; older dfx versions will compute mismatched evidence. [2] Re‑run compute‑evidence for any pending batch and resubmit the proposal; ensure the batch fits within a single message or split it. [2] Practical example dfx canister call asset_canister compute_evidence '(record { batch_id = 42 })' --network ic Running the command with dfx 0.33.1 will produce a hash that matches the upgraded canister’s new encoding. Attempting the same call with an older SDK will error out, signalling the version mismatch. [1] [2] Sources 0.33.0 Security advisory: asset canister proposal evidence (fixed in dfx 0.33.1)