diff --git a/package.json b/package.json index a88e17b491f..d98865cc22e 100644 --- a/package.json +++ b/package.json @@ -155,7 +155,7 @@ "libxmljs2": "^0.30.1", "marsdb": "^0.6.11", "morgan": "^1.10.0", - "multer": "^1.4.2", + "multer": "^1.4.5-lts.1", "node-pre-gyp": "^0.15.0", "notevil": "^1.3.3", "on-finished": "^2.3.0", diff --git a/test/api/memoryApiSpec.ts b/test/api/memoryApiSpec.ts index 02f5ff243bf..c3b7d43b673 100644 --- a/test/api/memoryApiSpec.ts +++ b/test/api/memoryApiSpec.ts @@ -107,4 +107,16 @@ describe('/rest/memories', () => { }) }) }) + + it('Should not crash the node-js server when sending invalid content like described in CVE-2022-24434', () => { + return frisby.post(REST_URL + '/memories', { + headers: { + 'Content-Type': 'multipart/form-data; boundary=----WebKitFormBoundaryoo6vortfDzBsDiro', + 'Content-Length': '145' + }, + body: '------WebKitFormBoundaryoo6vortfDzBsDiro\r\n Content-Disposition: form-data; name="bildbeschreibung"\r\n\r\n\r\n------WebKitFormBoundaryoo6vortfDzBsDiro--' + }) + .expect('status', 500) + .expect('bodyContains', 'Error: Malformed part header') + }) })