Arbitrary Command Injection Affecting dns-sync package, versions <0.1.3


0.0
medium

Snyk CVSS

    Attack Complexity Low

    Threat Intelligence

    EPSS 0.25% (65th percentile)
Expand this section
NVD
9.8 critical

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

How to fix?

Upgrade dns-sync to version 0.1.1 or greater.

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.