-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Description
Consider the following code:
var dnsSync = require('dns-sync');
console.log(dnsSync.resolve('$(id > /tmp/foo)'));
The library is loaded. The function resolve
is called, which contains this code:
// ..
cmd = util.format('"%s" "%s" %s', nodeBinary, scriptPath, hostname);
// ...
response = shell.exec(cmd, {silent: true});
So the end result is a call to a command like:
"/opt/node/bin/node" "/path/to/dns-lookup-script" "$(id > /tmp/foo)'"
The shell expands that, by executing "/usr/bin/id > /tmp/foo
" - et voila arbitrary command execution, triggered by a DNS lookup.
Metadata
Metadata
Assignees
Labels
No labels