org.webjars.npm:ws@6.2.3 vulnerabilities

  • latest version

    8.18.2

  • latest non vulnerable version

  • first published

    10 years ago

  • latest version published

    4 months ago

  • licenses detected

  • package registry

  • Direct Vulnerabilities

    Known vulnerabilities in the org.webjars.npm:ws package. This does not include vulnerabilities belonging to this package’s dependencies.

    Fix vulnerabilities automatically

    Snyk's AI Trust Platform automatically finds the best upgrade path and integrates with your development workflows. Secure your code at zero cost.

    Fix for free
    VulnerabilityVulnerable Version
    • H
    Denial of Service (DoS)

    org.webjars.npm:ws is a simple to use websocket client, server and console for node.js.

    Affected versions of this package are vulnerable to Denial of Service (DoS) when the number of received headers exceed the server.maxHeadersCount or request.maxHeadersCount threshold.

    How to fix Denial of Service (DoS)?

    Upgrade org.webjars.npm:ws to version 7.5.10, 8.17.1 or higher.

    [,7.5.10)[8.0.0,8.17.1)
    • M
    Regular Expression Denial of Service (ReDoS)

    org.webjars.npm:ws is a simple to use websocket client, server and console for node.js.

    Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS). A specially crafted value of the Sec-Websocket-Protocol header can be used to significantly slow down a ws server.

    ##PoC

    for (const length of [1000, 2000, 4000, 8000, 16000, 32000]) {
      const value = 'b' + ' '.repeat(length) + 'x';
      const start = process.hrtime.bigint();
    
      value.trim().split(/ *, */);
    
      const end = process.hrtime.bigint();
    
      console.log('length = %d, time = %f ns', length, end - start);
    }
    

    How to fix Regular Expression Denial of Service (ReDoS)?

    Upgrade org.webjars.npm:ws to version 7.4.6 or higher.

    [,7.4.6)