CVE-2023-50718: Nocodb SQL Injection Vulnerability

MODERATE
Advisory Identifier: GHSA-8fxg-mr34-jqr8
CVSS 6.5
CWE-89
Published
Advisory Summary

CVE-2023-50718 is a MODERATE (CVSS 6.5) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Nocodb libraries in the npm ecosystem. The issue involves nocodb sql injection vulnerability. Remediation is available by upgrading affected packages to version 0.202.10.

CVE-2023-50718 at a Glance

CVE Identifier CVE-2023-50718
GHSA Identifier GHSA-8fxg-mr34-jqr8
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product Nocodb
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.5

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

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

How to Fix CVE-2023-50718

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

nocodb fixed: 0.202.10
npm install nocodb@0.202.10
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 nocodb

How to Check if You Are Affected

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

npm ls nocodb

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

Note: The npm ls nocodb 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 Nocodb, 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

### Summary --- An authenticated attacker with create access could conduct a SQL Injection attack on MySQL DB using unescaped table_name. ### Details --- ### SQL Injection vulnerability occurs in **VitessClient.ts**. ```javascript async columnList(args: any = {}) { const func = this.columnList.name; const result = new Result(); log.api(`${func}:args:`, args); try { args.databaseName = this.connectionConfig.connection.database; const response = await this.sqlClient.raw( `select *, table_name as tn from information_schema.columns where table_name = '${args.tn}' ORDER by ordinal_position`, ); ``` The variable **${args.tn}** refers to the table name entered by the user. A malicious attacker can escape the existing query by including a special character (') in the table name and insert and execute a new arbitrary SQL query. ### Impact --- This vulnerability may result in leakage of sensitive data in the database.

CVE-2023-50718 Affected Nocodb Versions

1 component(s)
Fixed Versions:
0.202.10
Product / Package Ecosystem Affected Versions Fixed Version
nocodb
npm
< 0.202.10
0.202.10

References

Frequently Asked Questions

What is CVE-2023-50718?
CVE-2023-50718 is a security vulnerability in Nocodb involving NocoDB SQL Injection vulnerability under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which Nocodb versions are affected?
Affected versions include releases prior to 0.202.10 across affected packages: nocodb.
What version fixes CVE-2023-50718?
Upgrading to 0.202.10 (or the latest patched release for your respective branch) resolves the vulnerability.
Is nocodb affected?
Yes, nocodb is affected in releases prior to 0.202.10. Upgrade your dependency to 0.202.10 or later.
What is the CVSS score of CVE-2023-50718?
CVE-2023-50718 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2023-50718?
CVE-2023-50718 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-2023-50718?
Run the dependency tree command: 'npm ls nocodb'. 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-8fxg-mr34-jqr8",
  "modified" : "2025-08-21T19:16:22Z",
  "published" : "2024-05-13T16:46:59Z",
  "aliases" : [ "CVE-2023-50718" ],
  "summary" : "NocoDB SQL Injection vulnerability",
  "details" : "### Summary\n---\nAn authenticated attacker with create access could conduct a SQL Injection attack on MySQL DB using unescaped table_name.\n\n### Details\n---\n### SQL Injection vulnerability occurs in **VitessClient.ts**.\n```javascript\nasync columnList(args: any = {}) {\n    const func = this.columnList.name;\n    const result = new Result();\n    log.api(`${func}:args:`, args);\n\n    try {\n      args.databaseName = this.connectionConfig.connection.database;\n\n      const response = await this.sqlClient.raw(\n        `select *, table_name as tn from information_schema.columns where table_name = '${args.tn}' ORDER by ordinal_position`,\n      );\n```\nThe variable **${args.tn}** refers to the table name entered by the user.\nA malicious attacker can escape the existing query by including a special character (') in the table name and insert and execute a new arbitrary SQL query.\n\n### Impact\n---\nThis vulnerability may result in leakage of sensitive data in the database.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "nocodb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.202.10"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.202.9"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nocodb/nocodb/security/advisories/GHSA-8fxg-mr34-jqr8"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-50718"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nocodb/nocodb"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-13T16:46:59Z",
    "nvd_published_at" : "2024-05-14T14:17:02Z"
  }
}