im-metadata@1.0.1 vulnerabilities

Retrieve image metadata using ImageMagick's identify command

Direct Vulnerabilities

Known vulnerabilities in the im-metadata package. This does not include vulnerabilities belonging to this package’s dependencies.

How to fix?

Automatically find and fix vulnerabilities affecting your projects. Snyk scans for vulnerabilities and provides fixes for free.

Fix for free
VulnerabilityVulnerable Version
  • H
Command Injection

im-metadata is a package to retrieve image metadata as a JSON object using ImageMagick's identify command.

Affected versions of this package are vulnerable to Command Injection. It is possible to inject arbitrary commands as part of the metadata options which is given to the exec function.

PoC by Snyk Security Team

var metadata = require('im-metadata');

metadata('/home/snoopy/Pictures/Screenshots/foo.jpg;ls', {exif: true}, function(error, metadata) {
    if (error) { console.error(error); }
    console.log(metadata);
    console.log(metadata.exif);
  });

How to fix Command Injection?

A fix was pushed into the master branch but not yet published.

*