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

[Security] Fix ReDoS #333

Merged
merged 1 commit into from
Oct 7, 2021
Merged

[Security] Fix ReDoS #333

merged 1 commit into from
Oct 7, 2021

Conversation

ready-research
Copy link
Contributor

Fix potential ReDoS

Reported in https://www.huntr.dev/bounties/ebd7b78f-8501-4598-8dbb-81bcd8a8a672

Please validate the above huntr link by clicking on validate button and also please confirm the fix once it got merged. Thank you.

Fix potential ReDoS
@guptajiten
Copy link

@ready-research thank you for the changes. I am also waiting to come this change in release so that I can deploy this module without this vulnerabilities.

@terkelg terkelg merged commit bf39500 into terkelg:master Oct 7, 2021
@ready-research
Copy link
Contributor Author

@terkelg Thank you for the response. Can you please validate this in https://www.huntr.dev/bounties/ebd7b78f-8501-4598-8dbb-81bcd8a8a672/ using Mark as valid and also confirm the fix.

kodiakhq bot referenced this pull request in X-oss-byte/Canary-nextjs Sep 30, 2023
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [prompts](https://togithub.com/terkelg/prompts) | [`2.1.0` -> `2.4.2`](https://renovatebot.com/diffs/npm/prompts/2.1.0/2.4.2) | [![age](https://developer.mend.io/api/mc/badges/age/npm/prompts/2.4.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/prompts/2.4.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/prompts/2.1.0/2.4.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/prompts/2.1.0/2.4.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) |
| [@types/prompts](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/prompts) ([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped)) | [`2.0.1` -> `2.4.5`](https://renovatebot.com/diffs/npm/@types%2fprompts/2.0.1/2.4.5) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@types%2fprompts/2.4.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@types%2fprompts/2.4.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@types%2fprompts/2.0.1/2.4.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@types%2fprompts/2.0.1/2.4.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### ⚠ Dependency Lookup Warnings ⚠

Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information.

---

### Release Notes

<details>
<summary>terkelg/prompts (prompts)</summary>

### [`v2.4.2`](https://togithub.com/terkelg/prompts/releases/tag/v2.4.2)

[Compare Source](https://togithub.com/terkelg/prompts/compare/v2.4.1...v2.4.2)

##### What's Changed

-   \[Security] Fix ReDoS by [@&#8203;ready-research](https://togithub.com/ready-research) in [https://github.com/terkelg/prompts/pull/333](https://togithub.com/terkelg/prompts/pull/333)

##### New Contributors

-   [@&#8203;ready-research](https://togithub.com/ready-research) made their first contribution in [https://github.com/terkelg/prompts/pull/333](https://togithub.com/terkelg/prompts/pull/333)

**Full Changelog**: terkelg/prompts@v2.4.1...v2.4.2

### [`v2.4.1`](https://togithub.com/terkelg/prompts/releases/tag/v2.4.1)

[Compare Source](https://togithub.com/terkelg/prompts/compare/v2.4.0...v2.4.1)

Fixed issue with cursor in text prompt [#&#8203;300](https://togithub.com/terkelg/prompts/issues/300) [#&#8203;249](https://togithub.com/terkelg/prompts/issues/249). Thank you [@&#8203;krishna-acondy](https://togithub.com/krishna-acondy)

### [`v2.4.0`](https://togithub.com/terkelg/prompts/releases/tag/v2.4.0)

[Compare Source](https://togithub.com/terkelg/prompts/compare/v2.3.2...v2.4.0)

-   Add stdin and stdout to the docs ([#&#8203;257](https://togithub.com/terkelg/prompts/issues/257), [#&#8203;258](https://togithub.com/terkelg/prompts/issues/258))
-   Update build dependencies
-   Updated readme markup [#&#8203;272](https://togithub.com/terkelg/prompts/issues/272)
-   Loop cursor on all select-style prompts ([#&#8203;270](https://togithub.com/terkelg/prompts/issues/270))
-   fix(inject): treat undefined in inject as initial value ([#&#8203;266](https://togithub.com/terkelg/prompts/issues/266))
-   Remove internal use of process.stdout ([#&#8203;274](https://togithub.com/terkelg/prompts/issues/274), [#&#8203;275](https://togithub.com/terkelg/prompts/issues/275))
-   Handle escape as exit + clearFirst feature for autocomplete ([#&#8203;280](https://togithub.com/terkelg/prompts/issues/280))

Thank you to all the contributors! 💯

### [`v2.3.2`](https://togithub.com/terkelg/prompts/compare/v2.3.1...v2.3.2)

[Compare Source](https://togithub.com/terkelg/prompts/compare/v2.3.1...v2.3.2)

### [`v2.3.1`](https://togithub.com/terkelg/prompts/releases/tag/v2.3.1)

[Compare Source](https://togithub.com/terkelg/prompts/compare/v2.3.0...v2.3.1)

-   Fix issue where multiselect prompt is rendered wrong [#&#8203;253](https://togithub.com/terkelg/prompts/issues/253) [#&#8203;175](https://togithub.com/terkelg/prompts/issues/175)
-   Fix issue where `home` prints `undefined` [#&#8203;247](https://togithub.com/terkelg/prompts/issues/247) [#&#8203;245](https://togithub.com/terkelg/prompts/issues/245)
-   Updated dev dependenceis

Thank you [@&#8203;DrunkenPoney](https://togithub.com/DrunkenPoney) and [@&#8203;jamezrin](https://togithub.com/jamezrin) 🎉

### [`v2.3.0`](https://togithub.com/terkelg/prompts/releases/tag/v2.3.0)

[Compare Source](https://togithub.com/terkelg/prompts/compare/v2.2.1...v2.3.0)

-   Update documentation [#&#8203;195](https://togithub.com/terkelg/prompts/issues/195) [#&#8203;223](https://togithub.com/terkelg/prompts/issues/223)
-   Added an option to change the number of items displayed [#&#8203;189](https://togithub.com/terkelg/prompts/issues/189)
-   Fix (multi)select falsy values  [#&#8203;187](https://togithub.com/terkelg/prompts/issues/187) [#&#8203;188](https://togithub.com/terkelg/prompts/issues/188)
-   Add table of contents for the prompt types [#&#8203;222](https://togithub.com/terkelg/prompts/issues/222)
-   Hiding page number when only single page is there [#&#8203;210](https://togithub.com/terkelg/prompts/issues/210)
-   Evaluate type before other options and skip if falsy [#&#8203;217](https://togithub.com/terkelg/prompts/issues/217)
-   Fix `autocompleteMultiselect` instructions bug [#&#8203;216](https://togithub.com/terkelg/prompts/issues/216)
-   Fix for `opts.out` changed to `opts.stdout` [#&#8203;209](https://togithub.com/terkelg/prompts/issues/209) [#&#8203;208](https://togithub.com/terkelg/prompts/issues/208)
-   Fix `Number` prompt can get pass minimum [#&#8203;203](https://togithub.com/terkelg/prompts/issues/203) [#&#8203;204](https://togithub.com/terkelg/prompts/issues/204)
-   Fix `Number` type ignore minimum [#&#8203;201](https://togithub.com/terkelg/prompts/issues/201) [#&#8203;202](https://togithub.com/terkelg/prompts/issues/202)
-   Add `maxVisible` option for select prompts [#&#8203;225](https://togithub.com/terkelg/prompts/issues/225)
-   Store correct reference of last prompt [#&#8203;221](https://togithub.com/terkelg/prompts/issues/221) [#&#8203;198](https://togithub.com/terkelg/prompts/issues/198)
-   Remove multi-pages on autocomplete, instead scroll down/up [#&#8203;230](https://togithub.com/terkelg/prompts/issues/230)

Thank you everyone! 💯

### [`v2.2.1`](https://togithub.com/terkelg/prompts/compare/v2.2.0...v2.2.1)

[Compare Source](https://togithub.com/terkelg/prompts/compare/v2.2.0...v2.2.1)

### [`v2.2.0`](https://togithub.com/terkelg/prompts/releases/tag/v2.2.0)

[Compare Source](https://togithub.com/terkelg/prompts/compare/v2.1.0...v2.2.0)

-   Fix duplicate output when more than 1 line [#&#8203;168](https://togithub.com/terkelg/prompts/issues/168) [#&#8203;153](https://togithub.com/terkelg/prompts/issues/153) by [@&#8203;DrunkenPoney](https://togithub.com/DrunkenPoney)
-   Added description option to choices [#&#8203;165](https://togithub.com/terkelg/prompts/issues/165) [#&#8203;170](https://togithub.com/terkelg/prompts/issues/170)
-   Options to display instruction text on multi-select prompt [#&#8203;174](https://togithub.com/terkelg/prompts/issues/174) [#&#8203;177](https://togithub.com/terkelg/prompts/issues/177) by [@&#8203;wilmouths](https://togithub.com/wilmouths) and [@&#8203;lumio](https://togithub.com/lumio)
-   Press 'a' to toggle all in multi-select prompt [#&#8203;166](https://togithub.com/terkelg/prompts/issues/166) by [@&#8203;jeysal](https://togithub.com/jeysal) and [@&#8203;lumio](https://togithub.com/lumio)
-   Fix bug where ALT+<key> prints undefined [#&#8203;164](https://togithub.com/terkelg/prompts/issues/164) by [@&#8203;lumio](https://togithub.com/lumio)
-   Allow moving with J and K in select mode [#&#8203;161](https://togithub.com/terkelg/prompts/issues/161) by [@&#8203;WittBulter](https://togithub.com/WittBulter)
-   Updated readme [#&#8203;176](https://togithub.com/terkelg/prompts/issues/176) by [@&#8203;vivaxy](https://togithub.com/vivaxy)

Thank you everyone! 💯

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/X-oss-byte/Canary-nextjs).
kodiakhq bot referenced this pull request in X-oss-byte/Nextjs Oct 4, 2023
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [prompts](https://togithub.com/terkelg/prompts) | [`2.1.0` -> `2.4.2`](https://renovatebot.com/diffs/npm/prompts/2.1.0/2.4.2) | [![age](https://developer.mend.io/api/mc/badges/age/npm/prompts/2.4.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/prompts/2.4.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/prompts/2.1.0/2.4.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/prompts/2.1.0/2.4.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) |
| [@types/prompts](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/prompts) ([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped)) | [`2.0.1` -> `2.4.5`](https://renovatebot.com/diffs/npm/@types%2fprompts/2.0.1/2.4.5) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@types%2fprompts/2.4.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@types%2fprompts/2.4.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@types%2fprompts/2.0.1/2.4.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@types%2fprompts/2.0.1/2.4.5?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>terkelg/prompts (prompts)</summary>

### [`v2.4.2`](https://togithub.com/terkelg/prompts/releases/tag/v2.4.2)

[Compare Source](https://togithub.com/terkelg/prompts/compare/v2.4.1...v2.4.2)

##### What's Changed

-   \[Security] Fix ReDoS by [@&#8203;ready-research](https://togithub.com/ready-research) in [https://github.com/terkelg/prompts/pull/333](https://togithub.com/terkelg/prompts/pull/333)

##### New Contributors

-   [@&#8203;ready-research](https://togithub.com/ready-research) made their first contribution in [https://github.com/terkelg/prompts/pull/333](https://togithub.com/terkelg/prompts/pull/333)

**Full Changelog**: terkelg/prompts@v2.4.1...v2.4.2

### [`v2.4.1`](https://togithub.com/terkelg/prompts/releases/tag/v2.4.1)

[Compare Source](https://togithub.com/terkelg/prompts/compare/v2.4.0...v2.4.1)

Fixed issue with cursor in text prompt [#&#8203;300](https://togithub.com/terkelg/prompts/issues/300) [#&#8203;249](https://togithub.com/terkelg/prompts/issues/249). Thank you [@&#8203;krishna-acondy](https://togithub.com/krishna-acondy)

### [`v2.4.0`](https://togithub.com/terkelg/prompts/releases/tag/v2.4.0)

[Compare Source](https://togithub.com/terkelg/prompts/compare/v2.3.2...v2.4.0)

-   Add stdin and stdout to the docs ([#&#8203;257](https://togithub.com/terkelg/prompts/issues/257), [#&#8203;258](https://togithub.com/terkelg/prompts/issues/258))
-   Update build dependencies
-   Updated readme markup [#&#8203;272](https://togithub.com/terkelg/prompts/issues/272)
-   Loop cursor on all select-style prompts ([#&#8203;270](https://togithub.com/terkelg/prompts/issues/270))
-   fix(inject): treat undefined in inject as initial value ([#&#8203;266](https://togithub.com/terkelg/prompts/issues/266))
-   Remove internal use of process.stdout ([#&#8203;274](https://togithub.com/terkelg/prompts/issues/274), [#&#8203;275](https://togithub.com/terkelg/prompts/issues/275))
-   Handle escape as exit + clearFirst feature for autocomplete ([#&#8203;280](https://togithub.com/terkelg/prompts/issues/280))

Thank you to all the contributors! 💯

### [`v2.3.2`](https://togithub.com/terkelg/prompts/compare/v2.3.1...v2.3.2)

[Compare Source](https://togithub.com/terkelg/prompts/compare/v2.3.1...v2.3.2)

### [`v2.3.1`](https://togithub.com/terkelg/prompts/releases/tag/v2.3.1)

[Compare Source](https://togithub.com/terkelg/prompts/compare/v2.3.0...v2.3.1)

-   Fix issue where multiselect prompt is rendered wrong [#&#8203;253](https://togithub.com/terkelg/prompts/issues/253) [#&#8203;175](https://togithub.com/terkelg/prompts/issues/175)
-   Fix issue where `home` prints `undefined` [#&#8203;247](https://togithub.com/terkelg/prompts/issues/247) [#&#8203;245](https://togithub.com/terkelg/prompts/issues/245)
-   Updated dev dependenceis

Thank you [@&#8203;DrunkenPoney](https://togithub.com/DrunkenPoney) and [@&#8203;jamezrin](https://togithub.com/jamezrin) 🎉

### [`v2.3.0`](https://togithub.com/terkelg/prompts/releases/tag/v2.3.0)

[Compare Source](https://togithub.com/terkelg/prompts/compare/v2.2.1...v2.3.0)

-   Update documentation [#&#8203;195](https://togithub.com/terkelg/prompts/issues/195) [#&#8203;223](https://togithub.com/terkelg/prompts/issues/223)
-   Added an option to change the number of items displayed [#&#8203;189](https://togithub.com/terkelg/prompts/issues/189)
-   Fix (multi)select falsy values  [#&#8203;187](https://togithub.com/terkelg/prompts/issues/187) [#&#8203;188](https://togithub.com/terkelg/prompts/issues/188)
-   Add table of contents for the prompt types [#&#8203;222](https://togithub.com/terkelg/prompts/issues/222)
-   Hiding page number when only single page is there [#&#8203;210](https://togithub.com/terkelg/prompts/issues/210)
-   Evaluate type before other options and skip if falsy [#&#8203;217](https://togithub.com/terkelg/prompts/issues/217)
-   Fix `autocompleteMultiselect` instructions bug [#&#8203;216](https://togithub.com/terkelg/prompts/issues/216)
-   Fix for `opts.out` changed to `opts.stdout` [#&#8203;209](https://togithub.com/terkelg/prompts/issues/209) [#&#8203;208](https://togithub.com/terkelg/prompts/issues/208)
-   Fix `Number` prompt can get pass minimum [#&#8203;203](https://togithub.com/terkelg/prompts/issues/203) [#&#8203;204](https://togithub.com/terkelg/prompts/issues/204)
-   Fix `Number` type ignore minimum [#&#8203;201](https://togithub.com/terkelg/prompts/issues/201) [#&#8203;202](https://togithub.com/terkelg/prompts/issues/202)
-   Add `maxVisible` option for select prompts [#&#8203;225](https://togithub.com/terkelg/prompts/issues/225)
-   Store correct reference of last prompt [#&#8203;221](https://togithub.com/terkelg/prompts/issues/221) [#&#8203;198](https://togithub.com/terkelg/prompts/issues/198)
-   Remove multi-pages on autocomplete, instead scroll down/up [#&#8203;230](https://togithub.com/terkelg/prompts/issues/230)

Thank you everyone! 💯

### [`v2.2.1`](https://togithub.com/terkelg/prompts/compare/v2.2.0...v2.2.1)

[Compare Source](https://togithub.com/terkelg/prompts/compare/v2.2.0...v2.2.1)

### [`v2.2.0`](https://togithub.com/terkelg/prompts/releases/tag/v2.2.0)

[Compare Source](https://togithub.com/terkelg/prompts/compare/v2.1.0...v2.2.0)

-   Fix duplicate output when more than 1 line [#&#8203;168](https://togithub.com/terkelg/prompts/issues/168) [#&#8203;153](https://togithub.com/terkelg/prompts/issues/153) by [@&#8203;DrunkenPoney](https://togithub.com/DrunkenPoney)
-   Added description option to choices [#&#8203;165](https://togithub.com/terkelg/prompts/issues/165) [#&#8203;170](https://togithub.com/terkelg/prompts/issues/170)
-   Options to display instruction text on multi-select prompt [#&#8203;174](https://togithub.com/terkelg/prompts/issues/174) [#&#8203;177](https://togithub.com/terkelg/prompts/issues/177) by [@&#8203;wilmouths](https://togithub.com/wilmouths) and [@&#8203;lumio](https://togithub.com/lumio)
-   Press 'a' to toggle all in multi-select prompt [#&#8203;166](https://togithub.com/terkelg/prompts/issues/166) by [@&#8203;jeysal](https://togithub.com/jeysal) and [@&#8203;lumio](https://togithub.com/lumio)
-   Fix bug where ALT+<key> prints undefined [#&#8203;164](https://togithub.com/terkelg/prompts/issues/164) by [@&#8203;lumio](https://togithub.com/lumio)
-   Allow moving with J and K in select mode [#&#8203;161](https://togithub.com/terkelg/prompts/issues/161) by [@&#8203;WittBulter](https://togithub.com/WittBulter)
-   Updated readme [#&#8203;176](https://togithub.com/terkelg/prompts/issues/176) by [@&#8203;vivaxy](https://togithub.com/vivaxy)

Thank you everyone! 💯

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/X-oss-byte/Nextjs).
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.

3 participants