Skip to main content
Meet us at Black Hat USA 2026— Las Vegas, August 1–6Book a Meeting
Mallory
HighPublic exploit

Authenticated command injection in TP-Link router configuration import

IdentifiersCVE-2026-3227CWE-78· Improper Neutralization of Special…

CVE-2026-3227 is a command injection vulnerability affecting TP-Link TL-WR802N v4, TL-WR841N v14, and TL-WR840N v6. The flaw is caused by improper neutralization of special elements used in an OS command within the router configuration import functionality. An authenticated attacker can upload a crafted configuration file which, during port-trigger processing, causes attacker-controlled input to be incorporated into OS-level commands and executed with root privileges. This results in arbitrary command execution on the device.

Share:
For your environment

Are you exposed to this one?

Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.

ANALYST BRIEF

Impact, mitigation & remediation

What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation allows an authenticated attacker to execute arbitrary system commands as root on the affected router. This can lead to full device compromise, including complete administrative control of the system, modification of configuration, installation of persistent malware or backdoors, interception or manipulation of network traffic, and disruption of router services.

Mitigation

If you can’t patch tonight, do this now.

Until patched firmware is applied, restrict access to the router administrative interface to trusted management networks only, disable remote administration if not strictly required, and limit which users can authenticate to the device. Avoid importing configuration files from untrusted sources, monitor for unexpected configuration imports or changes related to port-trigger settings, and isolate affected devices from untrusted users where possible. If compromise is suspected, rotate credentials, review configuration integrity, and reflash firmware from a trusted image.

Remediation

Patch, then assume compromise.

Upgrade affected TP-Link devices to a vendor-fixed firmware release once available from TP-Link. If a patched firmware version has already been published for TL-WR802N v4, TL-WR841N v14, and TL-WR840N v6, apply it immediately following vendor guidance. Validate firmware authenticity before deployment and restrict administrative access during the upgrade window.
PUBLIC EXPLOITS

Exploits

1 valid exploit after Mallory filtered fakes, detection scripts, and README-only repos.

VALID 1 / 1 TOTALView more in app
CVE-2026-3227MaturityPoCVerified exploit

This repository is a real proof-of-concept exploit for CVE-2026-3227 targeting vulnerable TP-Link router firmware. Its purpose is to take a legitimate router backup, decrypt it, modify a specific XML field used later in command construction, and then re-encrypt the configuration into a format the router will accept. The exploit chain is: decrypt backup -> edit XML -> re-encrypt using the vendor's own native code under emulation -> manually upload the malicious backup -> trigger Port Triggering processing so the injected shell fragment executes as root. Repository structure: the main operator entry point is POC/generate_payload.py, which orchestrates the workflow. POC/python_utils/decrypt_config.py implements DES-ECB decryption with a hardcoded key (478da50bf9e3d2cf), MD5 verification, and a custom decompression routine to recover the XML configuration. POC/python_utils/xml_editor.py locates the WANIPConnection block with Name val='ewan_ipoe_d' and updates or inserts the X_TP_IfName attribute value with the attacker-supplied payload. POC/python_utils/encrypt_config.py does not reimplement the router encryption algorithm; instead it launches qemu-mipsel against an extracted TP-Link httpd binary with LD_PRELOAD=create_config.so and QEMU_LD_PREFIX=squashfs-root so the router's own libraries generate a valid encrypted config. POC/c_hook/create_config.c is the key offensive component: a MIPS-targeted shared object that hooks __uClibc_main, replaces the program's main with harness_main, dlopens libcutil.so and libcmm.so, resolves internal functions such as cen_compressBuff, cen_md5MakeDigest, cen_desMinDo, and computes the DES key address from dm_shmInit/libcmm base offsets. compile_hook.sh builds this shared object for MIPS little-endian. Main exploit capability: authenticated persistent OS command injection via malicious configuration restore. The README states the vulnerable sink is an iptables command built from unsanitized X_TP_IfName data and executed through util_execSystem/system(). The provided example payload is ';reboot;' and the repository notes a practical payload length limit of roughly 15 characters. This is enough for destructive actions like persistent reboot loops and potentially compact backdoor/bootstrap commands. The exploit is operational rather than weaponized: it includes a working payload-generation pipeline and native-code hook, but payload delivery and triggering are still partly manual and environment-specific. Fingerprintable targets/endpoints include the router upload endpoint http://192.168.0.1/cgi/confup, the management page http://192.168.0.1/mainFrame.htm, the example router IP 192.168.0.1, the required JSESSIONID cookie, and local file/library paths such as squashfs-root/usr/bin/httpd, libcutil.so, libcmm.so, and create_config.so. No external C2 or remote callback infrastructure is present; the exploit is focused on local generation of a malicious config and authenticated upload to the router web interface.

do4chooDisclosed Jun 25, 2026cpythonwebfilelocal
EXPOSURE SURFACE

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
TP-LinkTl-Wr802nhardware
TP-LinkTl-Wr802n Firmwareoperating_system
TP-LinkTl-Wr840nhardware
TP-LinkTl-Wr840n Firmwareoperating_system
TP-LinkTl-Wr841nhardware
TP-LinkTl-Wr841n Firmwareoperating_system

Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.

ACTIVITY FEED

Recent activity

9 sources tracked across advisories and community write-ups. News coverage will land here when it surfaces.

No news coverage yet. Advisories and community discussion only.

What this page doesn’t show

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, which detections to deploy, and what to do tonight.
Exposure mapping

Query your assets running an affected version, and investigate the blast radius.

Threat actor evidence

Every observed campaign linking this CVE to a named adversary.

Associated malware

Malware families riding this exploit, with evidence and IOCs.

Detection signatures

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

Vendor-by-vendor mapping

Cross-references every affected SKU, including bundled OEM variants.

Social activity9

Community discussion across Reddit, Mastodon, and other social sources.