GithubHelp home page GithubHelp logo

node-unrar's Introduction

node-unrar NPM version Dependency Status

Unrar wrapper for Node-js.

node-unrar

Created to unrar archives using unrar library.

Installation

npm install node-unrar

You must install unrar from rarlab website and put it in your PATH.

Example

var Unrar = require('node-unrar');

var rar = new Unrar('/path/to/file.rar');

/// Create '/path/to/dest/' before rar.extract()

rar.extract('/path/to/dest/', null, function (err) {
    //file extracted successfully.
});

TODO

Utilize a second argument as an options object for password protected rar's and other available options.

License

Apache-2.0 ยฉ

node-unrar's People

Contributors

scopsy avatar alice-em avatar meandavejustice avatar mufeedvh avatar huntr-helper avatar

Stargazers

Gajanan Rajput avatar Hijikesh Hijal avatar Chenby-26 avatar diandian avatar td3 avatar Wellington Torrejais da Silva avatar  avatar Blue Bot avatar

Watchers

James Cloos avatar Tomer Barnea avatar  avatar

node-unrar's Issues

Using the e option rather than the x option does not preserve folder structure

If you expand a RAR file which contains folders, those folders are not preserved in the final output.
Running "unrar e m.rar" at the terminal mimics this behaviour.
Running "unrar x m.rar" expands the file while preserving the folder structure, however.

Perhaps you can use your options object to allow the caller to decide whether to use "e" or "x" as the command to use with unrar?

Module creates folder as 'folder

I am passing arguments into node-unrar as instructed, and it creates an 'app folder even if it doesn't extract anything into it.

I'll try to figure out a possible solution, but I wanted to open up an issue in hopes of a resolution.

huntr.dev - Command Injection

This issue has been generated on-behalf of Mik317 (https://huntr.dev/app/users/Mik317)

Vulnerability Description

The issue occurs because a user input is formatted inside a command that will be executed without any check. The issue arises here: https://github.com/scopsy/node-unrar/blob/master/lib/index.js#L24

Steps To Reproduce:

  1. Create the following PoC file:
// poc.js
var Unrar = require('node-unrar');
var rar = new Unrar('/path/to/file.rar');
rar._execute([], '; touch HACKED;', function(){});
  1. Check there aren't files called HACKED
  2. Execute the following commands in another terminal:
npm i node-unrar # Install affected module
node poc.js #  Run the PoC
  1. Recheck the files: now HACKED has been created

Bug Bounty
We have opened up a bounty for this issue on our bug bounty platform. Want to solve this vulnerability and get rewarded ๐Ÿ’ฐ? Go to https://huntr.dev/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.