# CVE-2012-6708: Cross-Site Scripting in jquery


- **Severity:** Medium 6.1 (`CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Fix available:** Yes
- **Published:** 18 Jan 2018
- **Updated:** 6 Aug 2024
- **Also known as:** ALPINE-CVE-2012-6708, AZL-40951, AZL-43897, AZL-44730, AZL-44937, CLSA-2026-1777336744, CVE-2017-16011, GHSA-2pqj-h3vj-pqgw, UBUNTU-CVE-2012-6708

## What is CVE-2012-6708?

CVE-2012-6708 is a medium-severity vulnerability in n/a, published on 18 Jan 2018. 

### Official description

jQuery before 1.9.0 is vulnerable to Cross-site Scripting (XSS) attacks. The jQuery(strInput) function does not differentiate selectors from HTML in a reliable fashion. In vulnerable versions, jQuery determined whether the input was HTML by looking for the '<' character anywhere in the string, giving attackers more flexibility when attempting to construct a malicious payload. In fixed versions, jQuery only deems the input to be HTML if it explicitly starts with the '<' character, limiting exploitability only to attackers who can control the beginning of a string, which is far less common.

Weakness: CWE-79 (Improper Neutralization of Input During Web Page Generation)

## Which versions are affected by CVE-2012-6708?

8 open source packages ship an affected version, including org.webjars.npm:jquery, jQuery and jquery-rails. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.webjars.npm:jquery` | Maven | All versions | 1.9.0 |
| `org.webjars.npm:jquery` | Maven | All versions | 1.9.0 |
| `jQuery` | NuGet | All versions | 1.9.0 |
| `jQuery` | NuGet | All versions | 1.9.0 |
| `jquery-rails` | RubyGems | All versions | 2.2.0 |
| `jquery-rails` | RubyGems | All versions | 2.2.0 |
| `jquery` | npm | All versions | 1.9.0 |
| `jquery` | npm | All versions | 1.9.0 |

Products: Jquery Jquery.

## How do I fix CVE-2012-6708?

Upgrade org.webjars.npm:jquery to 1.9.0 or later.

## Is CVE-2012-6708 being exploited?

There is no known exploitation of CVE-2012-6708 in the wild and no public exploit code.

Public exploit code:

- Linksys EA7500 2.0.8.194281 - Cross-Site Scripting (exploitdb)

## Other vulnerabilities in n/a

- [CVE-2016-10707](https://insights.sbomify.com/CVE-2016-10707/): Denial of Service in jquery (high 7.5)
- [CVE-2020-7656](https://insights.sbomify.com/CVE-2020-7656/): Cross-Site Scripting in jquery (medium 6.1)
- [CVE-2018-18405](https://insights.sbomify.com/CVE-2018-18405/): Cross-site scripting in n/a (medium 6.1)
- [CVE-2015-9251](https://insights.sbomify.com/CVE-2015-9251/): Cross-Site Scripting (XSS) in jquery (medium 6.1)
- [CVE-2014-6071](https://insights.sbomify.com/CVE-2014-6071/): Cross-site scripting in n/a (medium 6.1)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2012-6708 and fix it if it is affected.

What it is: CVE-2012-6708 is a medium-severity vulnerability in n/a, published on 18 Jan 2018. 
Exploitation: There is no known exploitation of CVE-2012-6708 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.webjars.npm:jquery (Maven): affected all versions; fixed in 1.9.0
- org.webjars.npm:jquery (Maven): affected all versions; fixed in 1.9.0
- jQuery (NuGet): affected all versions; fixed in 1.9.0
- jQuery (NuGet): affected all versions; fixed in 1.9.0
- jquery-rails (RubyGems): affected all versions; fixed in 2.2.0
- jquery-rails (RubyGems): affected all versions; fixed in 2.2.0
- jquery (npm): affected all versions; fixed in 1.9.0
- jquery (npm): affected all versions; fixed in 1.9.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2012-6708/ (Markdown: https://insights.sbomify.com/CVE-2012-6708/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2012-6708
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2012-6708
- OSV: https://osv.dev/vulnerability/CVE-2012-6708

---
From sbomify Insights: https://insights.sbomify.com/CVE-2012-6708/
Summaries are generated and may contain mistakes; the official description above is the record.
