
PoC for CVE-2024-21513
PoC for CVE-2024-21513 Original exploit documented by Snyk Security Research
CVE-2024-21513 is a vulnerability in langchain-experimental where unvalidated SQL query results were passed to Python's eval(), enabling remote code execution through SQL-based input injection.
This PoC is a very basic Flask App with inline HTML where users can enter coordinates into a SQLite DB.
If a user enters a malicious payload in the y value, a vulnerable LangChain-Experimental feature will fetch the y value based on the x value and pass the result to eval() which causes it to be executed.
This PoC has a hard-coded LLM that returns the SQL query for finding where x = 10.
.
├── Dockerfile
├── README.md
├── app
│ ├── db.py
│ ├── exploit.db
│ ├── llm.py
│ ├── main.py
│ └── requirements.txt
└── docker-compose.yml
This exploit is containerized so that it doesn't impact anything on your actual dev environment.
I assume that you have Docker and/or Docker Compose already installed (ensure that WSL2 config is on in Docker if you are using WSL)
git clone https://github.com/nskath/CVE-2024-21513cd CVE-2024-21513docker-compose up --buildlocalhost:5000 (127.0.0.1:5000)https://github.com/user-attachments/assets/7ad27115-411a-467f-b649-2b3508b6f5df