Skip to content

clean up signature events + harden release workflow#28

Merged
yosriady merged 3 commits into
mainfrom
sec/deepsec
May 17, 2026
Merged

clean up signature events + harden release workflow#28
yosriady merged 3 commits into
mainfrom
sec/deepsec

Conversation

@yosriady
Copy link
Copy Markdown
Contributor

@yosriady yosriady commented May 17, 2026

Security branch for @formo/analytics-react-native. Two findings from the deepsec audit.
Autocaptured signature events shipped the produced signature (state.data) as signatureHash to events.formo.so — a replayable permit/Permit2/SIWE bearer credential, on by default.

Scope: remove signatureHash only. The signed message (plaintext for signMessage, EIP-712 struct for signTypedData) is captured exactly as before; no behavior change there and no new configuration option.

  • signatureHash removed end-to-end: SignatureAPIEvent, IFormoAnalytics/IFormoAnalyticsInstance signature(), FormoAnalytics.signature(), EventFactory.generateSignatureEvent (+ lib/event/types.ts), and the WagmiEventHandler mutation handler (no longer reads state.data).
  • New src/__tests__/signature.test.ts: asserts no signatureHash / no raw-signature value for signMessage or signTypedData.

Verification: typecheck ✓ · lint ✓ · 212/212 tests ✓ · deepsec revalidate (commit 6314268) → CRITICAL other-signature-exfiltration = fixed.

${{ github.ref_name }} interpolated into run: blocks in release.yml; moved to env: + quoted vars with a strict semver tag-name validation gate.

Coordination

C1 is fixed identically in @formo/analytics (web SDK, getformo/sdk branch sec/deepsec). These are published packages leaking replayable credentials — recommend a coordinated GHSA covering both packages plus backend scrubbing of already-ingested raw signatures.

Not in this PR

Other deepsec findings (M2/M3/M4 consent/attribution, queue bugs) remain open and tracked separately.

🤖 Generated with Claude Code


View in Codesmith
Need help on this PR? Tag @codesmith with what you need.

  • Let Codesmith autofix CI failures and bot reviews

yosriady and others added 2 commits May 17, 2026 07:59
The publish job runs with id-token:write (npm OIDC trusted publishing)
and contents:write, and interpolated the attacker-influenceable tag
name (github.ref_name and tag-derived step outputs) directly into run:
scripts. Git ref names permit shell metacharacters, so a tag like
v1.0.0$(...) could execute arbitrary commands with publish privileges.

- Move all tag-derived values to env: blocks, referenced as quoted
  shell variables instead of ${{ }} interpolation in run: bodies
- Add strict semver tag validation that fails the workflow before any
  untrusted value is used

Actions are already pinned to commit SHAs; npm pin intentionally
omitted (npm@latest retained by decision).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Autocaptured signature events shipped the produced signature
(state.data) as `signatureHash` to events.formo.so — a replayable
permit/Permit2/SIWE bearer credential, on by default.

Scope: remove `signatureHash` only. The signed message (plaintext or
EIP-712 struct) is still captured as before; no behavior change there
and no new configuration option.

- Remove `signatureHash` end-to-end: SignatureAPIEvent, IFormoAnalytics
  /IFormoAnalyticsInstance signature(), FormoAnalytics.signature(),
  EventFactory.generateSignatureEvent (+ lib/event/types.ts), and the
  WagmiEventHandler mutation handler (no longer reads state.data).
- Add src/__tests__/signature.test.ts: asserts no signatureHash / no
  raw-signature value is emitted for signMessage or signTypedData.

deepsec revalidate: CRITICAL other-signature-exfiltration -> fixed.
typecheck/lint clean, 212/212 tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@yosriady yosriady changed the title security: remove raw wallet signature exfiltration (C1) + harden release workflow (H1) clean up signature events + harden release workflow May 17, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request removes the signatureHash field from signature-related events across the codebase, including interfaces, event factories, and the Wagmi event handler. This change is a security measure to prevent the capture of replayable credentials such as signatures for Permit or SIWE. New tests have been added to ensure that raw signatures are never forwarded to the event pipeline. I have no feedback to provide.

Comment/label-only cleanup, no behavior change. Gates green (212/212).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@yosriady yosriady merged commit 42c2432 into main May 17, 2026
9 checks passed
@yosriady yosriady deleted the sec/deepsec branch May 17, 2026 05:59
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