---
id: "CVE-2024-35374"
page: "https://infrastack.ai/live/CVE-2024-35374"
kind: "vulnerability"
aliases: ["CVE-2024-35374", "GHSA-j6cv-98jx-mrwr"]
title: "Mocodo vulnerable to SQL injection in `/web/generate.php`"
severity: "critical"
cvss: 9.8
epss: 0.02767
exploited: false
status: "open"
category: "package"
products: [{"name": "mocodo", "fixed": ["4.2.7"], "affected": "<= 4.2.6", "ecosystem": "pypi"}, {"name": "mocodo online", "fixed": [], "affected": "<= 4.2.6", "ecosystem": "vendor"}]
ecosystems: ["pypi", "vendor"]
tags: ["cwe-89", "mocodo", "package", "python", "self-hosted"]
not_affected_if: ["no-web-endpoint"]
published_at: "2024-05-24T21:15:59+00:00"
first_seen_at: "2026-11-16T15:37:42+00:00"
updated_at: "2026-11-16T16:08:50+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-j6cv-98jx-mrwr", "first_seen_at": "2026-11-16T15:37:42+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-35374", "first_seen_at": "2026-11-16T16:08:50+00:00"}]
exploit_sources: [{"type": "poc", "url": "https://chocapikk.com/posts/2024/mocodo-vulnerabilities/"}, {"type": "epss", "score": 0.02767, "url": "https://api.first.org/data/v1/epss?cve=CVE-2024-35374"}]
---

# Mocodo vulnerable to SQL injection in `/web/generate.php`

Link for people: https://infrastack.ai/live/CVE-2024-35374 (this .md is for agents)

Mocodo's online generator at /web/generate.php does not sanitize the sql_case input, so a remote attacker can inject SQL. The sources say this can lead to command injection and remote code execution under certain conditions.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- pypi:mocodo affected <= 4.2.6 fixed 4.2.7
- vendor:mocodo online affected <= 4.2.6 fixed no fixed version listed

## How to check

- Check the installed version with `pip show mocodo` and look for versions at or below `4.2.6`.
- Check whether the Mocodo web app (web/generate.php) is deployed and reachable from the internet.

## Fix

- Upgrade `mocodo` (PyPI) to `4.2.7`.

## Timeline

- 2026-11-16T15:37:42+00:00 ghsa https://github.com/advisories/GHSA-j6cv-98jx-mrwr
- 2026-11-16T16:08:50+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2024-35374

## Documents

- [fix] Patch: github.com https://github.com/laowantong/mocodo/commit/f9368df28518b6c4a92fd207c260f1978ec34d6e
- [poc] Exploit: chocapikk.com https://chocapikk.com/posts/2024/mocodo-vulnerabilities/

## From the sources

Mocodo Mocodo Online 4.2.6 and below does not properly sanitize the `sql_case` input field in `/web/generate.php`, allowing remote attackers to execute arbitrary SQL commands and potentially command injection, leading to remote code execution (RCE) under certain conditions.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
