Skip to content

fix: redact SDK related URLs#26690

Merged
wenfix merged 1 commit into
mainfrom
am/mwp-redact-sensitive-logs
Mar 2, 2026
Merged

fix: redact SDK related URLs#26690
wenfix merged 1 commit into
mainfrom
am/mwp-redact-sensitive-logs

Conversation

@wenfix

@wenfix wenfix commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

Description

  • Redact sensitive data from SDKConnectV2 / MWP debug and error logs
  • Add redactUrl utility to strip query/fragment params from deeplink URLs before logging
  • Reduce message payload logging to method + id metadata only

Changelog

CHANGELOG entry:

Related issues

Fixes: WAPI-1117

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Low Risk
Low risk: changes are limited to logging/error messages in SDKConnectV2, with minimal behavioral impact aside from altered log output and one test expectation.

Overview
Prevents sensitive SDKConnectV2/MWP connection parameters from being written to logs by introducing redactUrl() and using it when throwing/logging deeplink handling errors.

Reduces verbosity of connection message logging by logging only JSON-RPC method and id (instead of full payloads), and adjusts connect-deeplink success logging to avoid dumping full ConnectionInfo. Updates the handleMwpDeeplink non-string URL test to expect the new redacted/invalid URL message.

Written by Cursor Bugbot for commit dd3a3d0. This will update automatically on new commits. Configure here.

@wenfix wenfix added No QA Needed Apply this label when your PR does not need any QA effort. no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed labels Feb 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-wallet-integrations Wallet Integrations team label Feb 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 85%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes are purely security/privacy improvements to logging in the SDKConnectV2 module:

  1. logger.ts: Added redactUrl() function to redact sensitive URL parameters (channel ID, public key) from logs
  2. connection-registry.ts: Uses redactUrl() in error messages and debug logs, logs only connInfo?.id instead of full object
  3. connection.ts: Logs only method and id fields from message payloads instead of full payloads
  4. connection-registry.test.ts: Updated test expectation to match new redacted URL format

These changes:

  • Do NOT affect any functional behavior of SDK connections
  • Do NOT change any public APIs
  • Are purely defensive logging improvements to prevent sensitive data leakage
  • Have corresponding unit test updates

The SDKConnectV2 module handles SDK deeplink connections (MWP protocol), but the E2E smoke tests focus on browser-based dApp connections rather than SDK deeplink flows. There are no Detox E2E tests that specifically test SDK deeplink functionality.

Since no functional behavior is changed and the unit tests are updated, no E2E tests are required to validate these logging-only changes.

Performance Test Selection:
These changes are purely logging modifications that redact sensitive data from log output. They do not affect any runtime performance characteristics - no changes to connection establishment, message processing, UI rendering, or data loading. The changes only modify what gets logged, not how the SDK connections work.

View GitHub Actions results

payload && typeof payload === 'object' && 'data' in payload
? (payload.data as Record<string, unknown>)
: undefined;
logger.debug('Received message:', this.id, {

@wenfix wenfix Feb 27, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we could obfuscate parameter values here (in case they exist) instead of omitting them, which might facilitate debugging. thoughts?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm more akin to omitting. Less code to manage, and one less layer of possible exposure if someone forgets to properly obfuscate a newly passed param for some reason.

@wenfix wenfix marked this pull request as ready for review March 2, 2026 11:29
@wenfix wenfix requested a review from a team as a code owner March 2, 2026 11:29
@wenfix wenfix added this pull request to the merge queue Mar 2, 2026
Merged via the queue into main with commit be2b91c Mar 2, 2026
94 checks passed
@wenfix wenfix deleted the am/mwp-redact-sensitive-logs branch March 2, 2026 13:46
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 2, 2026
@metamaskbot metamaskbot added the release-7.69.0 Issue or pull request that will be included in release 7.69.0 label Mar 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

No QA Needed Apply this label when your PR does not need any QA effort. no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.69.0 Issue or pull request that will be included in release 7.69.0 size-S team-wallet-integrations Wallet Integrations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants