Skip to content

Fix CRITICAL/HIGH/MEDIUM issues from round 4 audit#6

Merged
JoshDFN merged 1 commit intomainfrom
fix/round4-verification-fixes
Feb 26, 2026
Merged

Fix CRITICAL/HIGH/MEDIUM issues from round 4 audit#6
JoshDFN merged 1 commit intomainfrom
fix/round4-verification-fixes

Conversation

@JoshDFN
Copy link
Copy Markdown
Collaborator

@JoshDFN JoshDFN commented Feb 26, 2026

Summary

Round 4 of multi-agent verification audit found and fixed issues across 8 skills.

CRITICAL (4 fixes):

  • internet-identity: StableCell::init().unwrap() won't compile with ic-stable-structures 0.7 (returns Self not Result)
  • icrc-ledger: Config block used icp.json (JSON) but icp-cli uses icp.yaml (YAML)
  • wallet: create_canister called with wrong signature; needs create_canister_with_extra_cycles
  • wallet: Cycles API functions used wrong names/paths (msg_cycles_available128msg_cycles_available)

HIGH (5 fixes):

  • ckbtc: Missing transient on actor references (upgrade failure), removed stub getBalance that returned hardcoded 0
  • evm-rpc: CustomRpcService.headers used tuple instead of struct, transactions_root incorrectly Option
  • asset-canister: AssetManager import reverted to @dfinity/assets (not yet migrated to @icp-sdk)
  • icrc-ledger: --storage-mode=plaintext--storage plaintext (icp-cli flag)
  • wallet: CanisterSettings missing wasm_memory_threshold field

MEDIUM (4 fixes):

  • internet-identity/asset-canister: new HttpAgent()HttpAgent.create() for @icp-sdk/core v5
  • vetkd: Stale dfinity/examples reference, @dfinity/vetkeys@icp-sdk/vetkeys
  • sns-launch: Added missing [package] and [lib] to Cargo.toml

Test plan

  • npm run build passes
  • Next round of verification to confirm fixes

CRITICAL fixes:
- internet-identity: Remove .unwrap() on StableCell::init() (v0.7 returns Self not Result)
- icrc-ledger: Convert icp.json config to icp.yaml (icp-cli uses YAML)
- wallet: Fix create_canister → create_canister_with_extra_cycles, fix cycles API paths
- evm-rpc: Add deprecation note on call_with_payment128 import path

HIGH fixes:
- ckbtc: Add transient to actor refs, remove stub getBalance that returned 0
- evm-rpc: Fix CustomRpcService.headers type (struct not tuple), fix transactions_root optionality
- asset-canister: Fix AssetManager import to @dfinity/assets (not yet migrated to @icp-sdk)
- icrc-ledger: Fix --storage-mode flag to --storage
- wallet: Add missing wasm_memory_threshold field to CanisterSettings

MEDIUM fixes:
- internet-identity: new HttpAgent() → HttpAgent.create() for @icp-sdk/core v5
- asset-canister: new HttpAgent() → HttpAgent.create()
- vetkd: Fix stale dfinity/examples reference, update @dfinity/vetkeys to @icp-sdk/vetkeys
- sns-launch: Add missing [package] and [lib] sections to Cargo.toml
@JoshDFN JoshDFN merged commit 48a5e5e into main Feb 26, 2026
2 checks passed
@marc0olo marc0olo deleted the fix/round4-verification-fixes branch February 27, 2026 14:47
marc0olo added a commit that referenced this pull request Feb 27, 2026
The "Frontend — Safe Agent Configuration" section used the deprecated
@dfinity/agent package and is out of scope for a canister security skill.
The fetchRootKey warning remains in pitfall #6.
marc0olo added a commit that referenced this pull request Mar 31, 2026
- Remove asset-canister-specific content (pitfall #6, .ic-assets.json5
  step, Vite directory layouts) from custom-domains skill
- Replace with canister-agnostic instructions and scoped notes for
  asset canister vs custom http_request canisters
- Generalize deploy steps to not prescribe specific commands
- Rewrite ic-domains eval to be canister-agnostic
- Adjust expected behaviors to test for actionable guidance rather
  than keyword matching
marc0olo added a commit that referenced this pull request Mar 31, 2026
* Custom domain skill

* Add custom-domains.json

* chore: make custom-domains canister-agnostic and clean up trigger separation

- custom-domains skill now acknowledges it works with any HTTP-serving
  canister, not just asset canisters
- asset-canister description and body trimmed to cross-reference
  custom-domains instead of duplicating setup instructions
- added should_not_trigger entries to both eval files for clean routing

* chore: generalize custom-domains skill and refine evals

- Remove asset-canister-specific content (pitfall #6, .ic-assets.json5
  step, Vite directory layouts) from custom-domains skill
- Replace with canister-agnostic instructions and scoped notes for
  asset canister vs custom http_request canisters
- Generalize deploy steps to not prescribe specific commands
- Rewrite ic-domains eval to be canister-agnostic
- Adjust expected behaviors to test for actionable guidance rather
  than keyword matching

---------

Co-authored-by: Marco Walz <marco.walz@dfinity.org>
sea-snake added a commit that referenced this pull request May 6, 2026
Replaces the manual Prim.callerInfoSigner / Prim.callerInfoData dance
with CallerAttributes.getAttributes<system>() from mo:core (>= 2.5.0).
The wrapper bakes in the trusted-signer check via the canister's
trusted_attribute_signers env var, so the example no longer hardcodes
the II principal in code: it moves to icp.yaml as deploy-time config.

Notable changes:

- Motoko example now imports mo:core/CallerAttributes (no more mo:prim)
  and reads time via mo:core/Time (Time.now() : Int) instead of the
  broken Nat64.toNat(Prim.time()) which had no Nat64 import.
- consumePendingNonce stub mirrors the Rust register_finish pattern so
  the example compiles standalone.
- New "Configuring trusted_attribute_signers" subsection shows the
  icp.yaml settings.environment_variables snippet.
- Mistake #9 split per language: Motoko points at the env-var-based
  check, Rust still requires explicit msg_caller_info_signer.
- Prerequisites bumps mo:core minimum to >= 2.5.0.
- OpenID scopedKeys example wrapped in an async function to avoid
  bare top-level await at module scope (fixes the same Vite es2020
  failure mode eval #6 already covers).
- Eval #9 expected behavior accepts either the explicit Rust signer
  check or the Motoko env-var check.

Rust path is unchanged: there is no ic-cdk wrapper yet.
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