Arbitrary Command Injection Affecting dns-sync Open this link in a new tab package, versions <0.1.3


0.0
medium
  • Attack Complexity

    Low

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • snyk-id

    npm:dns-sync:20141111

  • published

    11 Nov 2014

  • disclosed

    11 Nov 2014

  • credit

    Steve Kemp

Overview

The dns-sync library for node.js allows resolving hostnames in a synchronous fashion. All versions of dns-sync prior to the release 0.1.3 were vulnerable to arbitrary command execution via maliciously formed hostnames.

Details

For example:

var dnsSync = require('dns-sync');
console.log(dnsSync.resolve('$(id > /tmp/foo)'));

This is caused by the hostname being passed through a shell as part of a command execution.

Remediation

Upgrade dns-sync to version 0.1.1 or greater.