# CVE-2016-6563: D-Link DIR routers contain a stack-based buffer overflow in the HNAP Login action

> Attackers can execute arbitrary code on D-Link DIR routers by sending malformed SOAP messages to the HNAP Login action.

- **Severity:** Critical 9.8 (`CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 13 Jul 2018
- **Updated:** 6 Aug 2024
- **Also known as:** GHSA-2237-8cw9-xj7q

## What is CVE-2016-6563?

CVE-2016-6563 is a critical memory corruption vulnerability in D-Link DIR-818L(W), published on 13 Jul 2018. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Processing malformed SOAP messages when performing the HNAP Login action causes a buffer overflow in the stack in some D-Link DIR routers. The vulnerable XML fields within the SOAP body are: Action, Username, LoginPassword, and Captcha. The following products are affected: DIR-823, DIR-822, DIR-818L(W), DIR-895L, DIR-890L, DIR-885L, DIR-880L, DIR-868L, and DIR-850L.

Weakness: CWE-119 (Improper Restriction of Operations within the Bounds of a Memory Buffer), CWE-121 (Stack-based Buffer Overflow)

## Which versions are affected by CVE-2016-6563?

It affects 9 products.


Products: Dlink Dir-818l\(w\) Firmware, Dlink Dir-822 Firmware, Dlink Dir-823 Firmware, Dlink Dir-850l Firmware, Dlink Dir-868l Firmware, Dlink Dir-880l Firmware, Dlink Dir-885l Firmware, Dlink Dir-890l Firmware, Dlink Dir-895l Firmware.

## How do I fix CVE-2016-6563?

No fix has been published for CVE-2016-6563 yet. Limit exposure of the affected software until one is available.

## Is CVE-2016-6563 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2016-6563 exists.

Public exploit code:

- Dlink DIR Routers Unauthenticated HNAP Login Stack Buffer Overflow (metasploit)
- D-Link DIR-Series Routers - HNAP Login Stack Buffer Overflow (Metasploit) (exploitdb)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2016-6563 and fix it if it is affected.

What it is: CVE-2016-6563 is a critical memory corruption vulnerability in D-Link DIR-818L(W), published on 13 Jul 2018. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2016-6563 exists.

Affected product: D-Link DIR-818L(W). No package-level version data is available, so check the vendor advisory linked from the reference page.

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

## Sources

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

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