CVE-2024-35374: SQL Injection Vulnerability in Mocodo

mocodo Updated 02 Oct 2025

Summary

28/05/2024
Yes i
Critical
9.8

CVE-2024-35374: Mocodo vulnerable to SQL injection in /web/generate.php. Affects mocodo versions < 4.2.7. Fixed in 4.2.7. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

Mocodo is an open-source package available on PyPI that provides a web-based interface for generating SQL schemas from textual descriptions. It is commonly used by developers and database administrators to simplify the process of creating database schemas. However, versions 4.2.6 and below of Mocodo are vulnerable to a SQL injection attack in the /web/generate.php file. This vulnerability arises due to improper sanitization of the sql_case input field, allowing remote attackers to execute arbitrary SQL commands. Exploiting this vulnerability can potentially lead to command injection and remote code execution (RCE) under certain conditions.

Vulnerability Detail

The SQL injection vulnerability in Mocodo allows an attacker to manipulate the sql_case input field in the /web/generate.php file. By injecting malicious SQL commands, an attacker can execute arbitrary code on the server. This can result in unauthorized access to sensitive data, modification or deletion of data, and even complete compromise of the affected system. The severity of this vulnerability is rated as CRITICAL with a CVSS score of 9.8.

How To Fix

Latest published version: 4.3.3 as of 23 Oct 2026

pip install --upgrade "mocodo==4.3.3"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

4.2.7

This is the first release that contains the fix.

pip install --upgrade "mocodo==4.2.7"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading to the latest version is not immediately feasible, users can implement a temporary workaround by manually sanitizing the sql_case input field in the /web/generate.php file. This can be done by using appropriate input validation and parameter binding techniques to prevent SQL injection attacks. Here is an example of how the code can be modified:

// Original vulnerable code
$sql_case = $_POST['sql_case'];

// Modified code with input validation
$sql_case = mysqli_real_escape_string($conn, $_POST['sql_case']);

Conclusion

In conclusion, Mocodo versions 4.2.6 and below are vulnerable to a critical SQL injection vulnerability in the /web/generate.php file. This vulnerability allows remote attackers to execute arbitrary SQL commands and potentially achieve remote code execution. Users are strongly advised to upgrade to version 4.2.7 or above to mitigate this vulnerability. If immediate upgrade is not possible, implementing proper input validation and parameter binding techniques can serve as a temporary workaround. For further assistance or support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for mocodo →

Share this vulnerability

FAQ

Mocodo is an open-source package that provides a web-based interface for generating SQL schemas from textual descriptions. It simplifies the process of creating database schemas and is commonly used by developers and database administrators.

Exploiting this vulnerability can lead to unauthorized access to sensitive data, modification or deletion of data, and even complete compromise of the affected system. It allows remote attackers to execute arbitrary SQL commands and potentially achieve remote code execution (RCE) under certain conditions.

To fix this vulnerability, it is recommended to upgrade to version 4.2.7 or above of Mocodo. This version includes proper sanitization of the sql_case input field, preventing SQL injection attacks. Users can update their installation by running the command pip install --upgrade mocodo.

If upgrading to the latest version is not immediately feasible, users can implement a temporary workaround by manually sanitizing the sql_case input field in the /web/generate.php file. This can be done by using appropriate input validation and parameter binding techniques to prevent SQL injection attacks.

This vulnerability is rated as CRITICAL with a CVSS score of 9.8, indicating its high severity. It is crucial to address this vulnerability promptly to prevent potential exploitation and compromise of the affected system.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Latest published version: 4.3.3 as of 23 Oct 2026

pip install --upgrade "mocodo==4.3.3"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

4.2.7

This is the first release that contains the fix.

pip install --upgrade "mocodo==4.2.7"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback