VYPR
High severityOSV Advisory· Published Nov 19, 2019· Updated Aug 4, 2024

CVE-2019-10768

CVE-2019-10768

Description

In AngularJS before 1.7.9 the function merge() could be tricked into adding or modifying properties of Object.prototype using a __proto__ payload.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
angularnpm
< 1.7.91.7.9

Affected products

1

Patches

1
add78e62004e

fix(angular.merge): do not merge __proto__ property

https://github.com/angular/angular.jsPete Bacon DarwinNov 7, 2019via ghsa
2 files changed · +17 2
  • src/Angular.js+4 2 modified
    @@ -342,8 +342,10 @@ function baseExtend(dst, objs, deep) {
             } else if (isElement(src)) {
               dst[key] = src.clone();
             } else {
    -          if (!isObject(dst[key])) dst[key] = isArray(src) ? [] : {};
    -          baseExtend(dst[key], [src], true);
    +          if (key !== '__proto__') {
    +            if (!isObject(dst[key])) dst[key] = isArray(src) ? [] : {};
    +            baseExtend(dst[key], [src], true);
    +          }
             }
           } else {
             dst[key] = src;
    
  • test/AngularSpec.js+13 0 modified
    @@ -814,6 +814,19 @@ describe('angular', function() {
           expect(isElement(dst.jqObject)).toBeTruthy();
           expect(dst.jqObject.nodeName).toBeUndefined(); // i.e it is a jqLite/jQuery object
         });
    +
    +    it('should not merge the __proto__ property', function() {
    +      var src = JSON.parse('{ "__proto__": { "xxx": "polluted" } }');
    +      var dst = {};
    +
    +      merge(dst, src);
    +
    +      if (typeof dst.__proto__ !== 'undefined') { // eslint-disable-line
    +        // Should not overwrite the __proto__ property or pollute the Object prototype
    +        expect(dst.__proto__).toBe(Object.prototype); // eslint-disable-line
    +      }
    +      expect(({}).xxx).toBeUndefined();
    +    });
       });
     
     
    

Vulnerability mechanics

Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

7

News mentions

0

No linked articles in our index yet.