Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential for command injection in printer/package/lib/printer.js #1

Closed
nodesecurity opened this issue Apr 26, 2013 · 2 comments
Closed

Comments

@nodesecurity
Copy link

Overview

Untrusted input passed in to the printer attribute of the first argument to printDirect module can allow for command injection. This may be unexpected behavior for the caller.

Confirmed on version 0.0.1

Confirmed vulnerable. Examples:

var printer = require("printer");
printer.printDirect({data:"print from Node.JS"
, printer:"`ping google.com`"
, type: "TEXT"
, success:function(){
console.log("ok");
}
, error:function(err){console.log(err);}
});

Recommendation

  • If you do not need to execute within a subshell, it's recommended to
    usechild_process.execFile and pass in the arguments array.

Credit: Node Security Auditor

Adam Baldwin

Questions? Hit us up in #nodesecurity on freenode or email info@nodesecurity.io and reference this issue.

The Node Security Project
nodesecurity.io
@nodesecurity

@tojocky
Copy link
Owner

tojocky commented Jul 1, 2013

Thanks for Pull request

@tojocky tojocky closed this as completed Jul 1, 2013
@nodesecurity
Copy link
Author

Sorry for the double email, I miscommunicated to the node security
project team.

Ion wrote:

Thanks for Pull request


Reply to this email directly or view it on GitHub
#1 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant