CVE-2017-16117:Regular Expression Denial of Service (ReDoS) vulnerability in the slug npm package.

splash
Back

Description Preview

The slug npm package, which is used to convert strings to URL-friendly slugs, contains a Regular Expression Denial of Service (ReDoS) vulnerability. When processing specially crafted input strings of approximately 50,000 characters, the package can cause the event loop to block for around 2 seconds, potentially leading to denial of service conditions in applications using this library.

Overview

The slug npm package is designed to convert strings into URL-friendly slugs, including support for Unicode characters. The vulnerability (CVE-2017-16117) occurs because the package uses inefficient regular expressions that can be exploited with specially crafted input to cause excessive CPU consumption. This is classified as CWE-400 (Uncontrolled Resource Consumption). When malicious input of approximately 50,000 characters is processed, it can block the Node.js event loop for about 2 seconds, potentially affecting application performance and availability. Since Node.js is single-threaded, this blocking behavior can effectively create a denial of service condition, preventing the application from processing other requests during that time.

Remediation

To address this vulnerability, developers should:

  1. Update to a patched version of the slug package if available
  2. If updates are not available, implement input validation to limit the size of strings passed to the slug function
  3. Consider implementing a timeout mechanism when processing potentially untrusted input
  4. As a more robust solution, consider using alternative slug generation libraries that are not vulnerable to ReDoS attacks
  5. Monitor application performance for signs of event loop blocking that could indicate exploitation attempts

References

  1. GitHub Issue: https://github.com/dodo/node-slug/issues/82
  2. Node Security Advisory: https://nodesecurity.io/advisories/537
  3. CWE-400: https://cwe.mitre.org/data/definitions/400.html

Industry ExposureMost to least
This section illustrates the prevalence of a specific Common Vulnerabilities and Exposures (CVE) across various industries based on customer reports. The ranking displays industries from the most to least affected by this particular vulnerability, offering valuable insight into where this CVE has been most frequently observed. This information can help organizations within these sectors prioritize their security efforts, understand their relative risk exposure compared to their peers, and focus remediation strategies where they are most needed. By understanding the industry-specific impact, organizations can make more informed decisions regarding patching, resource allocation, and overall risk management related to this CVE.

  1. Accommodation & Food Services
    Accommodation & Food Services
  2. Administrative, Support, Waste Management & Remediation Services
    Administrative, Support, Waste Management & Remediation Services
  3. Agriculture, Forestry Fishing & Hunting
    Agriculture, Forestry Fishing & Hunting
  4. Arts, Entertainment & Recreation
    Arts, Entertainment & Recreation
  5. Construction
    Construction
  6. Educational Services
    Educational Services
  7. Finance and Insurance
    Finance and Insurance
  8. Health Care & Social Assistance
    Health Care & Social Assistance
  9. Information
    Information
  10. Management of Companies & Enterprises
    Management of Companies & Enterprises
  11. Manufacturing
    Manufacturing
  12. Mining
    Mining
  13. Other Services (except Public Administration)
    Other Services (except Public Administration)
  14. Professional, Scientific, & Technical Services
    Professional, Scientific, & Technical Services
  15. Public Administration
    Public Administration
  16. Real Estate Rental & Leasing
    Real Estate Rental & Leasing
  17. Retail Trade
    Retail Trade
  18. Transportation & Warehousing
    Transportation & Warehousing
  19. Utilities
    Utilities
  20. Wholesale Trade
    Wholesale Trade

Focus on What Matters

  1. See Everything.
  2. Identify True Risk.
  3. Proactively Mitigate Threats.

Let's talk!

background