Authenticated command injection in TP-Link router configuration import
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.
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.
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.
Mitigation
If you can’t patch tonight, do this now.
Remediation
Patch, then assume compromise.
Exploits
1 valid exploit after Mallory filtered fakes, detection scripts, and README-only repos.
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.
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.
Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.
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.
The version that knows your environment.
Query your assets running an affected version, and investigate the blast radius.
Every observed campaign linking this CVE to a named adversary.
Malware families riding this exploit, with evidence and IOCs.
YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Cross-references every affected SKU, including bundled OEM variants.
Community discussion across Reddit, Mastodon, and other social sources.