
Technical writeup and Python PoC for CVE-2026-109506: reversing TP-Link range extender password encryption to derive valid admin credentials from captured logins.
This is the technical writeup for a vulnerability I found in multiple TP-Link Wi-Fi range extenders, tracked as CVE-2026-109506. TP-Link has confirmed the issue and published their own security advisory with fixed firmware.
TP-Link range extenders encrypt the admin login password client-side with a custom, reversible XOR-and-dictionary scheme before sending it over HTTP. The key material for this scheme is sent to the client in plaintext. Because the scheme is reversible, anyone who observes a single login request on the LAN can derive thousands of alternative passwords that produce the same ciphertext and authenticate successfully, without knowing the actual password. This requires no brute force and no prior authentication.
Per TP-Link's advisory, the following devices and hardware versions are affected, with fixed firmware now available:
| Model | Hardware version | Fixed firmware |
|---|---|---|
| RE190 | V5 | V5_260904 |
| RE200 | V5 | V5_260904 |
| RE205 | V4 | V4_260904 |
| RE215 | V1 | V1_260904 |
| RE220 | V3 | V3_260904 |
| RE230 | V2 | V2_260904 |
| RE300 | V2 | V2_260904 |
| RE305 | V4 | V4_260904 |
| RE315 | V1 | V1_260904 |
| RE330 | V1 | V1_260904 |
| RE335 | V1 | V1_260904 |
| RE365 | V2 | V2_260904 |
| RE365 | V3 | V3_260904 |
| RE750C | V4 | V4_260904 |
| RE450 | V4 | V4_260915 |
| RE550 | V1 | V1_260915 |
If you own one of these, update your firmware now. Instructions below.
AV:A/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N — 6.1 in my own scoring; TP-Link's advisory and the CVE record both score it 5.9 (Medium) with a slightly stricter AC:H.An attacker who passively captures a single authentication session on the same network can recover a working set of administrative credentials for the device's web management panel, granting full administrative access: configuration changes, password changes, changing of firmware, etc.
No prior authentication is required. The only precondition is a legitimate admin login occurring while the attacker is capturing traffic on the same network.
Exploit preconditions:
The vulnerable function is $.su.encrypt(), part of TP-Link's tpEncrypt.min.js library used across many of their devices. Here's the process:
[INPUT] - The user's password is submitted
v
[XOR] - Each character of the password is XOR'd with a key
v
[DICT] - The result of each XOR operation returns an integer n.
| The character at position (n+1) in a dictionary string is
| appended to the output. This is the "middle ciphertext".
v
[REPEAT]- The middle ciphertext is fed through the same function again,
| this time using a session-specific key and dictionary.
v
[SEND] - The resulting "final ciphertext" is sent to the device for
authentication.
The session-specific key and dictionary are fetched when the login page loads — and sent to the client in plaintext, over HTTP. Anyone on the same network can simply read them off the wire. They typically look like this:
key = *^VW24~ved7{0.HjMJ$eSk*r>2PO[HEK~
dictionary = YpJqSWA4|5[a3Ag9YGrftYu{C0>k{uN+yfsaO(T0c6rj~uZBW(6EX!P+c3~P(64Wp(}Qev*RJrzINQc$beAMk73+QB3yT4Bl+js+SxjLi6Bo)f$9DVONVIu6OigtrYy^
There's also a hard-coded key-dictionary pair baked into every copy of tpEncrypt.min.js, used as the "default" layer that every password passes through first:
key = RDpbLfCPsJZ7fiv
dictionary = yLwVl0zKqws7LgKPRQ84Mdt708T1qQ3Ha7xv3H7NyU84p21BriUWBU43odz3iP4rBL3cD02KZciXTysVXiV8ngg6vL48rPJyAUw0HurW20xqxv9aYb4M9wK1Ae0wlro5
During encryption, the password is XOR'd with the key character by character. If the password is shorter than the key, it's padded with the byte 0xBB. For example, encrypting ABCDEFGHIJK against the default key RDpbLfCPsJZ7fiv:
| KEY | R | D | p | b | L | f | C | P | s | J | Z | 7 | f | i | v |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| PASSWORD | A | B | C | D | E | F | G | H | I | J | K | 0xBB | 0xBB | 0xBB | 0xBB |
R ⊕ A = 0x13 = 19. Then position n+1 = 20 is looked up in the dictionary, and the 20th character becomes the first output character. Repeat for every position and you have the ciphertext.
The function itself, straight from the client-side JS:
$.su.encrypt = function(input1, input2, input3)
{
input2 = input2 || "RDpbLfCPsJZ7fiv";
input3 = input3 || "yLwVl0zKqws7LgKPRQ84Mdt708T1qQ3Ha7xv3H7NyU84p21BriUWBU43odz3iP4rBL3cD02KZciX"+
"TysVXiV8ngg6vL48rPJyAUw0HurW20xqxv9aYb4M9wK1Ae0wlro510qXeU07kV57fQMc8L6aLgML"+
"wygtc0F10a0Dg70TOoouyFhdysuRMO51yY5ZlOZZLEal1h0t9YQW0Ko7oBwmCAHoic4HYbUyVeU3"+
"sfQ1xtXcPcf1aT303wAQhv66qzW";
var dictionary = input3;
var output = "";
var len, len1, len2, lenDict;
var cl = 0xBB, cr = 0xBB;
len1 = input1.length;
len2 = input2.length;
lenDict = dictionary.length;
len = len1 > len2 ? len1 : len2;
for (var index = 0; index < len; index++)
{
cl = 0xBB;
cr = 0xBB;
if (index >= len1) { cr = input2.charCodeAt(index); }
else if (index >= len2) { cl = input1.charCodeAt(index); }
else {
cl = input1.charCodeAt(index);
cr = input2.charCodeAt(index);
}
output += dictionary.charAt((cl ^ cr) % lenDict);
}
return output;
};
The index used to pick a character from the dictionary comes from password ⊕ key. XOR works exactly like division or multiplication — if you have any two of the three values, you can derive the third:
A ⊕ B = C
B ⊕ C = A
A ⊕ C = B
We already know the key and dictionary (they're sent to us in plaintext). So for any output character, we can find every dictionary position that produces that character, XOR each position with the corresponding key character, and get every password character that would produce an identical ciphertext.
Concretely: if the first key character is R, and the real output is 4, we find every index in the dictionary where 4 occurs:
[19, 43, 54, 62, 90, 114, 218]
XOR each with R:
19 ⊕ R = 65 = 'A'
43 ⊕ R = 121 = 'y'
54 ⊕ R = 100 = 'd'
62 ⊕ R = 108 = 'l'
90 ⊕ R = 8 = (non-printable)
114 ⊕ R = 32 = ' '
218 ⊕ R = 136 = (non-printable)
Five printable collisions on the first character alone. This multiplies across every character in the password. I verified this against a Python reimplementation of the exact function (su_encrypt(), full code below). Changing just the first character of the input:
>>> su_encrypt("ABCDEFGHIJK", default_key, default_dict)
'4zW7wal0zyQfbwK'
>>> su_encrypt("yBCDEFGHIJK", default_key, default_dict)
'4zW7wal0zyQfbwK'
>>> su_encrypt("dBCDEFGHIJK", default_key, default_dict)
'4zW7wal0zyQfbwK'
>>> su_encrypt("lBCDEFGHIJK", default_key, default_dict)
'4zW7wal0zyQfbwK'
>>> su_encrypt(" BCDEFGHIJK", default_key, default_dict)
'4zW7wal0zyQfbwK'
All five produce the exact same ciphertext. Taken far enough, you get strings that look nothing like the original password — ' BCi.F?3uJG' also produces '4zW7wal0zyQfbwK'. When I ran a full reverse search over every printable character for this one ciphertext: