cbarnard-r7 / cbarnard-r7/defaultinator-api

Potential regular expression denial of service (ReDoS)

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

`prefix` is controllable by the caller and could result in a regular expression denial of service (ReDoS).
* `api/routes/credentials.js`:
```
_id: {$regex: new RegExp('^' + prefix, 'i')}
```
* `api/routes/dictionary.js`:
```
_id: {$regex: new RegExp('^' + prefix, 'i')}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the prefix handling in api/routes/credentials.js and api/routes/dictionary.js, then trace how the caller-controlled value reaches each RegExp construction. Done means both routes no longer allow a crafted prefix to cause regular expression denial of service; verify the behavior with the repository's relevant checks if available.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.