Open Bug 1959687 Opened 19 days ago Updated 14 days ago

Possible ReDoS from rawRecipe.pathRegex

Categories

(Toolkit :: Password Manager, defect)

defect

Tracking

()

REOPENED

People

(Reporter: uncleruc2075, Unassigned)

Details

Attachments

(1 file)

Attached file code.txt

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36

Steps to reproduce:

In file toolkit/components/passwordmgr/LoginRecipes.sys.mjs
section where rawRecipe.pathRegex is processed and used to create a new RegExp object without any validation.
Input a regular expression pattern with catastrophic backtracking behavior (a+)+).

Actual results:

The program dynamically creates a RegExp object from an unsanitized input, which may lead to excessive computational complexity if the regular expression contains patterns prone to ReDoS (e.g., nested quantifiers).

If a malicious user or external source provides a specially crafted regular expression, the application can experience a significant delay or crash, resulting in a denial of service (DoS) condition.

Expected results:

The code should validate the regular expression pattern before using it to ensure it does not contain unsafe or complex patterns prone to ReDoS attacks.

The code does not properly sanitize or validate regular expression patterns before creating a RegExp object.

Component: Untriaged → Password Manager
Product: Firefox → Toolkit
Version: other → unspecified

It looks like the values of rawRecipe.pathRegex are hard coded, so there shouldn't be a problem in practice.

Group: firefox-core-security
Summary: Possible ReDoS → Possible ReDoS from rawRecipe.pathRegex
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: INVALID → ---
Component: General → Password Manager
Product: Invalid Bugs → Toolkit
Flags: sec-bounty?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: