facebook-export-notes@1.0.3

Vulnerabilities

45 via 48 paths

Dependencies

247

Source

npm

Find, fix and prevent vulnerabilities in your code.

Severity
  • 34
  • 9
  • 2
Status
  • 45
  • 0
  • 0

high severity

Arbitrary Code Execution

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8
    Remediation: Upgrade to nightmare@3.0.2.

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Arbitrary Code Execution. Opening a BrowserView with sandbox: true or nativeWindowOpen: true and nodeIntegration: false results in a webContents where window.open() can be called and the newly opened child will have nodeIntegration enabled.

Remediation

Upgrade electron to version 2.0.17, 3.0.15, 3.1.3, 4.0.4, 5.0.0-beta.2 or higher.

If for some reason you are unable to upgrade your Electron version, you can mitigate this issue by disabling all child web contents: view.webContents.on('-add-new-contents', e => e.preventDefault());

References

high severity

Arbitrary Code Execution

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Arbitrary Code Execution due to Node being enabled in a webview because the default values of nodeIntegration and webviewTag were set to true when they where undefined by a user. The fix allows users to prevent Node and webview being enabled, when undefined, by setting the default values of nodeIntegration and webviewTag to false.

Remediation

Upgrade electron to version 5.0.0-beta.1 or higher.

References

high severity

Heap Overflow

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Heap Overflow. A Heap buffer overflow exists in the media component of Google Chrome, which also affects chromium.

Remediation

Upgrade electron to version 6.1.10, 7.2.2, 8.2.1 or higher.

References

high severity

Heap-based Buffer Overflow

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Heap-based Buffer Overflow in Freetype.

Remediation

Upgrade electron to version 8.5.3, 9.3.3, 10.1.5 or higher.

References

high severity

Heap-based Buffer Overflow

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Heap-based Buffer Overflow. A heap buffer overflow flaw was found in the UI component of the Chromium browser.

Remediation

Upgrade electron to version 9.4.0, 10.2.0 or higher.

References

high severity

Improper Access Control

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Improper Access Control. An insufficient policy enforcement flaw was found in the networking component of chromium.

Remediation

Upgrade electron to version 9.4.0, 10.1.7 or higher.

References

high severity

Improper Access Control

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Improper Access Control. It has an inappropriate implementation in V8.

Remediation

Upgrade electron to version 6.1.10, 7.2.2, 8.2.1 or higher.

References

high severity

Improper Input Validation

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Improper Input Validation. An insufficient data validation flaw was found in the WASM component of the Chromium browser.

Remediation

Upgrade electron to version 9.4.0, 10.1.7 or higher.

References

high severity

Improper Validation

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Improper Validation. The value of a node was accessed without prior HasValue check. With WebAssembly this node is not guaranteed to be a value.

Remediation

Upgrade electron to version 10.1.6 or higher.

References

high severity

Insufficient Validation

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Insufficient Validation in V8.

Remediation

Upgrade electron to version 9.4.0, 10.2.0 or higher.

References

high severity

new

Out-of-bounds Read

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Out-of-bounds Read. An unknown vunerability exists in Chrome which affects electron.

Remediation

Upgrade electron to version 9.4.1 or higher.

References

high severity

Out-of-bounds Read

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Out-of-bounds Read. The input to sctp_load_addresses_from_init is verified by calling sctp_arethere_unrecognized_parameters, however there is a difference in how these functions handle parameter bounds. The function sctp_arethere_unrecognized_parameters does not process a parameter that is partially outside of the limit of the chunk, meanwhile, sctp_load_addresses_from_init will continue processing until a parameter that is entirely outside of the chunk occurs.

This means that the last parameter of a chunk is not always verified, which can lead to parameters with very short plen values being processed by sctp_load_addresses_from_init. This can lead to out-of-bounds reads whenever the plen is subtracted from the header len.

Remediation

Upgrade electron to version 6.1.10, 7.2.2, 8.2.0 or higher.

References

high severity

Privilege Escalation

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Privilege Escalation. This is a context isolation bypass, meaning that code running in the main world context in the renderer can reach into the isolated Electron context and perform privileged actions.

##Note: Only apps using contextIsolation are affected.

Remediation

Upgrade electron to version 7.2.4, 8.2.4 or higher.

References

high severity

Privilege Escalation

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Privilege Escalation. This is a context isolation bypass, meaning that code running in the main world context in the renderer can reach into the isolated Electron context and perform privileged actions.

##Note: Only apps using both contextIsolation and contextBridge are affected.

Remediation

Upgrade electron to version 7.2.4, 8.2.4 or higher.

References

high severity

Privilege Escalation

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Privilege Escalation. This is a context isolation bypass, meaning that code running in the main world context in the renderer can reach into the isolated Electron context and perform privileged actions.

##Note: Only apps using contextIsolation are affected.

Remediation

Upgrade electron to version 6.1.11, 7.2.4, 8.2.4 or higher.

References

high severity

Site Isolation Bypass

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Site Isolation Bypass. parent_execution_origin_ is provided from parent's RenderFrameHostImpl::last_committed_origin_ that is set during navigation commit. Worker creation IPC from the renderer to browser could race with navigation commit, and could see the wrong last committed origin.

Remediation

Upgrade electron to version 7.2.2, 8.2.1 or higher.

References

high severity

Type Confusion

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Type Confusion in V8.

Remediation

Upgrade electron to version 7.3.1 or higher.

References

high severity

Use After Free

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Use After Free via the site isolation.

Remediation

Upgrade electron to version 8.5.4, 9.3.5, 10.1.6 or higher.

References

high severity

Use After Free

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Use After Free. A use after free flaw was found in the PPAPI component of the Chromium browser.

Remediation

Upgrade electron to version 9.4.0, 10.2.0 or higher.

References

high severity

Use After Free

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Use After Free. Since JavaScript may detach the underlying buffers, they need to be checked to ensure they're still valid before using them for decoding.

Remediation

Upgrade electron to version 10.2.0 or higher.

References

high severity

new

Use After Free

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Use After Free. An unknown vunerability exists in Chrome.

Remediation

Upgrade electron to version 9.4.1 or higher.

References

high severity

new

Use After Free

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Use After Free in Media.

Remediation

Upgrade electron to version 11.2.1 or higher.

References

high severity

new

Use After Free

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Use After Free. It hands sub-queries with both a correlated WHERE clause and a HAVING 0 clause where the parent query is itself an aggregate.

Remediation

Upgrade electron to version 11.2.1 or higher.

References

high severity

Use After Free

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8
    Remediation: Upgrade to nightmare@3.0.2.

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Use After Free via the Chromium FileReader.

Note: This vulnerability affects all software based on Chromium, including Electron.

Remediation

Upgrade electron to version 2.0.18, 3.0.16, 3.1.6, 4.0.8 or higher.

References

high severity

Use After Free

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Use After Free. Multiple user after free vulnerabilities exists in the WebAudio component of chromium.

Remediation

Upgrade electron to version 6.1.10, 7.2.2, 8.2.1 or higher.

References

high severity

Use After Free

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Use After Free. It allowed a remote attacker to potentially exploit heap corruption via a crafted HTML page.

Remediation

Upgrade electron to version 6.1.10, 7.2.2, 8.2.1 or higher.

References

high severity

Use After Free

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Use After Free via the audio component. It allowed a remote attacker to potentially exploit heap corruption via a crafted HTML page.

Remediation

Upgrade electron to version 6.1.10, 7.2.2, 8.2.1 or higher.

References

high severity

Use After Free

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Use After Free via the audio component.

Remediation

Upgrade electron to version 8.2.1, 7.2.2 or higher.

References

high severity

Use After Free

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Use After Free. FileChooserImpl can outlive ListenerProxy leading to a crash.

Remediation

Upgrade electron to version 6.1.10, 7.2.2, 8.2.0 or higher.

References

high severity

Use After Free

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Use After Free. Initialize() could potentially run twice in MojoVideoEncodeAcceleratorService.

Remediation

Upgrade electron to version 6.1.10, 7.2.2, 8.2.1 or higher.

References

high severity

Use After Free

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Use After Free. It allows a remote attacker to potentially exploit heap corruption via a crafted HTML page.

Remediation

Upgrade electron to version 6.1.10, 7.2.2, 8.2.0 or higher.

References

high severity

Use After Free

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Use After Free. An AudioContext is considered to have activity if it's not closed. Previously, suspended contexts were considered has having no activity, but that's not quite true since the context can be resumed at any time after. This would allow contexts to be collected prematurely even though the context was resumed. This causes the audio thread to access objects that are possibly deleted.

Remediation

Upgrade electron to version 6.1.10, 7.2.2, 8.0.0-beta.6 or higher.

References

high severity

Use After Free

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Use After Free in WebRTC.

Remediation

Upgrade electron to version 8.3.1 or higher.

References

high severity

Prototype Override Protection Bypass

  • Vulnerable module: qs
  • Introduced through: node-readability@2.2.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 node-readability@2.2.0 request@2.40.0 qs@1.0.2

Overview

qs is a querystring parser that supports nesting and arrays, with a depth limit.

Affected versions of this package are vulnerable to Prototype Override Protection Bypass. By default qs protects against attacks that attempt to overwrite an object's existing prototype properties, such as toString(), hasOwnProperty(),etc.

From qs documentation:

By default parameters that would overwrite properties on the object prototype are ignored, if you wish to keep the data from those fields either use plainObjects as mentioned above, or set allowPrototypes to true which will allow user input to overwrite those properties. WARNING It is generally a bad idea to enable this option as it can cause problems when attempting to use the properties that have been overwritten. Always be careful with this option.

Overwriting these properties can impact application logic, potentially allowing attackers to work around security controls, modify data, make the application unstable and more.

In versions of the package affected by this vulnerability, it is possible to circumvent this protection and overwrite prototype properties and functions by prefixing the name of the parameter with [ or ]. e.g. qs.parse("]=toString") will return {toString = true}, as a result, calling toString() on the object will throw an exception.

Example:

qs.parse('toString=foo', { allowPrototypes: false })
// {}

qs.parse("]=toString", { allowPrototypes: false })
// {toString = true} <== prototype overwritten

For more information, you can check out our blog.

Disclosure Timeline

  • February 13th, 2017 - Reported the issue to package owner.
  • February 13th, 2017 - Issue acknowledged by package owner.
  • February 16th, 2017 - Partial fix released in versions 6.0.3, 6.1.1, 6.2.2, 6.3.1.
  • March 6th, 2017 - Final fix released in versions 6.4.0,6.3.2, 6.2.3, 6.1.2 and 6.0.4

    Remediation

    Upgrade qs to version 6.0.4, 6.1.2, 6.2.3, 6.3.2 or higher.

    References

  • GitHub Commit
  • GitHub Issue

medium severity

Arbitrary File Read

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Arbitrary File Read. It allows arbitrary local file read by defining unsafe window options on a child window opened via window.open.

Remediation

Upgrade electron to version 7.2.4, 8.2.4 or higher.

References

medium severity

Buffer Underflow

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Buffer Underflow. Since there may be multiple instance of DWriteFontProxyImpl instantiated for multiple RenderProcessHosts, and DWriteFontProxyImpl::GetUniqueNameLookupTable may access DWriteFontLookupTableBuilder::QueueShareMemoryRegionWhenReady from separate threads, there may be race conditions around the pending_callbacks_ member of DWriteFontLookupTableBuilder.

Remediation

Upgrade electron to version 6.1.10, 7.2.2, 8.2.0 or higher.

References

medium severity

new

Improper Input Validation

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Improper Input Validation via the File System API.

Remediation

Upgrade electron to version 11.2.1 or higher.

References

medium severity

Information Exposure

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Information Exposure. When a BigInt is right-shifted the backing store is not properly cleared, allowing uninitialized memory to be read.

Remediation

Upgrade electron to version 9.4.1 or higher.

References

medium severity

Use After Free

  • Vulnerable module: electron
  • Introduced through: nightmare@2.10.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 nightmare@2.10.0 electron@1.8.8

Overview

electron is a framework which lets you write cross-platform desktop applications using JavaScript, HTML and CSS.

Affected versions of this package are vulnerable to Use After Free. The rendering_orphan_handlers_ and deletable_orphan_handlers_ handlers can hold references to the context after BaseAudioContext is destroyed.

Remediation

Upgrade electron to version 6.1.10, 7.2.2, 8.2.1 or higher.

References

medium severity

Prototype Pollution

  • Vulnerable module: hoek
  • Introduced through: node-readability@2.2.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 node-readability@2.2.0 request@2.40.0 hawk@1.1.1 hoek@0.9.1
  • Introduced through: facebook-export-notes@1.0.3 node-readability@2.2.0 request@2.40.0 hawk@1.1.1 boom@0.4.2 hoek@0.9.1
  • Introduced through: facebook-export-notes@1.0.3 node-readability@2.2.0 request@2.40.0 hawk@1.1.1 sntp@0.2.4 hoek@0.9.1
  • Introduced through: facebook-export-notes@1.0.3 node-readability@2.2.0 request@2.40.0 hawk@1.1.1 cryptiles@0.2.2 boom@0.4.2 hoek@0.9.1

Overview

hoek is an Utility methods for the hapi ecosystem.

Affected versions of this package are vulnerable to Prototype Pollution. The utilities function allow modification of the Object prototype. If an attacker can control part of the structure passed to this function, they could add or modify an existing property.

PoC by Olivier Arteau (HoLyVieR)

var Hoek = require('hoek');
var malicious_payload = '{"__proto__":{"oops":"It works !"}}';

var a = {};
console.log("Before : " + a.oops);
Hoek.merge({}, JSON.parse(malicious_payload));
console.log("After : " + a.oops);

Details

Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its original and legitimate users. There are many types of DoS attacks, ranging from trying to clog the network pipes to the system by generating a large volume of traffic from many machines (a Distributed Denial of Service - DDoS - attack) to sending crafted requests that cause a system to crash or take a disproportional amount of time to process.

The Regular expression Denial of Service (ReDoS) is a type of Denial of Service attack. Regular expressions are incredibly powerful, but they aren't very intuitive and can ultimately end up making it easy for attackers to take your site down.

Let’s take the following regular expression as an example:

regex = /A(B|C+)+D/

This regular expression accomplishes the following:

  • A The string must start with the letter 'A'
  • (B|C+)+ The string must then follow the letter A with either the letter 'B' or some number of occurrences of the letter 'C' (the + matches one or more times). The + at the end of this section states that we can look for one or more matches of this section.
  • D Finally, we ensure this section of the string ends with a 'D'

The expression would match inputs such as ABBD, ABCCCCD, ABCBCCCD and ACCCCCD

It most cases, it doesn't take very long for a regex engine to find a match:

$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCD")'
0.04s user 0.01s system 95% cpu 0.052 total

$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCX")'
1.79s user 0.02s system 99% cpu 1.812 total

The entire process of testing it against a 30 characters long string takes around ~52ms. But when given an invalid string, it takes nearly two seconds to complete the test, over ten times as long as it took to test a valid string. The dramatic difference is due to the way regular expressions get evaluated.

Most Regex engines will work very similarly (with minor differences). The engine will match the first possible way to accept the current character and proceed to the next one. If it then fails to match the next one, it will backtrack and see if there was another way to digest the previous character. If it goes too far down the rabbit hole only to find out the string doesn’t match in the end, and if many characters have multiple valid regex paths, the number of backtracking steps can become very large, resulting in what is known as catastrophic backtracking.

Let's look at how our expression runs into this problem, using a shorter string: "ACCCX". While it seems fairly straightforward, there are still four different ways that the engine could match those three C's:

  1. CCC
  2. CC+C
  3. C+CC
  4. C+C+C.

The engine has to try each of those combinations to see if any of them potentially match against the expression. When you combine that with the other steps the engine must take, we can use RegEx 101 debugger to see the engine has to take a total of 38 steps before it can determine the string doesn't match.

From there, the number of steps the engine must use to validate a string just continues to grow.

String Number of C's Number of steps
ACCCX 3 38
ACCCCX 4 71
ACCCCCX 5 136
ACCCCCCCCCCCCCCX 14 65,553

By the time the string includes 14 C's, the engine has to take over 65,000 steps just to see if the string is valid. These extreme situations can cause them to work very slowly (exponentially related to input size, as shown above), allowing an attacker to exploit this and can cause the service to excessively consume CPU, resulting in a Denial of Service.

Remediation

Upgrade hoek to version 4.2.1, 5.0.3 or higher.

References

medium severity

Timing Attack

  • Vulnerable module: http-signature
  • Introduced through: node-readability@2.2.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 node-readability@2.2.0 request@2.40.0 http-signature@0.10.1
    Remediation: Open PR to patch http-signature@0.10.1.

Overview

http-signature is a reference implementation of Joyent's HTTP Signature scheme.

Affected versions of the package are vulnerable to Timing Attacks due to time-variable comparison of signatures.

The library implemented a character to character comparison, similar to the built-in string comparison mechanism, ===, and not a time constant string comparison. As a result, the comparison will fail faster when the first characters in the signature are incorrect. An attacker can use this difference to perform a timing attack, essentially allowing them to guess the signature one character at a time.

You can read more about timing attacks in Node.js on the Snyk blog.

Remediation

Upgrade http-signature to version 1.0.0 or higher.

References

medium severity

Remote Memory Exposure

  • Vulnerable module: request
  • Introduced through: node-readability@2.2.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 node-readability@2.2.0 request@2.40.0
    Remediation: Open PR to patch request@2.40.0.

Overview

request is a simplified http request client.

Affected versions of this package are vulnerable to Remote Memory Exposure. A potential remote memory exposure vulnerability exists in request. If a request uses a multipart attachment and the body type option is number with value X, then X bytes of uninitialized memory will be sent in the body of the request.

Note that while the impact of this vulnerability is high (memory exposure), exploiting it is likely difficult, as the attacker needs to somehow control the body type of the request. One potential exploit scenario is when a request is composed based on JSON input, including the body type, allowing a malicious JSON to trigger the memory leak.

Details

Constructing a Buffer class with integer N creates a Buffer of length N with non zero-ed out memory. Example:

var x = new Buffer(100); // uninitialized Buffer of length 100
// vs
var x = new Buffer('100'); // initialized Buffer with value of '100'

Initializing a multipart body in such manner will cause uninitialized memory to be sent in the body of the request.

Proof of concept

var http = require('http')
var request = require('request')

http.createServer(function (req, res) {
  var data = ''
  req.setEncoding('utf8')
  req.on('data', function (chunk) {
    console.log('data')
    data += chunk
  })
  req.on('end', function () {
    // this will print uninitialized memory from the client
    console.log('Client sent:\n', data)
  })
  res.end()
}).listen(8000)

request({
  method: 'POST',
  uri: 'http://localhost:8000',
  multipart: [{ body: 1000 }]
},
function (err, res, body) {
  if (err) return console.error('upload failed:', err)
  console.log('sent')
})

Remediation

Upgrade request to version 2.68.0 or higher.

References

medium severity

Uninitialized Memory Exposure

  • Vulnerable module: tunnel-agent
  • Introduced through: node-readability@2.2.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 node-readability@2.2.0 request@2.40.0 tunnel-agent@0.4.3
    Remediation: Open PR to patch tunnel-agent@0.4.3.

Overview

tunnel-agent is HTTP proxy tunneling agent. Affected versions of the package are vulnerable to Uninitialized Memory Exposure.

A possible memory disclosure vulnerability exists when a value of type number is used to set the proxy.auth option of a request request and results in a possible uninitialized memory exposures in the request body.

This is a result of unobstructed use of the Buffer constructor, whose insecure default constructor increases the odds of memory leakage.

Details

Constructing a Buffer class with integer N creates a Buffer of length N with raw (not "zero-ed") memory.

In the following example, the first call would allocate 100 bytes of memory, while the second example will allocate the memory needed for the string "100":

// uninitialized Buffer of length 100
x = new Buffer(100);
// initialized Buffer with value of '100'
x = new Buffer('100');

tunnel-agent's request construction uses the default Buffer constructor as-is, making it easy to append uninitialized memory to an existing list. If the value of the buffer list is exposed to users, it may expose raw server side memory, potentially holding secrets, private data and code. This is a similar vulnerability to the infamous Heartbleed flaw in OpenSSL.

Proof of concept by ChALkeR

require('request')({
  method: 'GET',
  uri: 'http://www.example.com',
  tunnel: true,
  proxy:{
      protocol: 'http:',
      host:"127.0.0.1",
      port:8080,
      auth:80
  }
});

You can read more about the insecure Buffer behavior on our blog.

Similar vulnerabilities were discovered in request, mongoose, ws and sequelize.

Remediation

Upgrade tunnel-agent to version 0.6.0 or higher. Note This is vulnerable only for Node <=4

References

low severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: hawk
  • Introduced through: node-readability@2.2.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 node-readability@2.2.0 request@2.40.0 hawk@1.1.1
    Remediation: Open PR to patch hawk@1.1.1.

Overview

hawk is an HTTP authentication scheme using a message authentication code (MAC) algorithm to provide partial HTTP request cryptographic verification.

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

Details

Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its original and legitimate users. There are many types of DoS attacks, ranging from trying to clog the network pipes to the system by generating a large volume of traffic from many machines (a Distributed Denial of Service - DDoS - attack) to sending crafted requests that cause a system to crash or take a disproportional amount of time to process.

The Regular expression Denial of Service (ReDoS) is a type of Denial of Service attack. Regular expressions are incredibly powerful, but they aren't very intuitive and can ultimately end up making it easy for attackers to take your site down.

Let’s take the following regular expression as an example:

regex = /A(B|C+)+D/

This regular expression accomplishes the following:

  • A The string must start with the letter 'A'
  • (B|C+)+ The string must then follow the letter A with either the letter 'B' or some number of occurrences of the letter 'C' (the + matches one or more times). The + at the end of this section states that we can look for one or more matches of this section.
  • D Finally, we ensure this section of the string ends with a 'D'

The expression would match inputs such as ABBD, ABCCCCD, ABCBCCCD and ACCCCCD

It most cases, it doesn't take very long for a regex engine to find a match:

$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCD")'
0.04s user 0.01s system 95% cpu 0.052 total

$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCX")'
1.79s user 0.02s system 99% cpu 1.812 total

The entire process of testing it against a 30 characters long string takes around ~52ms. But when given an invalid string, it takes nearly two seconds to complete the test, over ten times as long as it took to test a valid string. The dramatic difference is due to the way regular expressions get evaluated.

Most Regex engines will work very similarly (with minor differences). The engine will match the first possible way to accept the current character and proceed to the next one. If it then fails to match the next one, it will backtrack and see if there was another way to digest the previous character. If it goes too far down the rabbit hole only to find out the string doesn’t match in the end, and if many characters have multiple valid regex paths, the number of backtracking steps can become very large, resulting in what is known as catastrophic backtracking.

Let's look at how our expression runs into this problem, using a shorter string: "ACCCX". While it seems fairly straightforward, there are still four different ways that the engine could match those three C's:

  1. CCC
  2. CC+C
  3. C+CC
  4. C+C+C.

The engine has to try each of those combinations to see if any of them potentially match against the expression. When you combine that with the other steps the engine must take, we can use RegEx 101 debugger to see the engine has to take a total of 38 steps before it can determine the string doesn't match.

From there, the number of steps the engine must use to validate a string just continues to grow.

String Number of C's Number of steps
ACCCX 3 38
ACCCCX 4 71
ACCCCCX 5 136
ACCCCCCCCCCCCCCX 14 65,553

By the time the string includes 14 C's, the engine has to take over 65,000 steps just to see if the string is valid. These extreme situations can cause them to work very slowly (exponentially related to input size, as shown above), allowing an attacker to exploit this and can cause the service to excessively consume CPU, resulting in a Denial of Service.

You can read more about Regular Expression Denial of Service (ReDoS) on our blog.

References

low severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: mime
  • Introduced through: node-readability@2.2.0

Detailed paths

  • Introduced through: facebook-export-notes@1.0.3 node-readability@2.2.0 request@2.40.0 form-data@0.1.4 mime@1.2.11
    Remediation: Open PR to patch mime@1.2.11.

Overview

mime is a comprehensive, compact MIME type module.

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS). It uses regex the following regex /.*[\.\/\\]/ in its lookup, which can cause a slowdown of 2 seconds for 50k characters.

Details

Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its original and legitimate users. There are many types of DoS attacks, ranging from trying to clog the network pipes to the system by generating a large volume of traffic from many machines (a Distributed Denial of Service - DDoS - attack) to sending crafted requests that cause a system to crash or take a disproportional amount of time to process.

The Regular expression Denial of Service (ReDoS) is a type of Denial of Service attack. Regular expressions are incredibly powerful, but they aren't very intuitive and can ultimately end up making it easy for attackers to take your site down.

Let’s take the following regular expression as an example:

regex = /A(B|C+)+D/

This regular expression accomplishes the following:

  • A The string must start with the letter 'A'
  • (B|C+)+ The string must then follow the letter A with either the letter 'B' or some number of occurrences of the letter 'C' (the + matches one or more times). The + at the end of this section states that we can look for one or more matches of this section.
  • D Finally, we ensure this section of the string ends with a 'D'

The expression would match inputs such as ABBD, ABCCCCD, ABCBCCCD and ACCCCCD

It most cases, it doesn't take very long for a regex engine to find a match:

$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCD")'
0.04s user 0.01s system 95% cpu 0.052 total

$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCX")'
1.79s user 0.02s system 99% cpu 1.812 total

The entire process of testing it against a 30 characters long string takes around ~52ms. But when given an invalid string, it takes nearly two seconds to complete the test, over ten times as long as it took to test a valid string. The dramatic difference is due to the way regular expressions get evaluated.

Most Regex engines will work very similarly (with minor differences). The engine will match the first possible way to accept the current character and proceed to the next one. If it then fails to match the next one, it will backtrack and see if there was another way to digest the previous character. If it goes too far down the rabbit hole only to find out the string doesn’t match in the end, and if many characters have multiple valid regex paths, the number of backtracking steps can become very large, resulting in what is known as catastrophic backtracking.

Let's look at how our expression runs into this problem, using a shorter string: "ACCCX". While it seems fairly straightforward, there are still four different ways that the engine could match those three C's:

  1. CCC
  2. CC+C
  3. C+CC
  4. C+C+C.

The engine has to try each of those combinations to see if any of them potentially match against the expression. When you combine that with the other steps the engine must take, we can use RegEx 101 debugger to see the engine has to take a total of 38 steps before it can determine the string doesn't match.

From there, the number of steps the engine must use to validate a string just continues to grow.

String Number of C's Number of steps
ACCCX 3 38
ACCCCX 4 71
ACCCCCX 5 136
ACCCCCCCCCCCCCCX 14 65,553

By the time the string includes 14 C's, the engine has to take over 65,000 steps just to see if the string is valid. These extreme situations can cause them to work very slowly (exponentially related to input size, as shown above), allowing an attacker to exploit this and can cause the service to excessively consume CPU, resulting in a Denial of Service.

Remediation

Upgrade mime to version 1.4.1, 2.0.3 or higher.

References