fix: close security and compatibility gaps - #10
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR tightens the SDK and relayer security model while locking compatibility to Stellar SDK 16.3.x (avoiding the Stellar SDK 17 auth API changes). It introduces stricter WebAuthn requirements, separates “generic” signing from “administrative/mutation” signing, and hardens relayer-proxy validation and fee limits.
Changes:
- Enforce stricter passkey/WebAuthn behavior (user verification required; require and validate browser-provided P-256 public keys).
- Split transaction signing into non-admin vs admin flows and bind admin authorization roots to the exact transaction host function.
- Harden relayer client/proxy validation (explicit success flag, validated tx hash, missing-account parsing, total-fee ceiling) and update dependency/CI/documentation accordingly.
Reviewed changes
Copilot reviewed 53 out of 55 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/validation.ts | Rejects default deployer as a delegated signer. |
| src/validation.test.ts | Adds coverage for delegated default deployer rejection. |
| src/utils.ts | Hardens WebAuthn public-key extraction (require response.publicKey, validate P-256 point). |
| src/utils.test.ts | Adds tests for missing/publicKey validation and malformed/off-curve keys. |
| src/types.ts | Clarifies semantics of omitted isPrimary. |
| src/relayer.ts | Requires explicit { success: true } relayer responses. |
| src/relayer.test.ts | Updates relayer response expectations to fail-closed without success. |
| src/managers/multi-signer-manager.ts | Adds admin vs generic multi-signer paths and wallet-mutation binding/expiry handling. |
| src/managers/multi-signer-manager.test.ts | Tests generic refusal of wallet mutations and admin host-function binding. |
| src/managers/context-rule-manager.ts | Sorts policy maps before submitting rule mutations. |
| src/managers/context-rule-manager.test.ts | Updates test data for policy map ordering expectations. |
| src/kit/webauthn-ops.ts | Requires user verification; enforces wallet-mutation intent checks and contract binding during signing. |
| src/kit/webauthn-ops.test.ts | Verifies userVerification enforcement and expiration handling behavior. |
| src/kit/wallet-ops.ts | Requires user verification during connect/auth flows. |
| src/kit/tx-ops.ts | Validates relayer tx hash; adds admin host-function binding options to signing paths. |
| src/kit/tx-ops.test.ts | Adds relayer hash validation coverage and admin-signing operation constraints. |
| src/kit/policies-ops.ts | Adds sortPolicyMap() and typed invalid-policy-address validation. |
| src/kit/policies-ops.test.ts | Adds ordering tests and ValidationError coverage for invalid addresses. |
| src/kit/context-rules.ts | Updates CreateContract/CreateContractV2 WASM hash extraction to SDK 16 accessors. |
| src/kit/context-rules.test.ts | Adds CreateContractV2 WASM-hash extraction test coverage. |
| src/kit/auth-payload.ts | Adds wallet-mutation detection/binding (assertWalletMutationIntent). |
| src/kit/auth-payload.test.ts | Tests refusal/acceptance rules for mutation intent binding. |
| src/kit.ts | Adds signAdmin / signAndSubmitAdmin; routes internal signing through signAuthEntryInternal. |
| src/kit.test.ts | Adds admin host-function binding tests and verifies internal options are not accepted via public API. |
| src/indexer.ts | Updates indexer provider wording (Mercury) and token expectations text. |
| src/index.ts | Adjusts export grouping comment (display helpers). |
| src/execute.test.ts | Updates execute helper expectations to use admin submit method. |
| src/builders.ts | Renames comment section to “Display Helper Functions”. |
| SECURITY.md | Documents known low-severity elliptic@6.6.1 advisory and CI audit policy. |
| relayer-proxy/wrangler.toml | Adds MAX_TOTAL_FEE_STROOPS config. |
| relayer-proxy/worker-configuration.d.ts | Adds MAX_TOTAL_FEE_STROOPS typing for Worker env. |
| relayer-proxy/src/index.ts | Adds total-fee ceiling enforcement, improves CORS allow-headers, and hardens missing-account extraction. |
| relayer-proxy/src/index.test.ts | Adds tests for total-fee ceiling, preflight headers, and missing-account parsing validity. |
| relayer-proxy/src/constants.ts | Updates address length constant and adds default total-fee ceiling. |
| relayer-proxy/README.md | Updates feature list and config docs for total-fee ceiling and wording. |
| relayer-proxy/package.json | Pins Stellar SDK ^16.3.0 and updates dependencies. |
| relayer-proxy/.dev.vars.example | Adds MAX_TOTAL_FEE_STROOPS local override. |
| README.md | Updates installation + API docs for SDK 16.3 cap and new admin signing methods. |
| packages/smart-account-kit-bindings/README.md | Pins Stellar SDK install guidance to ^16.3.0. |
| packages/smart-account-kit-bindings/package.json | Caps peer dependency on Stellar SDK to ^16.3.0. |
| package.json | Caps Stellar SDK, updates toolchain deps, tightens wallet-kit peer range, adds override pins. |
| indexer/README.md | Updates schema wording (schema-1 rejection and schema-2 completeness). |
| indexer/demo/package.json | Pins Stellar SDK to 16.3.0 and updates test/build deps. |
| docs/security-deterministic-deployer.md | Updates terminology around “unverified” predictions and schema handling. |
| docs/migration-v0.7.0.md | Updates migration wording about schema-1/incomplete credential responses. |
| docs/migration-smart-account-kit-v0.7.0-rc.2.md | Removes obsolete historical migration record. |
| demo/src/hooks/useMultiSignerSubmit.ts | Routes mutation submissions through admin signing paths. |
| demo/src/components/index.ts | Stops re-exporting deprecated demo helper. |
| demo/src/components/ContextRulesPanel.tsx | Uses admin signing paths for rule mutations. |
| demo/src/components/ContextRuleBuilder.tsx | Removes local policy sorting (now handled by SDK). |
| demo/src/components/ActiveSignerDisplay.tsx | Removes backwards-compat re-export. |
| demo/package.json | Pins Stellar SDK and wallet kit versions; updates React/tooling versions. |
| CHANGELOG.md | Documents breaking security changes, fixes, and maintenance work under Unreleased. |
| .github/workflows/ci.yml | Adds audit gate, bindings verification, pack dry-run, and diff whitespace checks; narrows permissions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 53 out of 55 changed files in this pull request and generated no new comments.
Suppressed comments (2)
Previously missed (2) — in code that hasn't changed since the last review.
src/kit/webauthn-ops.ts:145
signAuthEntry()throws a genericErrorwhen the provided auth entry is not for the connected smart account. Since this is user-controlled input on a public API surface, consider throwing a typedValidationError(e.g.INVALID_INPUT) so callers can branch on error codes consistently.
src/utils.ts:209extractPublicKeyFromAttestation()throws genericErrors for invalid/missing keys and missing WebCrypto. The rest of this module already usesValidationError/SmartAccountErrorCode; using a typed error here would make failures consistent and machine-checkable for callers (and matches the README claim that non-submission methods throw typed errors).
Summary
^16.3.0.Verification
pnpm install --frozen-lockfilepnpm test --runpasses 457 tests.pnpm verify:bindingspasses locally and in CI.pnpm pack --dry-runpasses.PASS.Known low advisory
The optional wallet kit includes
elliptic@6.6.1through Hot Wallet.No patched
ellipticrelease exists.SECURITY.mddocuments this advisory.CI rejects advisories at moderate severity or higher.