From e8d859d45a2e3267881ab7d1b74d5422ae125e54 Mon Sep 17 00:00:00 2001 From: Maharshi Basu Date: Mon, 12 Feb 2024 13:32:19 +0530 Subject: [PATCH 1/2] enh: upgrade hashing to SHA-256 for enhanced security Signed-off-by: Maharshi Basu --- node_modules/bsock/vendor/faye-websocket.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/node_modules/bsock/vendor/faye-websocket.js b/node_modules/bsock/vendor/faye-websocket.js index 65afcd3d1..77a1f5dda 100644 --- a/node_modules/bsock/vendor/faye-websocket.js +++ b/node_modules/bsock/vendor/faye-websocket.js @@ -1459,9 +1459,9 @@ Hybi.mask = function(payload, mask, offset) { }; Hybi.generateAccept = function(key) { - var sha1 = crypto.createHash('sha1'); - sha1.update(key + Hybi.GUID); - return sha1.digest('base64'); + var sha256 = crypto.createHash('sha256'); + sha256.update(key + Hybi.GUID); + return sha256.digest('base64'); }; Hybi.GUID = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'; @@ -2916,15 +2916,15 @@ var instance = { _handshakeSignature: function() { if (this._body.length < this.BODY_SIZE) return null; - var md5 = crypto.createHash('md5'), + var sha256 = crypto.createHash('sha256'), buffer = new Buffer(8 + this.BODY_SIZE); buffer.writeUInt32BE(this._keyValues[0], 0); buffer.writeUInt32BE(this._keyValues[1], 4); new Buffer(this._body).copy(buffer, 8, 0, this.BODY_SIZE); - md5.update(buffer); - return new Buffer(md5.digest('binary'), 'binary'); + sha256.update(buffer); + return new Buffer(sha256.digest('binary'), 'binary'); }, _sendHandshakeBody: function() { From 1f879a9800f29f34b71712b27ee5faeb353512d9 Mon Sep 17 00:00:00 2001 From: Maharshi Basu Date: Mon, 12 Feb 2024 15:04:52 +0530 Subject: [PATCH 2/2] chore: change deprectated babel-eslint parser to @babel/eslint-parser Signed-off-by: Maharshi Basu --- .eslintrc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.eslintrc.json b/.eslintrc.json index b050f53e7..db4323552 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -43,7 +43,7 @@ } } ], - "parser": "babel-eslint", + "parser": "@babel/eslint-parser", "parserOptions": { "ecmaVersion": 10, "ecmaFeatures": {