{"id":"GHSA-2pqj-h3vj-pqgw","summary":"Cross-Site Scripting in jquery","details":"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.\n\n## Proof of Concept\n```\n$(\"#log\").html(\n    $(\"element[attribute='\u003cimg src=\\\"x\\\" onerror=\\\"alert(1)\\\" /\u003e']\").html()\n);\n```\n\n\n\n\n## Recommendation\n\nUpdate to version 1.9.0 or later.","aliases":["CVE-2012-6708"],"modified":"2024-03-08T05:20:14.907785Z","published":"2020-09-01T16:41:46Z","database_specific":{"severity":"MODERATE","github_reviewed":true,"github_reviewed_at":"2020-08-31T18:19:31Z","nvd_published_at":"2018-01-18T23:29:00Z","cwe_ids":["CWE-64","CWE-79"]},"references":[{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2017-16011"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2012-6708"},{"type":"WEB","url":"https://github.com/jquery/jquery/commit/05531fc4080ae24070930d15ae0cea7ae056457d"},{"type":"WEB","url":"https://web.archive.org/web/20200227132049/http://www.securityfocus.com/bid/102792"},{"type":"WEB","url":"https://snyk.io/vuln/npm:jquery:20120206"},{"type":"WEB","url":"https://security.snyk.io/vuln/SNYK-DOTNET-JQUERY-450223"},{"type":"WEB","url":"https://research.insecurelabs.org/jquery/test"},{"type":"WEB","url":"https://lists.apache.org/thread.html/f9bc3e55f4e28d1dcd1a69aae6d53e609a758e34d2869b4d798e13cc@%3Cissues.drill.apache.org%3E"},{"type":"WEB","url":"https://lists.apache.org/thread.html/b0656d359c7d40ec9f39c8cc61bca66802ef9a2a12ee199f5b0c1442@%3Cdev.drill.apache.org%3E"},{"type":"WEB","url":"https://lists.apache.org/thread.html/519eb0fd45642dcecd9ff74cb3e71c20a4753f7d82e2f07864b5108f@%3Cdev.drill.apache.org%3E"},{"type":"WEB","url":"https://help.ecostruxureit.com/display/public/UADCE725/Security+fixes+in+StruxureWare+Data+Center+Expert+v7.6.0"},{"type":"WEB","url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/jquery-rails/CVE-2012-6708.yml"},{"type":"WEB","url":"https://github.com/rails/jquery-rails/blob/v2.2.0/vendor/assets/javascripts/jquery.js#L67"},{"type":"WEB","url":"https://github.com/rails/jquery-rails/blob/v2.1.4/vendor/assets/javascripts/jquery.js#L59"},{"type":"PACKAGE","url":"https://github.com/jquery/jquery"},{"type":"WEB","url":"https://bugs.jquery.com/ticket/9521"},{"type":"WEB","url":"https://bugs.jquery.com/ticket/6429"},{"type":"WEB","url":"https://bugs.jquery.com/ticket/12531"},{"type":"WEB","url":"https://bugs.jquery.com/ticket/11290"},{"type":"WEB","url":"http://lists.opensuse.org/opensuse-security-announce/2020-03/msg00041.html"},{"type":"WEB","url":"http://packetstormsecurity.com/files/153237/RetireJS-CORS-Issue-Script-Execution.html"},{"type":"WEB","url":"http://packetstormsecurity.com/files/161972/Linksys-EA7500-2.0.8.194281-Cross-Site-Scripting.html"}],"affected":[{"package":{"name":"jquery","ecosystem":"npm","purl":"pkg:npm/jquery"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.9.0"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2020/09/GHSA-2pqj-h3vj-pqgw/GHSA-2pqj-h3vj-pqgw.json","last_known_affected_version_range":"\u003c= 1.8.3"}},{"package":{"name":"org.webjars.npm:jquery","ecosystem":"Maven","purl":"pkg:maven/org.webjars.npm/jquery"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.9.0"}]}],"versions":["1.7.2","1.7.3","1.8.2","1.8.3"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2020/09/GHSA-2pqj-h3vj-pqgw/GHSA-2pqj-h3vj-pqgw.json","last_known_affected_version_range":"\u003c= 1.8.3"}},{"package":{"name":"jQuery","ecosystem":"NuGet","purl":"pkg:nuget/jQuery"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.9.0"}]}],"versions":["1.4.1","1.4.2","1.4.3","1.4.4","1.5.0","1.5.1","1.5.2","1.6.0","1.6.1","1.6.2","1.6.3","1.6.4","1.7.0","1.7.1","1.7.1.1","1.7.2","1.8.0","1.8.1","1.8.2","1.8.3"],"database_specific":{"last_known_affected_version_range":"\u003c= 1.8.3","source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2020/09/GHSA-2pqj-h3vj-pqgw/GHSA-2pqj-h3vj-pqgw.json"}},{"package":{"name":"jquery-rails","ecosystem":"RubyGems","purl":"pkg:gem/jquery-rails"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.2.0"}]}],"versions":["0.1.1","0.1.2","0.1.3","0.2","0.2.1","0.2.2","0.2.3","0.2.4","0.2.5","0.2.6","0.2.7","1.0","1.0.1","1.0.10","1.0.11","1.0.12","1.0.13","1.0.14","1.0.15","1.0.16","1.0.17","1.0.18","1.0.19","1.0.2","1.0.3","1.0.4","1.0.5","1.0.6","1.0.7","1.0.8","1.0.9","1.0.rc","2.0.1","2.0.2","2.0.3","2.1.0","2.1.1","2.1.2","2.1.3","2.1.4"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2020/09/GHSA-2pqj-h3vj-pqgw/GHSA-2pqj-h3vj-pqgw.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"}]}