Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
crypto-bigint 0.5 has no fix for the non-constant-time arithmetic in RUSTSEC-2026-0387; it is pinned by the elliptic-curve 0.13 stack and by our own SLIP-0010 code. Move k256/p256/elliptic-curve to 0.14, pkcs8 to 0.11, sec1 to 0.8, crypto-bigint to 0.7, scrypt to 0.12 and bip32 to 0.6. ic-agent and friends come from the matching agent-rs branch via [patch.crates-io] until it is released; deny.toml allows that git source for now. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The cryptographic migration needs final human verification after the upstream agent-rs release and documented pre-merge dependency cleanup.
No open issues 🎉
What changed in this PR
Migrates the CLI’s identity cryptography to RustCrypto 0.14 to address RUSTSEC-2026-0387, replacing the vulnerable crypto-bigint dependency.
Changes:
- Updates cryptographic dependencies and temporarily uses the upstream agent-rs migration branch.
- Adapts identity import, encryption, and SLIP-0010 derivation to the new APIs while retaining existing encryption parameters.
- Adds a dedicated error variant for malformed elliptic-curve DER keys.
| File | Description |
|---|---|
deny.toml |
Temporarily permits the agent-rs Git source. |
crates/icp-cli/src/commands/identity/import.rs |
Updates PKCS#8 parsing and elliptic-curve decoding errors. |
crates/icp-app/src/identity/seed/slip10.rs |
Migrates scalar arithmetic and public-key encoding APIs. |
crates/icp-app/src/identity/key.rs |
Updates identity serialization and encryption APIs. |
Cargo.toml |
Upgrades cryptographic dependencies and adds temporary agent-rs patches. |
Cargo.lock |
Records upgraded dependencies and the agent-rs Git revision. |
Review effort: Balanced
This branch has not been deployed
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.
Real fix for RUSTSEC-2026-0387 (
crypto-bigintnon-constant-time arithmetic), which #844 ignores for now.crypto-bigint0.5 has no fixed release, and both the elliptic-curve 0.13 stack and our SLIP-0010 code pin it.k256/p256/elliptic-curve0.14,pkcs80.11,sec10.8,crypto-bigint0.7,scrypt0.12 andbip320.6.from_sec1_dernow returnselliptic_curve::DecodeError, soidentity importgets its ownBadEcDerKeyvariant for it.Blocked on dfinity/agent-rs#745 and an ic-agent release. Until then, ic-agent comes from that branch through
[patch.crates-io], anddeny.tomlallows the git source.Before merging:
ic-agent/ic-utils/ic-identity-hsmto the release; drop[patch.crates-io]andallow-gitRUSTSEC-2026-0387ignore fromdeny.toml. Once the advisory no longer applies, cargo-deny only warns about the stale ignore (advisory-not-detected); it doesn't fail.Tested locally against the agent-rs branch:
cargo deny checkpasses in full; clippy is clean;icp-app,icp-cliunit andidentity_testspass, except the SoftHSM andmopstests, because those tools aren't installed here.🤖 Generated with Claude Code