Vulnerabilities in pkg:npm/yui
PACKAGECVE-2013-4942 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 2.2.11, 2.3.8, 2.4.5, 2.5.1.
pkg:npm/yui
Vulnerability advisories affecting package pkg:npm/yui. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-9ww8-j8j2-3788 | CVE-2013-4942 | MODERATE | YUI Cross-site Scripting (XSS) vulnerability |
| GHSA-64r3-582j-frqm | CVE-2013-4941 | MODERATE | YUI Cross-site Scripting (XSS) vulnerability |
| GHSA-x5hj-47vv-53p8 | CVE-2013-4940 | MODERATE | YUI Cross-site Scripting (XSS) vulnerability |
| GHSA-mj87-8xf8-fp4w | CVE-2013-4939 | MODERATE | Cross-Site Scripting in yui |
CVE-2013-4942 at a Glance
How to Fix CVE-2013-4942
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.
npm install yui@Latest secure release
Upgrade moodle/moodle to 2.2.11
Upgrade moodle/moodle to 2.3.8
Upgrade moodle/moodle to 2.4.5
Upgrade moodle/moodle to 2.5.1
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-4942, 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 2.2.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
CVE-2013-4942 Affected Yui Versions
5 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
yui
|
npm |
≥ 3.2.0
≤ 3.9.1
|
|
|
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-4942?
Which Yui versions are affected?
What version fixes CVE-2013-4942?
Is yui affected?
Is moodle/moodle affected?
What CWE is associated with CVE-2013-4942?
How can I check npm dependencies for CVE-2013-4942?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-9ww8-j8j2-3788",
"modified" : "2025-04-12T03:26:53Z",
"published" : "2022-05-13T01:12:55Z",
"aliases" : [ "CVE-2013-4942" ],
"summary" : "YUI Cross-site Scripting (XSS) vulnerability",
"details" : "Cross-site scripting (XSS) vulnerability in flashuploader.swf in the Uploader component in Yahoo! YUI 3.5.0 through 3.9.1, 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.",
"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.2.0"
}, {
"last_affected" : "3.9.1"
} ]
} ]
}, {
"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-4942"
}, {
"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:26:53Z",
"nvd_published_at" : "2013-07-29T13:59:00Z"
}
}