github-action-ssh icon indicating copy to clipboard operation
github-action-ssh copied to clipboard

(node:3089) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues

Open olivertappin opened this issue 5 years ago • 4 comments

When running SSH commands directly on my Digital Ocean instance, I can see the following in the GitHub Workflows output:

(node:3089) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

Looking at the following answer from Stack Overflow: https://stackoverflow.com/a/52257416/1421836

It looks like the following matches need changing:

➜  github-action-ssh git:(master) ack 'new Buffer\('
dist/index.js
8602:    needle = new Buffer(needle);
8613:  this._lookbehind = new Buffer(needle_len);
8637:    chunk = new Buffer(chunk, 'binary');

To one of the following:

new Buffer(number)            // Old
Buffer.alloc(number)          // New
new Buffer(string)            // Old
Buffer.from(string)           // New
new Buffer(string, encoding)  // Old
Buffer.from(string, encoding) // New
new Buffer(...arguments)      // Old
Buffer.from(...arguments)     // New

olivertappin avatar Nov 06 '20 18:11 olivertappin

Hi, I just tried to use this example, and had the same problem described by you, @olivertappin .

(node:2569) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

samoritano avatar Nov 10 '20 13:11 samoritano

This might be related to this issue. ssh2 ist used as an dependency in nodessh which i am using in this action. This warning will be gone in a future release.

garygrossgarten avatar Nov 21 '20 16:11 garygrossgarten

@garygrossgarten Are you going to release a new version with this fix?

fatihyildizhan avatar Jun 03 '21 16:06 fatihyildizhan

same problem

stardustman avatar Aug 26 '21 12:08 stardustman