Skip to content

Commit

Permalink
Update: avoid printing TOTP to output when publishing (#31)
Browse files Browse the repository at this point in the history
This prevents the npm 2FA code from being printed to standard output. As a result, an attacker who had compromised an npm access token and also had access to build output would no longer be able to obtain a TOTP and use it in the next 30 seconds.
  • Loading branch information
not-an-aardvark committed Nov 10, 2018
1 parent 73b3f38 commit 1f776d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/shell-ops.js
Expand Up @@ -74,7 +74,7 @@ module.exports = {
* @private
*/
exec: function(cmd) {
console.log("+ " + cmd);
console.log("+ " + cmd.replace(/--otp=\d+/g, "--otp=(redacted)"));
var result = this.execSilent(cmd);
console.log(result);
},
Expand Down

0 comments on commit 1f776d1

Please sign in to comment.