Skip to content

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Sep 4, 2025

Explanation

The new metadata properties includeInStateLogs and usedInUi have been added to all controllers maintained by the accounts team.

References

Related to #6443

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@Gudahtt Gudahtt force-pushed the add-new-metadata-to-account-controllers branch from 752701c to efe9a17 Compare September 4, 2025 18:14
@Gudahtt Gudahtt marked this pull request as ready for review September 4, 2025 18:35
@Gudahtt Gudahtt requested review from a team as code owners September 4, 2025 18:35
@Gudahtt Gudahtt force-pushed the add-new-metadata-to-account-controllers branch from cdd9334 to 44f6941 Compare September 10, 2025 14:50
Copy link
Contributor

@ccharly ccharly left a comment

Choose a reason for hiding this comment

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

LGTM (I know @gantunesr wanted to have a look too), we might also need approval from @mathieuartu for the identity part.

Copy link
Member

@gantunesr gantunesr left a comment

Choose a reason for hiding this comment

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

Looks good!

The new metadata properties `includeInStateLogs` and `usedInUi` have
been added to all controllers maintained by the accounts team.

Related to #6443
@Gudahtt Gudahtt force-pushed the add-new-metadata-to-account-controllers branch from 44f6941 to deea146 Compare September 10, 2025 17:02
@Gudahtt Gudahtt enabled auto-merge (squash) September 10, 2025 17:02
includeInStateLogs: true,
persist: true,
anonymous: false,
usedInUi: true,
Copy link

Choose a reason for hiding this comment

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

Bug: Sensitive Data Exposed in Logs and UI

The srpSessionData metadata now sets includeInStateLogs: true and usedInUi: true. This field contains sensitive authentication data, such as access tokens and profile identifiers. This change could expose these credentials in state logs and to UI consumers, creating a security vulnerability.

Fix in Cursor Fix in Web

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm. The usedInUi part can be ignored, we don't treat the UI as a security boundary for things like this today.

It does seem like a mistake to include this in the state logs though. I'll propose a fix in a follow up PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed here: #6553

@Gudahtt Gudahtt merged commit b0fd793 into main Sep 10, 2025
239 checks passed
@Gudahtt Gudahtt deleted the add-new-metadata-to-account-controllers branch September 10, 2025 17:07
Gudahtt added a commit that referenced this pull request Sep 10, 2025
The metadata property was recently added to the
`AuthenticationController` in #6470, but we forgot to strip out the
`accessToken`. This is currently being stripped from state logs in both
clients.

The metadata was updated to strip out this token. Additionally, some
improvements were added to the metadata snapshot tests to ensure that
all properties are represented in the fixture state.

The `@metamask/utils` package was added as a dependency because the
new metadata state deriver uses `Json` in its signature, so that type
is now used in the exported types for this package.
Gudahtt added a commit that referenced this pull request Sep 10, 2025
The metadata property was recently added to the
`AuthenticationController` in #6470, but we forgot to strip out the
`accessToken`. This is currently being stripped from state logs in both
clients.

The metadata was updated to strip out this token. Additionally, some
improvements were added to the metadata snapshot tests to ensure that
all properties are represented in the fixture state.

The `@metamask/utils` package was added as a dependency because the
new metadata state deriver uses `Json` in its signature, so that type
is now used in the exported types for this package.
Gudahtt added a commit that referenced this pull request Sep 11, 2025
The metadata property was recently added to the
`AuthenticationController` in #6470, but we forgot to strip out the
`accessToken`. This is currently being stripped from state logs in both
clients.

The metadata was updated to strip out this token. Additionally, some
improvements were added to the metadata snapshot tests to ensure that
all properties are represented in the fixture state.

The `@metamask/utils` package was added as a dependency because the
new metadata state deriver uses `Json` in its signature, so that type
is now used in the exported types for this package.
Gudahtt added a commit that referenced this pull request Sep 11, 2025
The metadata property was recently added to the
`AuthenticationController` in #6470, but we forgot to strip out the
`accessToken`. This is currently being stripped from state logs in both
clients.

The metadata was updated to strip out this token. Additionally, some
improvements were added to the metadata snapshot tests to ensure that
all properties are represented in the fixture state.

The `@metamask/utils` package was added as a dependency because the
new metadata state deriver uses `Json` in its signature, so that type
is now used in the exported types for this package.
Gudahtt added a commit that referenced this pull request Sep 12, 2025
The metadata property was recently added to the
`AuthenticationController` in #6470, but we forgot to strip out the
`accessToken`. This is currently being stripped from state logs in both
clients.

The metadata was updated to strip out this token. Additionally, some
improvements were added to the metadata snapshot tests to ensure that
all properties are represented in the fixture state.

The `@metamask/utils` package was added as a dependency because the
new metadata state deriver uses `Json` in its signature, so that type
is now used in the exported types for this package.
Gudahtt added a commit that referenced this pull request Sep 12, 2025
…6553)

## Explanation

The metadata property was recently added to the
`AuthenticationController` in #6470, but we forgot to strip out the
`accessToken`. This is currently being stripped from state logs in both
clients.

The metadata was updated to strip out this token. Additionally, some
improvements were added to the metadata snapshot tests to ensure that
all properties are represented in the fixture state.

The `@metamask/utils` package was added as a dependency because the new
metadata state deriver uses `Json` in its signature, so that type is now
used in the exported types for this package.

## References

This is an amendment to #6470

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs),
highlighting breaking changes as necessary
- [x] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
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.

4 participants