MODERATE 6.1

CVE-2012-6708

Cross-Site Scripting in jquery

Description

Affected versions of jquery are vulnerable to cross-site scripting. This occurs because the main jquery function uses a regular expression to differentiate between HTML and selectors, but does not properly anchor the regular expression. The result is that jquery may interpret HTML as selectors when given certain inputs, allowing for client side code execution.

Proof of Concept

$("#log").html(
$("element[attribute='<img src=\"x\" onerror=\"alert(1)\" />']").html()
);

Recommendation

Update to version 1.9.0 or later.

Affected Maven artifacts (3)

ArtifactAffected versionsFixed in
org.webjars.npm » jquery
< 1.9.0
1.9.0
org.mvnpm » jqueryvia npm jquery
< 1.9.0
1.9.0
org.webjars » jqueryvia npm jquery
< 1.9.0
1.9.0
org.webjars.npm » jqueryvia npm jquery
< 1.9.0
1.9.0

Blast radius

3affected artifacts
12affected versions
141dependent artifacts (est.)
688dependent versions

58% of the dependent artifacts (82) still pull an affected version in their latest release.

DepthDependent versions
Direct
208
2 hops
244
3 hops
127
4 hops
109

Most used dependents

Computed from the dependency graph of build 20261127.1117 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.

Other ecosystems

Also affects npm (1 package) NuGet (1 package) RubyGems (1 package) . See all on OSV