# CVE-2017-0247: ASP.NET Core fails to properly validate web requests

> Remote attackers can cause a denial of service in ASP.NET Core applications by exploiting improper validation of Unicode characters in web requests.

- **Severity:** High 7.5 (`CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 12 May 2017
- **Updated:** 5 Aug 2024
- **Also known as:** ECHO-bc40-6686-bc02, GHSA-6xh7-4v2w-36q6

## What is CVE-2017-0247?

CVE-2017-0247 is a high-severity denial of service vulnerability in Microsoft Corporation ASP.NET Core, published on 12 May 2017. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

A denial of service vulnerability exists when the ASP.NET Core fails to properly validate web requests. NOTE: Microsoft has not commented on third-party claims that the issue is that the TextEncoder.EncodeCore function in the System.Text.Encodings.Web package in ASP.NET Core Mvc before 1.0.4 and 1.1.x before 1.1.3 allows remote attackers to cause a denial of service by leveraging failure to properly calculate the length of 4-byte characters in the Unicode Non-Character range.

Weakness: CWE-20 (Improper Input Validation)

## Which versions are affected by CVE-2017-0247?

40 open source packages ship an affected version, including Microsoft.AspNetCore.Mvc, Microsoft.AspNetCore.Mvc.Abstractions and Microsoft.AspNetCore.Mvc.ApiExplorer. It affects 18 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `Microsoft.AspNetCore.Mvc` | NuGet | From 1.0.0 | 1.0.4 |
| `Microsoft.AspNetCore.Mvc` | NuGet | From 1.0.0 | 1.0.4 |
| `Microsoft.AspNetCore.Mvc` | NuGet | From 1.1.0 | 1.1.3 |
| `Microsoft.AspNetCore.Mvc` | NuGet | From 1.1.0 | 1.1.3 |
| `Microsoft.AspNetCore.Mvc.Abstractions` | NuGet | From 1.0.0 | 1.0.4 |
| `Microsoft.AspNetCore.Mvc.Abstractions` | NuGet | From 1.0.0 | 1.0.4 |
| `Microsoft.AspNetCore.Mvc.Abstractions` | NuGet | From 1.1.0 | 1.1.3 |
| `Microsoft.AspNetCore.Mvc.Abstractions` | NuGet | From 1.1.0 | 1.1.3 |
| `Microsoft.AspNetCore.Mvc.ApiExplorer` | NuGet | From 1.0.0 | 1.0.4 |
| `Microsoft.AspNetCore.Mvc.ApiExplorer` | NuGet | From 1.0.0 | 1.0.4 |
| `Microsoft.AspNetCore.Mvc.ApiExplorer` | NuGet | From 1.1.0 | 1.1.3 |
| `Microsoft.AspNetCore.Mvc.ApiExplorer` | NuGet | From 1.1.0 | 1.1.3 |
| `Microsoft.AspNetCore.Mvc.Core` | NuGet | From 1.0.0 | 1.0.4 |
| `Microsoft.AspNetCore.Mvc.Core` | NuGet | From 1.0.0 | 1.0.4 |
| `Microsoft.AspNetCore.Mvc.Core` | NuGet | From 1.1.0 | 1.1.3 |
| `Microsoft.AspNetCore.Mvc.Core` | NuGet | From 1.1.0 | 1.1.3 |
| `Microsoft.AspNetCore.Mvc.Cors` | NuGet | From 1.0.0 | 1.0.4 |
| `Microsoft.AspNetCore.Mvc.Cors` | NuGet | From 1.0.0 | 1.0.4 |
| `Microsoft.AspNetCore.Mvc.Cors` | NuGet | From 1.1.0 | 1.1.3 |
| `Microsoft.AspNetCore.Mvc.Cors` | NuGet | From 1.1.0 | 1.1.3 |
| `Microsoft.AspNetCore.Mvc.DataAnnotations` | NuGet | From 1.0.0 | 1.0.4 |
| `Microsoft.AspNetCore.Mvc.DataAnnotations` | NuGet | From 1.0.0 | 1.0.4 |
| `Microsoft.AspNetCore.Mvc.DataAnnotations` | NuGet | From 1.1.0 | 1.1.3 |
| `Microsoft.AspNetCore.Mvc.DataAnnotations` | NuGet | From 1.1.0 | 1.1.3 |
| `Microsoft.AspNetCore.Mvc.Formatters.Json` | NuGet | From 1.0.0 | 1.0.4 |
| `Microsoft.AspNetCore.Mvc.Formatters.Json` | NuGet | From 1.0.0 | 1.0.4 |
| `Microsoft.AspNetCore.Mvc.Formatters.Json` | NuGet | From 1.1.0 | 1.1.3 |
| `Microsoft.AspNetCore.Mvc.Formatters.Json` | NuGet | From 1.1.0 | 1.1.3 |
| `Microsoft.AspNetCore.Mvc.Formatters.Xml` | NuGet | From 1.0.0 | 1.0.4 |
| `Microsoft.AspNetCore.Mvc.Formatters.Xml` | NuGet | From 1.0.0 | 1.0.4 |
| `Microsoft.AspNetCore.Mvc.Formatters.Xml` | NuGet | From 1.1.0 | 1.1.3 |
| `Microsoft.AspNetCore.Mvc.Formatters.Xml` | NuGet | From 1.1.0 | 1.1.3 |
| `Microsoft.AspNetCore.Mvc.Localization` | NuGet | From 1.0.0 | 1.0.4 |
| `Microsoft.AspNetCore.Mvc.Localization` | NuGet | From 1.0.0 | 1.0.4 |
| `Microsoft.AspNetCore.Mvc.Localization` | NuGet | From 1.1.0 | 1.1.3 |
| `Microsoft.AspNetCore.Mvc.Localization` | NuGet | From 1.1.0 | 1.1.3 |
| `Microsoft.AspNetCore.Mvc.Razor` | NuGet | From 1.0.0 | 1.0.4 |
| `Microsoft.AspNetCore.Mvc.Razor` | NuGet | From 1.0.0 | 1.0.4 |
| `Microsoft.AspNetCore.Mvc.Razor` | NuGet | From 1.1.0 | 1.1.3 |
| `Microsoft.AspNetCore.Mvc.Razor` | NuGet | From 1.1.0 | 1.1.3 |

Products: Microsoft Asp.net Model View Controller, Microsoft Microsoft.aspnetcore.mvc.abstractions, Microsoft Microsoft.aspnetcore.mvc.apiexplorer, Microsoft Microsoft.aspnetcore.mvc.cors, Microsoft Microsoft.aspnetcore.mvc.dataannotations, Microsoft Microsoft.aspnetcore.mvc.formatters.json, Microsoft Microsoft.aspnetcore.mvc.formatters.xml, Microsoft Microsoft.aspnetcore.mvc.localization, Microsoft Microsoft.aspnetcore.mvc.razor, Microsoft Microsoft.aspnetcore.mvc.razor.host, Microsoft Microsoft.aspnetcore.mvc.taghelpers, Microsoft Microsoft.aspnetcore.mvc.viewfeatures, Microsoft Microsoft.aspnetcore.mvc.webapicompatshim, Microsoft System.net.http, Microsoft System.net.http.winhttphandler, Microsoft System.net.security, Microsoft System.net.websockets.client, Microsoft System.text.encodings.web.

## How do I fix CVE-2017-0247?

Upgrade Microsoft.AspNetCore.Mvc to a fixed version for your release line: 1.0.4 or 1.1.3.

## Is CVE-2017-0247 being exploited?

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

## Other vulnerabilities in Microsoft Corporation ASP.NET Core

- [CVE-2017-0249](https://insights.sbomify.com/CVE-2017-0249/): High severity vulnerability that affects Microsoft.AspNetCore.Mvc (high 7.3)
- [CVE-2017-0256](https://insights.sbomify.com/CVE-2017-0256/): Moderate severity vulnerability that affects Microsoft.AspNetCore.Mvc (medium 5.3)
- [CVE-2014-4075](https://insights.sbomify.com/CVE-2014-4075/): Cross-site scripting in n/a (medium 4.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2017-0247 and fix it if it is affected.

What it is: CVE-2017-0247 is a high-severity denial of service vulnerability in Microsoft Corporation ASP.NET Core, published on 12 May 2017. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2017-0247 in the wild and no public exploit code.

Affected packages and fixed versions:
- Microsoft.AspNetCore.Mvc (NuGet): affected from 1.0.0; fixed in 1.0.4
- Microsoft.AspNetCore.Mvc (NuGet): affected from 1.0.0; fixed in 1.0.4
- Microsoft.AspNetCore.Mvc (NuGet): affected from 1.1.0; fixed in 1.1.3
- Microsoft.AspNetCore.Mvc (NuGet): affected from 1.1.0; fixed in 1.1.3
- Microsoft.AspNetCore.Mvc.Abstractions (NuGet): affected from 1.0.0; fixed in 1.0.4
- Microsoft.AspNetCore.Mvc.Abstractions (NuGet): affected from 1.0.0; fixed in 1.0.4
- Microsoft.AspNetCore.Mvc.Abstractions (NuGet): affected from 1.1.0; fixed in 1.1.3
- Microsoft.AspNetCore.Mvc.Abstractions (NuGet): affected from 1.1.0; fixed in 1.1.3
- Microsoft.AspNetCore.Mvc.ApiExplorer (NuGet): affected from 1.0.0; fixed in 1.0.4
- Microsoft.AspNetCore.Mvc.ApiExplorer (NuGet): affected from 1.0.0; fixed in 1.0.4
- Microsoft.AspNetCore.Mvc.ApiExplorer (NuGet): affected from 1.1.0; fixed in 1.1.3
- Microsoft.AspNetCore.Mvc.ApiExplorer (NuGet): affected from 1.1.0; fixed in 1.1.3

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

## Sources

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

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