CVE-2013-4940: Yui Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-x5hj-47vv-53p8
CWE-79
Published
Advisory Summary

CVE-2013-4940 is a MODERATE cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Yui libraries in the npm ecosystem. The issue involves yui cross-site scripting (xss) vulnerability. Remediation is available by upgrading affected packages to version 3.10.11, 3.10.13, 2.2.11, 2.3.8, 2.4.5, 2.5.1.

CVE-2013-4940 at a Glance

CVE Identifier CVE-2013-4940
GHSA Identifier GHSA-x5hj-47vv-53p8
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Yui
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2013-4940

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

yui fixed: 3.10.11
npm install yui@3.10.11
yui fixed: 3.10.13
npm install yui@3.10.13
moodle/moodle fixed: 2.2.11
Upgrade moodle/moodle to 2.2.11
moodle/moodle fixed: 2.3.8
Upgrade moodle/moodle to 2.3.8
moodle/moodle fixed: 2.4.5
Upgrade moodle/moodle to 2.4.5
moodle/moodle fixed: 2.5.1
Upgrade moodle/moodle to 2.5.1
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 yui

How to Check if You Are Affected

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

npm ls yui

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

Note: The npm ls yui 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 Yui, 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

Cross-site scripting (XSS) vulnerability in io.swf in the IO Utility component in Yahoo! YUI 3.10.2, as used in Moodle through 2.1.10, 2.2.x before 2.2.11, 2.3.x before 2.3.8, 2.4.x before 2.4.5, 2.5.x before 2.5.1, and other products, allows remote attackers to inject arbitrary web script or HTML via a crafted string in a URL. NOTE: this vulnerability exists because of a CVE-2013-4939 regression.

CVE-2013-4940 Affected Yui Versions

6 component(s)
Fixed Versions:
3.10.113.10.132.2.112.3.82.4.52.5.1
Product / Package Ecosystem Affected Versions Fixed Version
yui
npm
≥ 3.0.0
< 3.10.11
3.10.11
yui
npm
≥ 3.10.12
< 3.10.13
All 1 versions
3.10.12
3.10.13
moodle/moodle
Packagist
< 2.2.11
2.2.11
moodle/moodle
Packagist
≥ 2.3.0
< 2.3.8
2.3.8
moodle/moodle
Packagist
≥ 2.4.0-rc1
< 2.4.5
2.4.5
moodle/moodle
Packagist
≥ 2.5.0-beta
< 2.5.1
2.5.1

References

Frequently Asked Questions

What is CVE-2013-4940?
CVE-2013-4940 is a security vulnerability in Yui involving YUI Cross-site Scripting (XSS) vulnerability under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Yui versions are affected?
Affected versions include releases prior to 3.10.11, 3.10.13, 2.2.11, 2.3.8, 2.4.5, 2.5.1 across affected packages: yui, moodle/moodle.
What version fixes CVE-2013-4940?
Upgrading to 3.10.11, 3.10.13, 2.2.11, 2.3.8, 2.4.5, 2.5.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is yui affected?
Yes, yui is affected in releases prior to 3.10.11, 3.10.13. Upgrade your dependency to 3.10.11, 3.10.13 or later.
Is moodle/moodle affected?
Yes, moodle/moodle is affected in releases prior to 2.2.11, 2.3.8, 2.4.5, 2.5.1. Upgrade your dependency to 2.2.11, 2.3.8, 2.4.5, 2.5.1 or later.
What CWE is associated with CVE-2013-4940?
CVE-2013-4940 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-2013-4940?
Run the dependency tree command: 'npm ls yui'. 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-x5hj-47vv-53p8",
  "modified" : "2025-04-12T03:24:28Z",
  "published" : "2022-05-13T01:12:54Z",
  "aliases" : [ "CVE-2013-4940" ],
  "summary" : "YUI Cross-site Scripting (XSS) vulnerability",
  "details" : "Cross-site scripting (XSS) vulnerability in io.swf in the IO Utility component in Yahoo! YUI 3.10.2, as used in Moodle through 2.1.10, 2.2.x before 2.2.11, 2.3.x before 2.3.8, 2.4.x before 2.4.5, 2.5.x before 2.5.1, and other products, allows remote attackers to inject arbitrary web script or HTML via a crafted string in a URL.  NOTE: this vulnerability exists because of a CVE-2013-4939 regression.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "yui"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.10.11"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.10.0"
    }
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "yui"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.10.12"
      }, {
        "fixed" : "3.10.13"
      } ]
    } ],
    "versions" : [ "3.10.12" ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "moodle/moodle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.2.11"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "moodle/moodle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.3.0"
      }, {
        "fixed" : "2.3.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "moodle/moodle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.4.0-rc1"
      }, {
        "fixed" : "2.4.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "moodle/moodle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.5.0-beta"
      }, {
        "fixed" : "2.5.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2013-4940"
  }, {
    "type" : "WEB",
    "url" : "https://moodle.org/mod/forum/discuss.php?d=232496"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20130909203912/http://yuilibrary.com/support/20130515-vulnerability"
  }, {
    "type" : "WEB",
    "url" : "http://git.moodle.org/gw?p=moodle.git&a=search&h=HEAD&st=commit&s=MDL-39678"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-04-12T03:24:28Z",
    "nvd_published_at" : "2013-07-29T13:59:00Z"
  }
}