CVE-2024-27298: ZDI-CAN-19105 SQL Injection Vulnerability

CRITICAL
Advisory Identifier: GHSA-6927-3vr9-fxf2
CVSS 10.0
CWE-89
Published
Advisory Summary

CVE-2024-27298 is a CRITICAL (CVSS 10.0) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting ZDI-CAN-19105 libraries in the npm ecosystem. The issue involves parse server literalizeregexpart sql injection. Remediation is available by upgrading affected packages to version 6.5.0, 7.0.0-alpha.20.

CVE-2024-27298 at a Glance

CVE Identifier CVE-2024-27298
GHSA Identifier GHSA-6927-3vr9-fxf2
Severity CRITICAL
CVSS v3.1 Base Score 10.0
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product ZDI-CAN-19105
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 10.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2024-27298

To remediate this vulnerability, upgrade all affected ZDI-CAN-19105 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

parse-server fixed: 6.5.0
npm install parse-server@6.5.0
parse-server fixed: 7.0.0-alpha.20
npm install parse-server@7.0.0-alpha.20
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls parse-server

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2024-27298, inspect your project dependencies using npm:

npm ls parse-server

Analyze the terminal output to locate any version of ZDI-CAN-19105 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.5.0), your application is affected.

Note: The npm ls parse-server command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In ZDI-CAN-19105, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact This vulnerability allows SQL injection when Parse Server is configured to use the PostgreSQL database. ### Patches The algorithm to detect SQL injection has been improved. ### Workarounds None. ### References - https://github.com/parse-community/parse-server/security/advisories/GHSA-6927-3vr9-fxf2 - https://github.com/parse-community/parse-server/releases/tag/6.5.0 (fixed in Parse Server 6) - https://github.com/parse-community/parse-server/releases/tag/7.0.0-alpha.20 (fixed in Parse Server 7 alpha release) ### Credits - Mikhail Shcherbakov (https://twitter.com/yu5k3) working with Trend Micro Zero Day Initiative (finder) - Ehsan Persania (remediation developer) - Manuel Trezza (coordinator)

CVE-2024-27298 Affected ZDI-CAN-19105 Versions

2 component(s)
Fixed Versions:
6.5.07.0.0-alpha.20
Product / Package Ecosystem Affected Versions Fixed Version
parse-server
npm
< 6.5.0
6.5.0
parse-server
npm
≥ 7.0.0-alpha.1
< 7.0.0-alpha.20
7.0.0-alpha.20

References

Frequently Asked Questions

What is CVE-2024-27298?
CVE-2024-27298 is a security vulnerability in ZDI-CAN-19105 involving Parse Server literalizeRegexPart SQL Injection under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which ZDI-CAN-19105 versions are affected?
Affected versions include releases prior to 6.5.0, 7.0.0-alpha.20 across affected packages: parse-server.
What version fixes CVE-2024-27298?
Upgrading to 6.5.0, 7.0.0-alpha.20 (or the latest patched release for your respective branch) resolves the vulnerability.
Is parse-server affected?
Yes, parse-server is affected in releases prior to 6.5.0, 7.0.0-alpha.20. Upgrade your dependency to 6.5.0, 7.0.0-alpha.20 or later.
What is the CVSS score of CVE-2024-27298?
CVE-2024-27298 has a CVSS v3.1 base score of 10.0 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N.
What CWE is associated with CVE-2024-27298?
CVE-2024-27298 is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.).
How can I check npm dependencies for CVE-2024-27298?
Run the dependency tree command: 'npm ls parse-server'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-6927-3vr9-fxf2",
  "modified" : "2024-03-01T20:08:23Z",
  "published" : "2024-03-01T20:08:23Z",
  "aliases" : [ "CVE-2024-27298" ],
  "summary" : "ZDI-CAN-19105: Parse Server literalizeRegexPart SQL Injection",
  "details" : "### Impact\n\nThis vulnerability allows SQL injection when Parse Server is configured to use the PostgreSQL database.\n\n### Patches\n\nThe algorithm to detect SQL injection has been improved.\n\n### Workarounds\n\nNone.\n\n### References\n\n- https://github.com/parse-community/parse-server/security/advisories/GHSA-6927-3vr9-fxf2\n- https://github.com/parse-community/parse-server/releases/tag/6.5.0 (fixed in Parse Server 6)\n- https://github.com/parse-community/parse-server/releases/tag/7.0.0-alpha.20 (fixed in Parse Server 7 alpha release)\n\n### Credits\n\n- Mikhail Shcherbakov (https://twitter.com/yu5k3) working with Trend Micro Zero Day Initiative (finder)\n- Ehsan Persania (remediation developer)\n- Manuel Trezza (coordinator)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "parse-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.5.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "parse-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0-alpha.1"
      }, {
        "fixed" : "7.0.0-alpha.20"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/parse-community/parse-server/security/advisories/GHSA-6927-3vr9-fxf2"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-27298"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/parse-community/parse-server/commit/a6e654943536932904a69b51e513507fcf90a504"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/parse-community/parse-server/commit/cbefe770a7260b54748a058b8a7389937dc35833"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/parse-community/parse-server"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/parse-community/parse-server/releases/tag/6.5.0"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/parse-community/parse-server/releases/tag/7.0.0-alpha.20"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-03-01T20:08:23Z",
    "nvd_published_at" : "2024-03-01T18:15:28Z"
  }
}