Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): Update packages to address CVE-2023-2142 and CVE-2020-28469 #6844

Merged
merged 4 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
"cookie-parser": "^1.4.6",
"crypto-js": "~4.1.1",
"csrf": "^3.1.0",
"curlconverter": "^3.0.0",
"curlconverter": "3.21.0",
"dotenv": "^8.0.0",
"express": "^4.18.2",
"express-async-errors": "^3.1.1",
Expand Down
10 changes: 5 additions & 5 deletions packages/nodes-base/nodes/MQTT/Mqtt.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
INodeTypeDescription,
} from 'n8n-workflow';

import mqtt from 'mqtt';
import * as mqtt from 'mqtt';

export class Mqtt implements INodeType {
description: INodeTypeDescription = {
Expand Down Expand Up @@ -155,7 +155,7 @@ export class Mqtt implements INodeType {
client = mqtt.connect(brokerUrl, clientOptions);
}

await new Promise((resolve, reject): any => {
await new Promise((resolve, reject) => {
client.on('connect', (test) => {
resolve(test);
client.end();
Expand All @@ -168,7 +168,7 @@ export class Mqtt implements INodeType {
} catch (error) {
return {
status: 'Error',
message: error.message,
message: (error as Error).message,
};
}
return {
Expand Down Expand Up @@ -232,7 +232,7 @@ export class Mqtt implements INodeType {

const sendInputData = this.getNodeParameter('sendInputData', 0) as boolean;

const data = await new Promise((resolve, reject): any => {
const data = await new Promise((resolve, reject) => {
client.on('connect', () => {
for (let i = 0; i < length; i++) {
let message;
Expand All @@ -256,7 +256,7 @@ export class Mqtt implements INodeType {
resolve([items]);
});

client.on('error', (e: string | undefined) => {
client.on('error', (e) => {
reject(e);
});
});
Expand Down
10 changes: 5 additions & 5 deletions packages/nodes-base/nodes/MQTT/MqttTrigger.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
} from 'n8n-workflow';
import { NodeOperationError } from 'n8n-workflow';

import mqtt from 'mqtt';
import * as mqtt from 'mqtt';

export class MqttTrigger implements INodeType {
description: INodeTypeDescription = {
Expand Down Expand Up @@ -142,9 +142,9 @@ export class MqttTrigger implements INodeType {
const manualTriggerFunction = async () => {
await new Promise((resolve, reject) => {
client.on('connect', () => {
client.subscribe(topicsQoS as mqtt.ISubscriptionMap, (err, _granted) => {
if (err) {
reject(err);
client.subscribe(topicsQoS as mqtt.ISubscriptionMap, (error, _granted) => {
if (error) {
reject(error);
}
client.on('message', (topic: string, message: Buffer | string) => {
let result: IDataObject = {};
Expand All @@ -154,7 +154,7 @@ export class MqttTrigger implements INodeType {
if (options.jsonParseBody) {
try {
message = JSON.parse(message.toString());
} catch (error) {}
} catch (e) {}
}

result.message = message;
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@
"moment": "~2.29.2",
"moment-timezone": "^0.5.28",
"mongodb": "^4.9.1",
"mqtt": "4.2.6",
"mqtt": "^5.0.2",
"mssql": "^8.1.2",
"mysql2": "~2.3.0",
"n8n-workflow": "workspace:*",
Expand Down
Loading