# CVE-2014-6393: No Charset in Content-Type Header in express

> Remote attackers can execute cross-site scripting attacks via non-standard encoding in Express framework error responses due to missing charset headers.

- **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
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 9 Aug 2017
- **Updated:** 6 Aug 2024
- **Also known as:** DEBIAN-CVE-2014-6393, GHSA-gpvr-g6gh-9mc2, UBUNTU-CVE-2014-6393

## What is CVE-2014-6393?

CVE-2014-6393 is a medium-severity cross-site scripting vulnerability in n/a, published on 9 Aug 2017. 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

The Express web framework before 3.11 and 4.x before 4.5 for Node.js does not provide a charset field in HTTP Content-Type headers in 400 level responses, which might allow remote attackers to conduct cross-site scripting (XSS) attacks via characters in a non-standard encoding.

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

## Which versions are affected by CVE-2014-6393?

4 open source packages ship an affected version, including express. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `express` | npm | All versions | 3.11.0 |
| `express` | npm | All versions | 3.11.0 |
| `express` | npm | From 4.0.0 | 4.5.0 |
| `express` | npm | From 4.0.0 | 4.5.0 |

Products: Openjsf Express.

## How do I fix CVE-2014-6393?

Upgrade express to a fixed version for your release line: 3.11.0 or 4.5.0.

## Is CVE-2014-6393 being exploited?

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

## Other vulnerabilities in n/a

- [CVE-2024-29041](https://insights.sbomify.com/CVE-2024-29041/): Express.js Open Redirect in malformed URLs (medium 6.1)
- [CVE-2024-43796](https://insights.sbomify.com/CVE-2024-43796/): express vulnerable to XSS via response.redirect() (medium 5.0)
- [CVE-2024-10491](https://insights.sbomify.com/CVE-2024-10491/): Preload arbitrary resources by injecting additional `Link` headers (medium 4.0)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2014-6393 and fix it if it is affected.

What it is: CVE-2014-6393 is a medium-severity cross-site scripting vulnerability in n/a, published on 9 Aug 2017. 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-2014-6393 in the wild and no public exploit code.

Affected packages and fixed versions:
- express (npm): affected all versions; fixed in 3.11.0
- express (npm): affected all versions; fixed in 3.11.0
- express (npm): affected from 4.0.0; fixed in 4.5.0
- express (npm): affected from 4.0.0; fixed in 4.5.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-2014-6393/ (Markdown: https://insights.sbomify.com/CVE-2014-6393/index.md)
```

## Sources

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

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