Miggo Logo

CVE-2012-6708:
jQuery HTML Selector Cross-Site Scripting Vulnerability

6.1

CVSS Score

Basic Information

EPSS Score
-
Published
9/1/2020
Updated
7/10/2023
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
jquerynpm<= 1.8.31.9.0
org.webjars.npm:jquerymaven<= 1.8.31.9.0
jQuerynuget<= 1.8.31.9.0
jquery-railsrubygems< 2.2.02.2.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The core vulnerability stems from how jQuery's main constructor differentiates HTML from selectors. The commit diff shows the critical change was modifying the rquickExpr regex in src/core.js to require HTML strings to start with '<'. The original regex matched HTML patterns anywhere in the input string, which could be exploited when processing attacker-controlled selector strings containing HTML-like attributes. The proof of concept demonstrates this by using an attribute selector containing XSS payload, which gets interpreted as HTML due to the flawed regex matching.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

*****t** v*rsions o* `jqu*ry` *r* vuln*r**l* to *ross-sit* s*riptin*. T*is o**urs ****us* t** m*in `jqu*ry` *un*tion us*s * r**ul*r *xpr*ssion to *i***r*nti*t* **tw**n *TML *n* s*l**tors, *ut *o*s not prop*rly *n**or t** r**ul*r *xpr*ssion. T** r*sul

Reasoning

T** *or* vuln*r**ility st*ms *rom *ow jQu*ry's m*in *onstru*tor *i***r*nti*t*s *TML *rom s*l**tors. T** *ommit *i** s*ows t** *riti**l ***n** w*s mo*i*yin* t** rqui*k*xpr r***x in sr*/*or*.js to r*quir* *TML strin*s to st*rt wit* '<'. T** ori*in*l r*