# CVE-2024-39309: ZDI-CAN-23894: Parse Server literalizeRegexPart SQL Injection Authentication Bypass Vulnerability

> SQL injection in Parse Server with PostgreSQL allows attackers to read or modify data, requiring an upgrade to patched versions.

- **Severity:** Critical 9.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 1 Jul 2024
- **Updated:** 2 Aug 2024
- **Also known as:** BIT-parse-2024-39309, GHSA-c2hr-cqg6-8j6r

## What is CVE-2024-39309?

CVE-2024-39309 is a critical SQL injection vulnerability in parse-community parse-server, published on 1 Jul 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Parse Server is an open source backend that can be deployed to any infrastructure that can run Node.js. A vulnerability in versions prior to 6.5.7 and 7.1.0 allows SQL injection when Parse Server is configured to use the PostgreSQL database. The algorithm to detect SQL injection has been improved in versions 6.5.7 and 7.1.0. No known workarounds are available.

Weakness: CWE-89 (Improper Neutralization of Special Elements used in an SQL Command), CWE-288 (Authentication Bypass Using an Alternate Path or Channel)

## Which versions are affected by CVE-2024-39309?

5 open source packages ship an affected version, including parse-server and parse.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `parse-server` | npm | All versions | 6.5.7 |
| `parse-server` | npm | All versions | 6.5.7 |
| `parse-server` | npm | From 7.0.0 | 7.1.0 |
| `parse-server` | npm | From 7.0.0 | 7.1.0 |
| `parse` | Bitnami | All versions | 7.2.0 |

## How do I fix CVE-2024-39309?

Upgrade parse-server to a fixed version for your release line: 6.5.7 or 7.1.0.

## Is CVE-2024-39309 being exploited?

There is no known exploitation of CVE-2024-39309 in the wild and no public exploit code.

Public exploit code:

- Advanced PostgreSQL database enumeration tool exploiting CVE-2024-39309 in Parse Server - Comprehensive SQL injection exploitation for security research (github_poc): https://github.com/HeavyGhost-le/POC_SQL_injection_in_Parse_Server_prior_6.5.7_-_7.1.0

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-39309 and fix it if it is affected.

What it is: CVE-2024-39309 is a critical SQL injection vulnerability in parse-community parse-server, published on 1 Jul 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-39309 in the wild and no public exploit code.

Affected packages and fixed versions:
- parse-server (npm): affected all versions; fixed in 6.5.7
- parse-server (npm): affected all versions; fixed in 6.5.7
- parse-server (npm): affected from 7.0.0; fixed in 7.1.0
- parse-server (npm): affected from 7.0.0; fixed in 7.1.0
- parse (Bitnami): affected all versions; fixed in 7.2.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-39309/ (Markdown: https://insights.sbomify.com/CVE-2024-39309/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-39309
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-39309
- OSV: https://osv.dev/vulnerability/CVE-2024-39309

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-39309/
Summaries are generated and may contain mistakes; the official description above is the record.
