Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: MetaMask crash if we type enter anything followed by a \ in settings search #27428

Closed
chloeYue opened this issue Sep 26, 2024 · 2 comments · Fixed by #27432
Closed

[Bug]: MetaMask crash if we type enter anything followed by a \ in settings search #27428

chloeYue opened this issue Sep 26, 2024 · 2 comments · Fixed by #27432
Assignees
Labels
regression-prod-12.3.0 Regression bug that was found in production in release 12.3.0 release-12.6.0 Issue or pull request that will be included in release 12.6.0 Sev1-high High severity; partial loss of service with severe impact upon users, with no workaround. team-extension-platform type-bug

Comments

@chloeYue
Copy link
Contributor

Describe the bug

MetaMask crash if user enters anything followed by a \, e.g. foobar\

Expected behavior

No response

Screenshots/Recordings

Screenshot 2024-09-26 at 17 26 38

Steps to reproduce

  1. Go to settings page
  2. Enter anything followed by a \, example foobar\
  3. See metaMask crash

Error messages or log output

No response

Detection stage

In production (default)

Version

12.3.0

Build type

None

Browser

Chrome

Operating system

MacOS

Hardware wallet

No response

Additional context

No response

Severity

No response

@chloeYue chloeYue added type-bug Sev1-high High severity; partial loss of service with severe impact upon users, with no workaround. team-extension-platform regression-prod-12.3.0 Regression bug that was found in production in release 12.3.0 labels Sep 26, 2024
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by team Sep 26, 2024
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by severity Sep 26, 2024
@DDDDDanica DDDDDanica self-assigned this Sep 26, 2024
@DDDDDanica
Copy link
Contributor

Also duplicated with #26945

@seaona
Copy link
Contributor

seaona commented Sep 27, 2024

I think it can be flagged as sev2, since you can just refresh the browser and MM works back again

github-merge-queue bot pushed a commit that referenced this issue Oct 2, 2024
… search (#27432)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

In JavaScript, backslashes are used as escape characters in strings and
regular expressions, which can cause issues when an unescaped backslash
is present in a user input. To handle this, we'll need to escape any
special characters in the user input before constructing the regular
expression.

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/27432?quickstart=1)

## **Related issues**

Fixes: #27428,
#26945

## **Manual testing steps**

1. Go to settings
2. type foo\
3. press enter should not crash

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**


https://github.com/user-attachments/assets/fb7336e9-7e41-4571-ae84-64c5ef5c3398


<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.
@github-project-automation github-project-automation bot moved this from To be fixed to Fixed in Bugs by team Oct 2, 2024
@github-project-automation github-project-automation bot moved this from To be fixed to Fixed in Bugs by severity Oct 2, 2024
@metamaskbot metamaskbot added the release-12.6.0 Issue or pull request that will be included in release 12.6.0 label Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression-prod-12.3.0 Regression bug that was found in production in release 12.3.0 release-12.6.0 Issue or pull request that will be included in release 12.6.0 Sev1-high High severity; partial loss of service with severe impact upon users, with no workaround. team-extension-platform type-bug
Projects
Archived in project
4 participants