Automated Threat Modeling

Brief Summary: D-Link R18 A1 CVE-2026-138366 Unauthenticated Stack-Based Buffer Overflow in httpd GetDeviceSettings_put

A brief summary of CVE-2026-138366, an unauthenticated stack-based buffer overflow in the httpd GetDeviceSettings_put handler of the D-Link R18 A1 router running firmware 1.20.B01, including a documented public proof-of-concept and overwrite offset.

CVE Analysis

8 min read

Gaurav Sarraf
Gaurav Sarraf

2026-11-29

Brief Summary: D-Link R18 A1 CVE-2026-138366 Unauthenticated Stack-Based Buffer Overflow in httpd GetDeviceSettings_put

Introduction

A remotely reachable, unauthenticated stack-based buffer overflow in the D-Link R18 A1 router gives an attacker a precise path to control-flow hijack on an affected device, and the researcher material documents the exact return address offset. On R18 deployments running firmware 1.20.B01, the vulnerable handler is exposed with no need for a valid account, session cookie, or API token.

The D-Link R18 is an AX1800 class smart router from D-Link, a Taiwan based networking equipment manufacturer whose portfolio spans switches, wireless LAN products, residential gateways, home networking equipment, and cloud solutions. D-Link sells these products internationally across consumer, commercial, and industrial segments. That breadth is context only. The verified defect concerns the specific R18 A1 1.20.B01 firmware and is not evidence that unrelated D-Link devices share the same issue.

Technical Information

The vulnerability sits in the GetDeviceSettings_put function within the httpd component of the D-Link R18 A1 firmware 1.20.B01. It is classified as CWE-119 (improper restriction of operations within a memory buffer) and CWE-121 (stack-based buffer overflow).

Root Cause

According to the accepted VulDB submission #1075955 (reporter Legion_TL), the GetDeviceSettings handler parses XML nodes named Target and copies each node value into a fixed-size stack buffer with no length check. Because the destination buffer has a fixed size and no bounds validation is applied, an oversized Target value overruns the buffer and corrupts adjacent saved control data on the stack.

Control of Execution

The submission reports two confirmed details that make the condition precise:

  • A Target value of roughly 128 bytes is enough to overwrite saved control data on the stack.
  • Cyclic-pattern testing placed control of the saved return address ($ra) at offset 68 from the start of the Target value.

This offset gives a concrete control-of-execution target consistent with a MIPS-style overwrite or ROP approach on the device.

Reachability Without Authentication

The firmware action table marks both GetDeviceSettings and Login as authentication-free. No valid account, session cookie, or API-CONTENT value is required to reach the vulnerable copy, so an unauthenticated remote attacker can trigger the overflow. VulDB separately confirms that this CVE requires no authentication.

Naming Limitation

The submission narrative refers to GetDeviceSettings, while the CVE and the submission's linked entry title identify GetDeviceSettings_put. The accessible repository lists a ZIP archive rather than a readable technical report, so the linked submission supports the reported unchecked copy mechanism but does not resolve every implementation detail or prove the exact offsets apply universally to the function named in the CVE. A precise request URI, network port, and HTTP method are not established in the accessible submission, and the _put suffix alone is not sufficient evidence of an HTTP PUT requirement.

Attack Flow

  1. An attacker sends a crafted HTTP request to the device's web management interface invoking the GetDeviceSettings action.
  2. The request supplies an oversized Target XML node value.
  3. The handler copies the value into a fixed-size stack buffer with no length check, overrunning the buffer.
  4. Controlled bytes placed at offset 68 overwrite the saved $ra, producing control-flow hijack and potential remote code execution.

No valid credentials are needed because the action is marked authentication-free.

Scoring Context

The NVD vector is:

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/E:P

VulDB also publishes a CVSS 3.x base of 10.0 and temporal 9.4, while NVD displays VulDB's CVSS 4.0 score of 9.3 Critical with no independent NIST assessment. These are different scoring presentations rather than interchangeable measurements, and both support critical prioritization. The available evidence does not establish a complete arbitrary code execution payload, execution privileges, persistence, or reliable compromise across deployments. A network attack classification also does not prove that a particular installed router exposes the vulnerable service to the public internet.

Proof of Concept

A public proof-of-concept is documented for CVE-2026-138366. The CVE record, assigned by VulDB, references a single GitHub repository, https://github.com/FoundTL/D-LINK-R18A1-FW120B01-, tagged explicitly as exploit.

Inspecting the repository contents through the GitHub contents API shows it holds exactly one file: an archive named D-link R18A1-FW120B01.zip (roughly 869 KB, sha 1319cef2dc22075f97565a6259b340df4c5384c2). The archive, which contains the firmware and the researcher's overflow material, is the publicly disclosed artifact. Its internal exploit script was not extractable through the data endpoints used, so no verbatim exploit code is reproduced here.

The reproducible mechanics drawn from the accepted VulDB submission #1075955 are:

  • A Target value of about 128 bytes is enough to overwrite saved control data on the stack.
  • Cyclic-pattern testing placed saved $ra control at offset 68 from the start of the Target value, giving a precise control-of-execution offset.
  • The firmware action table marks both GetDeviceSettings and Login as authentication-free, so no valid account, session cookie, or API-CONTENT value is required to reach the vulnerable copy.

Trigger path: an attacker sends a crafted HTTP request to the device's web management interface invoking the GetDeviceSettings action with an oversized Target XML node value. Placing controlled bytes at offset 68 overwrites $ra, yielding control-flow hijack and potential remote code execution.

VulDB entry VDB-445169 and the official CVE record both state the exploit has been publicly disclosed and may be used, and rate exploit maturity as Proof-of-Concept (E:P). The documented evidence confirms public availability and a precise overwrite offset. Functional end-to-end exploitation was not independently re-tested because the packaged script inside the ZIP could not be inspected through the clean data endpoints.

Affected Systems and Versions

  • Vendor and product: D-Link R18 A1
  • Confirmed affected firmware: 1.20.B01
  • Component: httpd
  • Function: GetDeviceSettings_put
  • Attacker controlled argument: Target
  • Authentication: Not required, per VulDB

The evidence establishes the identified firmware as affected. It does not support an unrestricted claim that every R18 firmware release, or other D-Link devices, share the same defect.

Vendor Security History

D-Link has a documented security history. In January 2017, the FTC alleged that inadequate security in D-Link routers and internet cameras put consumer privacy at risk, with allegations including hard coded camera credentials, command injection in routers, exposure of a private signing key, and readable credentials stored by a mobile application. These are historical allegations about other issues, not findings about CVE-2026-138366.

A July 2019 FTC settlement account describes a comprehensive software security program covering threat modeling, pre-release testing and remediation, defect monitoring, firmware updating, acceptance of researcher reports, and independent assessments every other year for the following decade. For the R18 specifically, advisory SAP10398 addressed CVE-2024-6044 and CVE-2024-6045 and listed firmware v1.10.01 as the fix for those issues, which shows prior remediation capability.

That history is context, not coverage. A published security program and prior R18 fixes do not establish that the current overflow in 1.20.B01 has been repaired, and the earlier v1.10.01 recommendation must not be repurposed as a fix for this defect.

References

Detect & fix
what others miss

Works with
  • GitHub
  • GitLab
  • Bitbucket
  • Azure DevOps Services
  • Gerrit
  • CVS
  • Jira
  • Linear
  • Slack
  • Security Compass
Explore integrations
Security magnifying glass visualization