CVE-2024-6783: Vue template compiler Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-g3ch-rx76-35fx
CVSS 4.2
CWE-79
Published
Advisory Summary

CVE-2024-6783 is a MODERATE (CVSS 4.2) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Vue template compiler libraries in the npm ecosystem. The issue involves vue-template-compiler vulnerable to client-side cross-site scripting (xss). Remediation is available in the latest vendor maintenance releases.

CVE-2024-6783 at a Glance

CVE Identifier CVE-2024-6783
GHSA Identifier GHSA-g3ch-rx76-35fx
Severity MODERATE
CVSS v3.1 Base Score 4.2
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Vue template compiler
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 4.2

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

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

How to Fix CVE-2024-6783

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

vue-template-compiler fixed: Latest secure release
npm install vue-template-compiler@Latest secure release
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 vue-template-compiler

How to Check if You Are Affected

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

npm ls vue-template-compiler

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

Note: The npm ls vue-template-compiler 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 Vue template compiler, 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

A vulnerability has been discovered in vue-template-compiler, that allows an attacker to perform XSS via prototype pollution. The attacker could change the prototype chain of some properties such as `Object.prototype.staticClass` or `Object.prototype.staticStyle` to execute arbitrary JavaScript code. Vue 2 has reached End-of-Life. This vulnerability has been patched in Vue 3.

CVE-2024-6783 Affected Vue template compiler Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
vue-template-compiler
npm
≥ 2.0.0

References

Frequently Asked Questions

What is CVE-2024-6783?
CVE-2024-6783 is a security vulnerability in Vue template compiler involving vue-template-compiler vulnerable to client-side Cross-Site Scripting (XSS) under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Vue template compiler versions are affected?
Affected versions include releases prior to current release patches across affected packages: vue-template-compiler.
What version fixes CVE-2024-6783?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is vue-template-compiler affected?
Yes, vue-template-compiler is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2024-6783?
CVE-2024-6783 has a CVSS v3.1 base score of 4.2 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2024-6783?
CVE-2024-6783 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-2024-6783?
Run the dependency tree command: 'npm ls vue-template-compiler'. 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-g3ch-rx76-35fx",
  "modified" : "2025-12-31T22:04:13Z",
  "published" : "2024-07-23T15:31:09Z",
  "aliases" : [ "CVE-2024-6783" ],
  "summary" : "vue-template-compiler vulnerable to client-side Cross-Site Scripting (XSS)",
  "details" : "A vulnerability has been discovered in vue-template-compiler, that allows an attacker to perform XSS via prototype pollution. The attacker could change the prototype chain of some properties such as `Object.prototype.staticClass` or `Object.prototype.staticStyle` to execute arbitrary JavaScript code. Vue 2 has reached End-of-Life. This vulnerability has been patched in Vue 3.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "vue-template-compiler"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "< 3.0.0"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-6783"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/vuejs/vue"
  }, {
    "type" : "WEB",
    "url" : "https://www.herodevs.com/vulnerability-directory/cve-2024-6783"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-07-23T16:26:53Z",
    "nvd_published_at" : "2024-07-23T15:15:06Z"
  }
}