# CVE-2013-4170: Ember.js Potential XSS Exploit When Binding `tagName` to User-Supplied Data

> Attackers can execute arbitrary JavaScript if applications bind user input to Ember.View tagName, requiring specific application coding practices.

- **Severity:** Medium 6.1 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 30 Jun 2022
- **Updated:** 6 Aug 2024
- **Also known as:** GHSA-5m48-c37x-f792

## What is CVE-2013-4170?

CVE-2013-4170 is a medium-severity cross-site scripting vulnerability in ember-source, published on 30 Jun 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

In general, Ember.js escapes or strips any user-supplied content before inserting it in strings that will be sent to innerHTML. However, the `tagName` property of an `Ember.View` was inserted into such a string without being sanitized. This means that if an application assigns a view's `tagName` to user-supplied data, a specially-crafted payload could execute arbitrary JavaScript in the context of the current domain ("XSS"). This vulnerability only affects applications that assign or bind user-provided content to `tagName`.

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

## Which versions are affected by CVE-2013-4170?

12 open source packages ship an affected version, including ember-source. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `ember-source` | RubyGems | All versions | 1.0.0.rc1.1 |
| `ember-source` | RubyGems | All versions | 1.0.0.rc1.1 |
| `ember-source` | RubyGems | From 1.0.0.rc2.0 | 1.0.0.rc2.1 |
| `ember-source` | RubyGems | From 1.0.0.rc2.0 | 1.0.0.rc2.1 |
| `ember-source` | RubyGems | From 1.0.0.rc3.0 | 1.0.0.rc3.1 |
| `ember-source` | RubyGems | From 1.0.0.rc3.0 | 1.0.0.rc3.1 |
| `ember-source` | RubyGems | From 1.0.0.rc4.0 | 1.0.0.rc4.1 |
| `ember-source` | RubyGems | From 1.0.0.rc4.0 | 1.0.0.rc4.1 |
| `ember-source` | RubyGems | From 1.0.0.rc5.0 | 1.0.0.rc5.1 |
| `ember-source` | RubyGems | From 1.0.0.rc5.0 | 1.0.0.rc5.1 |
| `ember-source` | RubyGems | From 1.0.0.rc6.0 | 1.0.0.rc6.1 |
| `ember-source` | RubyGems | From 1.0.0.rc6.0 | 1.0.0.rc6.1 |

Products: Emberjs Ember.js.

## How do I fix CVE-2013-4170?

Upgrade ember-source to a fixed version for your release line: 1.0.0.rc1.1, 1.0.0.rc2.1, 1.0.0.rc3.1 or 1.0.0.rc4.1.

## Is CVE-2013-4170 being exploited?

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

## Other vulnerabilities in ember-source

- [CVE-2015-1866](https://insights.sbomify.com/CVE-2015-1866/): ember-source vulnerable to Cross-site Scripting (medium 6.1)
- [CVE-2015-7565](https://insights.sbomify.com/CVE-2015-7565/): ember-source Cross-site Scripting vulnerability (medium 6.1)
- [CVE-2014-0013](https://insights.sbomify.com/CVE-2014-0013/): Ember.js Cross-site Scripting vulnerability (medium 5.4)
- [CVE-2014-0014](https://insights.sbomify.com/CVE-2014-0014/): ember-source Cross-site Scripting vulnerability (medium 5.4)
- [CVE-2014-0046](https://insights.sbomify.com/CVE-2014-0046/): ember-source Cross-site Scripting vulnerability (low 2.6)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2013-4170 and fix it if it is affected.

What it is: CVE-2013-4170 is a medium-severity cross-site scripting vulnerability in ember-source, published on 30 Jun 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2013-4170 in the wild and no public exploit code.

Affected packages and fixed versions:
- ember-source (RubyGems): affected all versions; fixed in 1.0.0.rc1.1
- ember-source (RubyGems): affected all versions; fixed in 1.0.0.rc1.1
- ember-source (RubyGems): affected from 1.0.0.rc2.0; fixed in 1.0.0.rc2.1
- ember-source (RubyGems): affected from 1.0.0.rc2.0; fixed in 1.0.0.rc2.1
- ember-source (RubyGems): affected from 1.0.0.rc3.0; fixed in 1.0.0.rc3.1
- ember-source (RubyGems): affected from 1.0.0.rc3.0; fixed in 1.0.0.rc3.1
- ember-source (RubyGems): affected from 1.0.0.rc4.0; fixed in 1.0.0.rc4.1
- ember-source (RubyGems): affected from 1.0.0.rc4.0; fixed in 1.0.0.rc4.1
- ember-source (RubyGems): affected from 1.0.0.rc5.0; fixed in 1.0.0.rc5.1
- ember-source (RubyGems): affected from 1.0.0.rc5.0; fixed in 1.0.0.rc5.1
- ember-source (RubyGems): affected from 1.0.0.rc6.0; fixed in 1.0.0.rc6.1
- ember-source (RubyGems): affected from 1.0.0.rc6.0; fixed in 1.0.0.rc6.1

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-2013-4170/ (Markdown: https://insights.sbomify.com/CVE-2013-4170/index.md)
```

## Sources

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

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