Skip to content

Commit ebe2c70

Browse files
authored
Merge branch 'EvolutionAPI:develop' into develop
2 parents a1d30c7 + 09f79c9 commit ebe2c70

5 files changed

Lines changed: 16 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 2.2.4 (hotfix)
2+
3+
### Fixed
4+
5+
* Shell injection vulnerability
6+
17
# 2.2.3 (2025-02-03 11:52)
28

39
### Fixed

src/api/integrations/storage/s3/libs/minio.server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ const createBucket = async () => {
6363
if (!exists) {
6464
await minioClient.makeBucket(bucketName);
6565
}
66-
67-
await setBucketPolicy();
68-
66+
if (!BUCKET.SKIP_POLICY) {
67+
await setBucketPolicy();
68+
}
6969
logger.info(`S3 Bucket ${bucketName} - ON`);
7070
return true;
7171
} catch (error) {

src/api/provider/sessions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Auth, ConfigService, ProviderSession } from '@config/env.config';
22
import { Logger } from '@config/logger.config';
33
import axios from 'axios';
4-
import { execSync } from 'child_process';
4+
import { execFileSync } from 'child_process';
55

66
type ResponseSuccess = { status: number; data?: any };
77
type ResponseProvider = Promise<[ResponseSuccess?, Error?]>;
@@ -36,7 +36,7 @@ export class ProviderFiles {
3636
} catch (error) {
3737
this.logger.error(['Failed to connect to the file server', error?.message, error?.stack]);
3838
const pid = process.pid;
39-
execSync(`kill -9 ${pid}`);
39+
execFileSync('kill', ['-9', `${pid}`]);
4040
}
4141
}
4242
}

src/api/services/monitor.service.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { CacheConf, Chatwoot, ConfigService, Database, DelInstance, ProviderSess
77
import { Logger } from '@config/logger.config';
88
import { INSTANCE_DIR, STORE_DIR } from '@config/path.config';
99
import { NotFoundException } from '@exceptions';
10-
import { execSync } from 'child_process';
10+
import { execFileSync } from 'child_process';
1111
import EventEmitter2 from 'eventemitter2';
1212
import { rmSync } from 'fs';
1313
import { join } from 'path';
@@ -169,7 +169,8 @@ export class WAMonitoringService {
169169

170170
public async cleaningStoreData(instanceName: string) {
171171
if (this.configService.get<Chatwoot>('CHATWOOT').ENABLED) {
172-
execSync(`rm -rf ${join(STORE_DIR, 'chatwoot', instanceName + '*')}`);
172+
const instancePath = join(STORE_DIR, 'chatwoot', instanceName);
173+
execFileSync('rm', ['-rf', instancePath]);
173174
}
174175

175176
const instance = await this.prismaRepository.instance.findFirst({

src/config/env.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ export type S3 = {
277277
PORT?: number;
278278
USE_SSL?: boolean;
279279
REGION?: string;
280+
SKIP_POLICY?: boolean;
280281
};
281282

282283
export type CacheConf = { REDIS: CacheConfRedis; LOCAL: CacheConfLocal };
@@ -635,6 +636,7 @@ export class ConfigService {
635636
PORT: Number.parseInt(process.env?.S3_PORT || '9000'),
636637
USE_SSL: process.env?.S3_USE_SSL === 'true',
637638
REGION: process.env?.S3_REGION,
639+
SKIP_POLICY: process.env?.S3_SKIP_POLICY === 'true',
638640
},
639641
AUTHENTICATION: {
640642
API_KEY: {

0 commit comments

Comments
 (0)