Find, fix and prevent vulnerabilities in your code.
        
          critical severity
        
  
  
  - Vulnerable module: babel-traverse
- Introduced through: babel-plugin-transform-class-properties@6.24.1
Detailed paths
- 
            Introduced through: protonmail-desktop-unofficial@protonmail-desktop/application#32e970554a48c327fe297358bf7c09ee0843243a › babel-plugin-transform-class-properties@6.24.1 › babel-template@6.26.0 › babel-traverse@6.26.0
- 
            Introduced through: protonmail-desktop-unofficial@protonmail-desktop/application#32e970554a48c327fe297358bf7c09ee0843243a › babel-plugin-transform-class-properties@6.24.1 › babel-helper-function-name@6.24.1 › babel-traverse@6.26.0
- 
            Introduced through: protonmail-desktop-unofficial@protonmail-desktop/application#32e970554a48c327fe297358bf7c09ee0843243a › babel-plugin-transform-class-properties@6.24.1 › babel-helper-function-name@6.24.1 › babel-template@6.26.0 › babel-traverse@6.26.0
Overview
Affected versions of this package are vulnerable to Incomplete List of Disallowed Inputs when using plugins that rely on the path.evaluate() or path.evaluateTruthy() internal Babel methods. 
Note:
This is only exploitable if the attacker uses known affected plugins such as @babel/plugin-transform-runtime, @babel/preset-env when using its useBuiltIns option, and any "polyfill provider" plugin that depends on @babel/helper-define-polyfill-provider. No other plugins under the @babel/ namespace are impacted, but third-party plugins might be.
Users that only compile trusted code are not impacted.
Workaround
Users who are unable to upgrade the library can upgrade the affected plugins instead, to avoid triggering the vulnerable code path in affected @babel/traverse.
Remediation
There is no fixed version for babel-traverse.
References
        
          high severity
        
  
  
  - Vulnerable module: electron-updater
- Introduced through: electron-updater@4.3.5
Detailed paths
- 
            Introduced through: protonmail-desktop-unofficial@protonmail-desktop/application#32e970554a48c327fe297358bf7c09ee0843243a › electron-updater@4.3.5Remediation: Upgrade to electron-updater@6.3.0.
Overview
electron-updater is a module allowing applications to implement auto-update functionality.
Affected versions of this package are vulnerable to Improper Verification of Cryptographic Signature through the windowsExecutableCodeSignatureVerifier process. An attacker in control of an update manifest - via server compromise or other exploitation - can bypass signature verification of a downloaded file by tricking the application into verifying the signature on a different file instead.
Note: This is only exploitable on Windows.
Remediation
Upgrade electron-updater to version 6.3.0-alpha.6 or higher.
References
        
          medium severity
        
      
        new
      
  
  
  - Vulnerable module: min-document
- Introduced through: react-hot-loader@4.13.1
Detailed paths
- 
            Introduced through: protonmail-desktop-unofficial@protonmail-desktop/application#32e970554a48c327fe297358bf7c09ee0843243a › react-hot-loader@4.13.1 › global@4.4.0 › min-document@2.19.0
Overview
Affected versions of this package are vulnerable to Prototype Pollution via the removeAttributeNS function. An attacker can manipulate the prototype chain of JavaScript objects, potentially causing a denial-of-service attack by supplying malicious input that targets the __proto__ property during namespace attribute removal.
Notes:
This vulnerability is only exploitable if user input is passed without sanitization to the affected functions. The PoC has been validated as a theoretical vector, and a fixed version has been released.
Details
Prototype Pollution is a vulnerability affecting JavaScript. Prototype Pollution refers to the ability to inject properties into existing JavaScript language construct prototypes, such as objects. JavaScript allows all Object attributes to be altered, including their magical attributes such as __proto__, constructor and prototype. An attacker manipulates these attributes to overwrite, or pollute, a JavaScript application object prototype of the base object by injecting other values.  Properties on the Object.prototype are then inherited by all the JavaScript objects through the prototype chain. When that happens, this leads to either denial of service by triggering JavaScript exceptions, or it tampers with the application source code to force the code path that the attacker injects, thereby leading to remote code execution.
There are two main ways in which the pollution of prototypes occurs:
- Unsafe - Objectrecursive merge
- Property definition by path 
Unsafe Object recursive merge
The logic of a vulnerable recursive merge function follows the following high-level model:
merge (target, source)
  foreach property of source
    if property exists and is an object on both the target and the source
      merge(target[property], source[property])
    else
      target[property] = source[property]
When the source object contains a property named __proto__ defined with Object.defineProperty() , the condition that checks if the property exists and is an object on both the target and the source passes and the merge recurses with the target, being the prototype of Object and the source of Object as defined by the attacker. Properties are then copied on the Object prototype.
Clone operations are a special sub-class of unsafe recursive merges, which occur when a recursive merge is conducted on an empty object: merge({},source).
lodash and Hoek are examples of libraries susceptible to recursive merge attacks.
Property definition by path
There are a few JavaScript libraries that use an API to define property values on an object based on a given path. The function that is generally affected contains this signature: theFunction(object, path, value)
If the attacker can control the value of “path”, they can set this value to __proto__.myValue. myValue is then assigned to the prototype of the class of the object.
Types of attacks
There are a few methods by which Prototype Pollution can be manipulated:
| Type | Origin | Short description | 
|---|---|---|
| Denial of service (DoS) | Client | This is the most likely attack. DoS occurs when Objectholds generic functions that are implicitly called for various operations (for example,toStringandvalueOf).The attacker pollutes Object.prototype.someattrand alters its state to an unexpected value such asIntorObject. In this case, the code fails and is likely to cause a denial of service.For example: if an attacker pollutes Object.prototype.toStringby defining it as an integer, if the codebase at any point was reliant onsomeobject.toString()it would fail. | 
| Remote Code Execution | Client | Remote code execution is generally only possible in cases where the codebase evaluates a specific attribute of an object, and then executes that evaluation. For example: eval(someobject.someattr). In this case, if the attacker pollutesObject.prototype.someattrthey are likely to be able to leverage this in order to execute code. | 
| Property Injection | Client | The attacker pollutes properties that the codebase relies on for their informative value, including security properties such as cookies or tokens. For example: if a codebase checks privileges for someuser.isAdmin, then when the attacker pollutesObject.prototype.isAdminand sets it to equaltrue, they can then achieve admin privileges. | 
Affected environments
The following environments are susceptible to a Prototype Pollution attack:
- Application server 
- Web server 
- Web browser 
How to prevent
- Freeze the prototype— use - Object.freeze (Object.prototype).
- Require schema validation of JSON input. 
- Avoid using unsafe recursive merge functions. 
- Consider using objects without prototypes (for example, - Object.create(null)), breaking the prototype chain and preventing pollution.
- As a best practice use - Mapinstead of- Object.
For more information on this vulnerability type:
Arteau, Oliver. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018
Remediation
There is no fixed version for min-document.
References
        
          medium severity
        
  
  
  - Vulnerable module: inflight
- Introduced through: fs-jetpack@4.3.1
Detailed paths
- 
            Introduced through: protonmail-desktop-unofficial@protonmail-desktop/application#32e970554a48c327fe297358bf7c09ee0843243a › fs-jetpack@4.3.1 › rimraf@2.7.1 › glob@7.2.3 › inflight@1.0.6
Overview
Affected versions of this package are vulnerable to Missing Release of Resource after Effective Lifetime via the makeres function due to improperly deleting keys from the reqs object after execution of callbacks. This behavior causes the keys to remain in the reqs object, which leads to resource exhaustion.
Exploiting this vulnerability results in crashing the node process or in the application crash.
Note: This library is not maintained, and currently, there is no fix for this issue. To overcome this vulnerability, several dependent packages have eliminated the use of this library.
To trigger the memory leak, an attacker would need to have the ability to execute or influence the asynchronous operations that use the inflight module within the application. This typically requires access to the internal workings of the server or application, which is not commonly exposed to remote users. Therefore, “Attack vector” is marked as “Local”.
PoC
const inflight = require('inflight');
function testInflight() {
  let i = 0;
  function scheduleNext() {
    let key = `key-${i++}`;
    const callback = () => {
    };
    for (let j = 0; j < 1000000; j++) {
      inflight(key, callback);
    }
    setImmediate(scheduleNext);
  }
  if (i % 100 === 0) {
    console.log(process.memoryUsage());
  }
  scheduleNext();
}
testInflight();
Remediation
There is no fixed version for inflight.
References
        
          low severity
        
  
  
  - Vulnerable module: minimist
- Introduced through: minimist@1.2.5
Detailed paths
- 
            Introduced through: protonmail-desktop-unofficial@protonmail-desktop/application#32e970554a48c327fe297358bf7c09ee0843243a › minimist@1.2.5Remediation: Upgrade to minimist@1.2.6.
Overview
minimist is a parse argument options module.
Affected versions of this package are vulnerable to Prototype Pollution due to a missing handler to Function.prototype.
Notes:
- This vulnerability is a bypass to CVE-2020-7598 
- The reason for the different CVSS between CVE-2021-44906 to CVE-2020-7598, is that CVE-2020-7598 can pollute objects, while CVE-2021-44906 can pollute only function. 
PoC by Snyk
require('minimist')('--_.constructor.constructor.prototype.foo bar'.split(' '));
console.log((function(){}).foo); // bar
Details
Prototype Pollution is a vulnerability affecting JavaScript. Prototype Pollution refers to the ability to inject properties into existing JavaScript language construct prototypes, such as objects. JavaScript allows all Object attributes to be altered, including their magical attributes such as __proto__, constructor and prototype. An attacker manipulates these attributes to overwrite, or pollute, a JavaScript application object prototype of the base object by injecting other values.  Properties on the Object.prototype are then inherited by all the JavaScript objects through the prototype chain. When that happens, this leads to either denial of service by triggering JavaScript exceptions, or it tampers with the application source code to force the code path that the attacker injects, thereby leading to remote code execution.
There are two main ways in which the pollution of prototypes occurs:
- Unsafe - Objectrecursive merge
- Property definition by path 
Unsafe Object recursive merge
The logic of a vulnerable recursive merge function follows the following high-level model:
merge (target, source)
  foreach property of source
    if property exists and is an object on both the target and the source
      merge(target[property], source[property])
    else
      target[property] = source[property]
When the source object contains a property named __proto__ defined with Object.defineProperty() , the condition that checks if the property exists and is an object on both the target and the source passes and the merge recurses with the target, being the prototype of Object and the source of Object as defined by the attacker. Properties are then copied on the Object prototype.
Clone operations are a special sub-class of unsafe recursive merges, which occur when a recursive merge is conducted on an empty object: merge({},source).
lodash and Hoek are examples of libraries susceptible to recursive merge attacks.
Property definition by path
There are a few JavaScript libraries that use an API to define property values on an object based on a given path. The function that is generally affected contains this signature: theFunction(object, path, value)
If the attacker can control the value of “path”, they can set this value to __proto__.myValue. myValue is then assigned to the prototype of the class of the object.
Types of attacks
There are a few methods by which Prototype Pollution can be manipulated:
| Type | Origin | Short description | 
|---|---|---|
| Denial of service (DoS) | Client | This is the most likely attack. DoS occurs when Objectholds generic functions that are implicitly called for various operations (for example,toStringandvalueOf).The attacker pollutes Object.prototype.someattrand alters its state to an unexpected value such asIntorObject. In this case, the code fails and is likely to cause a denial of service.For example: if an attacker pollutes Object.prototype.toStringby defining it as an integer, if the codebase at any point was reliant onsomeobject.toString()it would fail. | 
| Remote Code Execution | Client | Remote code execution is generally only possible in cases where the codebase evaluates a specific attribute of an object, and then executes that evaluation. For example: eval(someobject.someattr). In this case, if the attacker pollutesObject.prototype.someattrthey are likely to be able to leverage this in order to execute code. | 
| Property Injection | Client | The attacker pollutes properties that the codebase relies on for their informative value, including security properties such as cookies or tokens. For example: if a codebase checks privileges for someuser.isAdmin, then when the attacker pollutesObject.prototype.isAdminand sets it to equaltrue, they can then achieve admin privileges. | 
Affected environments
The following environments are susceptible to a Prototype Pollution attack:
- Application server 
- Web server 
- Web browser 
How to prevent
- Freeze the prototype— use - Object.freeze (Object.prototype).
- Require schema validation of JSON input. 
- Avoid using unsafe recursive merge functions. 
- Consider using objects without prototypes (for example, - Object.create(null)), breaking the prototype chain and preventing pollution.
- As a best practice use - Mapinstead of- Object.
For more information on this vulnerability type:
Arteau, Oliver. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018
Remediation
Upgrade minimist to version 0.2.4, 1.2.6 or higher.