1day to 0day(CVE-2022-30024) on TP-Link TL-WR841N
A stack-based buffer overflow in the ipAddrDispose function of the TP-Link TL-WR841N router's httpd web server allows an unauthenticated attacker to send a crafted GET request with an overly long ping_addr parameter, overwriting the return address and enabling remote code execution. The device lacks protections such as ASLR, so the attacker can execute shellcode and take control of the router.
Published on blog.viettelcybersecurity.com
CVE-2022-24355 | File extensions handling |
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
This write-up covers three vulnerabilities on the TP-Link TL-WR841N home router, all reachable through the device's web interface served by the httpd binary. The researcher frames the work as a progression from a known 1day to a new 0day:
| Vulnerability | Description |
|---|---|
| CVE-2020-8423 | Data parsing |
| CVE-2022-24355 | File extensions handling |
| CVE-2022-30024 | Assignment data |
CVE-2020-8423 is analysed in depth as the starting point, CVE-2022-24355 is only referenced (a teammate analysed it separately), and CVE-2022-30024 is the new bug found during a full firmware review.
The feature under scrutiny is the router's embedded web server. Requests are dispatched to handler functions through a table that maps URL strings to function pointers.
Setup
- Target: TP-Link TL-WR841N, model V10 for the CVE-2020-8423 analysis.
- Firmware:
3.16.9 Build 150310. - Tools: IDA for reverse engineering, Burp Suite for intercepting and modifying requests, a Python script to drive the exploit, and firmware simulation for running the exploit (the researcher notes the reverse shell output appears as a log because the firmware is simulated).
- Architecture: MIPS. The researcher notes that no protection mechanism is enabled and that ASLR is turned off, which is what makes control-flow hijacking practical.
Finding it
The dispatcher
Before looking at any single bug, the researcher analyses Dispatcher() to understand how the program routes requests. When a request arrives, httpGenListDataGet() returns a LIST_ENTRY pointer to a list of function pointers, one per registered URL. The program then calls httpGenListFuncGet() to walk that list and check whether the URL in the incoming request matches a registered handler. If a match is found the handler is called; otherwise the check continues with the next entry.
Handlers are registered against URL strings with httpRpmConfigAdd().
CVE-2020-8423: the escape routine
The first bug is in stringModify(char * dst, int size, char * src). The function escapes characters: when it meets \, /, <, > or " it prepends a backslash, and when the following characters are not \n and \r it writes <br>. Processing stops when the destination buffer is full.
The flaw is a size accounting error: writing <br> into dst consumes 4 bytes of the destination, but the program only accounts for 1 byte.
So any caller that passes user input as src is a candidate for overflow. Tracing backwards, the researcher finds writePageParamSet(), which builds the page values returned to the user. It creates a dst[512] buffer and passes it to stringModify() to handle the escape characters.
Further back there is a callback that handles the URL string /userRpm/popupSiteSurveyRpm.htm at address 0x45FA94.
That function takes the GET request parameters and calls the vulnerable function.
The controllable input is the optional ssid parameter.
CVE-2022-30024: the ping handler
After exploiting the first bug, the researcher reviewed the whole firmware and found more 1day and 0day issues. CVE-2022-24355 is described only as a critical buffer overflow allowing unauthenticated network attackers to execute arbitrary code; it is not analysed further here.
The new bug, CVE-2022-30024, is a stack-based buffer overflow in ipAddrDispose in the web service running in the httpd binary. The parameter value of a GET request is assigned to a stack variable, so a large value lets the attacker write past the variable and take control.
The researcher first looks at the ping feature in the UI.
Sending a long string of a characters through the UI only allows 50 characters, and the device answers ping request could not find host ….. Please check the name and try again.
The limit is in the web UI, so the next step is to find the handler. Burp Suite captures the request containing /userRpm/PingIframeRpm.htm.
In IDA, the URL string leads to the handler at 0x44A530.
The handler calls httpGetEnv to read the values ping_addr, doType, isNew and others from the GET request parameters.
Those values flow into ipAddrDispose, called with the ping_addr argument, and that is where the overflow happens.
Inside, a stack variable buf_ip of 52 bytes receives each character of ping_addr until the end of the string. The length of ping_addr is never validated in the code; the only limit is the web UI, which Burp Suite bypasses trivially.
Exploitation
Step 1: verify CVE-2020-8423
The payload is built from escaped newlines followed by a run of A characters:
Payload = "/%0a" * 0x55 + "A" * 100
With a breakpoint set, the researcher observes that $ra has been changed and that three registers, $s0, $s1 and $s2, have been overwritten, confirming the bug.
Step 2: exploit CVE-2020-8423
No protection mechanism is enabled, so shellcode can be placed on the stack and executed. On MIPS the Icache must be cleared before the shellcode runs, so the exploit first redirects execution into Sleep(). The ROP chain is adapted from an old public exploit, with debugging and tweaking for this case.
Step 3: fix the shellcode
The referenced shellcode does not work as-is. When it passes through stringModify(), any byte in \x3c, \x3e, \x2f, \x22 or \x5c causes the program to insert a \x5c in front of \x5c\x3c or \x5c\x3e and so on, corrupting the shellcode. The shellcode contains two bad bytes, \x3c and \x2f, which are removed by rewriting the affected instructions.
Byte 0x3c. This byte appears in the lui instruction, where the original logic saves 4 bytes on the stack.
Replacing lui with li saves 2 bytes on the stack instead of 4.
Byte 0x2f. The shellcode contains both 0x3c and 0x2f where the author puts the string //bin/sh on the stack.
Using li removes 0x3c, and an xori instruction with an intermediate value fixes the 0x2f byte.
With the shellcode modified, the researcher gets control of the router.
Step 4: verify CVE-2022-30024
With Burp Suite, ping_addr is set to roughly 200 bytes of a. The program crashes, $ra is overwritten, and the vulnerability is confirmed.
A short Python script automates the trigger and produces the expected result.
Step 5: exploit CVE-2022-30024
The goal is remote code execution. No protection mechanism is enabled and ASLR is off, so $ra can be pointed at shellcode. From the function prologue and epilogue and the position of buf_ip, the offset to $ra is calculated as (0xD4 + 8) - (0xD4 – 0xA0) = 168 bytes, and two more registers, $s0 and $s1, can be controlled at the same time.
A memory diagram is drawn to model the layout before building the exploit.
As with the first bug, MIPS requires clearing the Icache before executing shellcode, so execution is redirected into sleep(). The same ROP chain from the earlier exploit is reused, since it comes from the same firmware.
The complete ROP chain gives the following stack model.
The device is successfully exploited through the stack overflow. Because the target is a firmware simulation, the reverse shell prints a log; on a real device this would not appear.
Root cause
Two distinct mistakes produce the same class of bug.
In CVE-2020-8423, stringModify() writes <br> (4 bytes) into dst but advances its accounting by only 1 byte. The destination is a fixed dst[512] in writePageParamSet(), and the ssid GET parameter reaches it as src, so a request full of characters that expand to <br> overruns the buffer while the function still believes there is room.
In CVE-2022-30024, ipAddrDispose copies ping_addr character by character into a 52-byte stack buffer buf_ip with no length validation. The only limit is the web UI, which is not a security control.
In both cases the absence of enabled protection mechanisms and of ASLR is what turns the overflow into reliable code execution: the return address can be overwritten and pointed at attacker-controlled data on the stack.
Impact
CVE-2020-8423 lets an authenticated attacker execute arbitrary code remotely by sending a GET request to the Wi-Fi network configuration, specifically through the ssid parameter of /userRpm/popupSiteSurveyRpm.htm.
CVE-2022-30024 lets an attacker who can reach the web interface send an oversized ping_addr to /userRpm/PingIframeRpm.htm and take control of the device. The researcher states the bug exists on TL-WR841N V12 and below.
CVE-2022-24355 is described as allowing network attackers to execute arbitrary code without authentication, but the report does not analyse it further.
Fix
For CVE-2022-30024, TP-Link provided a fixed firmware for verification and later released it publicly. The researcher advises users to download the latest firmware for their model from TP-Link's site. The timeline given is:
- 14/04/2022: report sent to TP-Link.
- 27/04/2022: TP-Link security team sent a fixed firmware to check.
- 04/08/2022: TP-Link released the new firmware.
The report does not describe the code change itself.
Variants to test
- Other callers of
stringModify(). Enumerate every handler that passes a GET or POST parameter intostringModify()and send a value made of characters that expand to<br>. A positive result is a crash or an overwritten return address in the debugger. - Other parameters in
PingIframeRpm.htm. The handler readsping_addr,doType,isNewand others throughhttpGetEnv. Send oversized values for each and watch for crashes; a positive result is a corrupted$raor$s0/$s1. - Other URL handlers registered with
httpRpmConfigAdd(). Walk the handler table and test each URL with long parameters. A positive result is a crash in a handler that copies input into a fixed stack buffer. - Bad-byte handling in shellcode. When a payload passes through an escaping routine, check for
\x3c,\x3e,\x2f,\x22and\x5cand rewrite the affected instructions (luitoli,xorifor0x2f). A positive result is shellcode that survives the filter and executes. - Client-side-only limits. Any input field that caps length in the browser should be replayed through a proxy without the cap. A positive result is a server-side crash or unexpected behaviour beyond the UI limit.
What happened, in plain words
A security researcher looked at a common home router, the TP-Link TL-WR841N, and found three bugs in the small web server that runs inside it. That web server is what lets you open the router's settings page in your browser, type in a Wi-Fi name, run a ping test, and so on. Because the router is a tiny computer, a bug in that web server can let an attacker take over the whole device.
The article walks through three bugs. CVE-2022-24355 is called a 1day (a bug that is already public). CVE-2022-30024 is the new bug found during the firmware review. The new one is tracked as CVE-2022-30024. The researcher shows how each bug works, how to trigger it, and how to turn it into full control of the router.
| Vulnerability | Description |
|---|---|
| CVE-2020-8423 | Data parsing |
| CVE-2022-24355 | File extensions handling |
| CVE-2022-30024 | Assignment data |
CVE-2020-8423 is analysed in depth as the starting point. CVE-2022-24355 is only mentioned, because a teammate analysed it separately. CVE-2022-30024 is the new bug found while reviewing the whole firmware.
The feature under scrutiny is the router's built-in web server. When your browser asks for a page, the server looks up which piece of code should answer that request, and hands the request to it. Some of those pieces of code copy values from the request into small fixed-size boxes in memory.
A few ideas you need first
Before the details, here are the ideas the rest of the article relies on. Each one is explained from scratch.
A router is a small computer. A home router is not just a box with lights. It has a processor, memory and software. The software includes a tiny web server so you can configure it from a browser.
Firmware is the software that is baked into a device like a router. When the manufacturer fixes a bug, it releases new firmware, and you install it (usually from the router's settings page or the manufacturer's website).
A web server is a program that listens for requests from browsers and sends back pages. On a normal website it runs on a big machine; on a router it runs on the router itself.
A request is what your browser sends to a server. The most common kind is a GET request: the browser asks for a page by its address, and can attach extra values at the end of the address, after a ?. Those extra values are called parameters. For example, in .../page.htm?name=hello, name is a parameter and hello is its value.
A URL is the address of a page, like /userRpm/popupSiteSurveyRpm.htm. The router's web server has a list of URLs it knows how to answer.
A handler is the piece of code that answers a particular URL. Think of a restaurant: the menu lists dishes, and each dish is made by a specific cook. The URL is the dish, the handler is the cook.
A buffer is a fixed-size box in memory where a program stores data. If you pour more water into a glass than it can hold, the water spills over the table. In a program, if you put more data into a buffer than it can hold, the data spills into neighbouring memory. That spill is called a buffer overflow.
The stack is the area of memory where a program keeps short-lived data: local variables, and the address it should return to when a function finishes. If you overflow a buffer that lives on the stack, you can overwrite that return address. That is how an attacker redirects the program to code of their choosing.
A register is a tiny storage slot inside the processor itself, much faster than memory. On the processor family used here (MIPS), some registers have conventional jobs. $ra holds the return address. $s0, $s1, $s2 are general-purpose registers the program uses to hold values across function calls.
Shellcode is a small piece of machine code that an attacker wants the victim's processor to run. The name comes from the classic goal: open a shell (a command prompt) on the victim machine.
A ROP chain (Return-Oriented Programming) is a technique for making a program do things it was not meant to do, by chaining together small snippets of code that already exist in the program. Each snippet ends with a "return" instruction, and the attacker lines up the return addresses so that one snippet leads to the next. It is like dominoes: each tile knocks over the next.
ASLR (Address Space Layout Randomisation) is a defence that shuffles the locations of things in memory each time a program starts, so an attacker cannot know where to jump. If ASLR is off, addresses are predictable, and exploitation is much easier.
The Icache (instruction cache) is a small, fast memory inside the processor that holds recently used instructions. On MIPS, after you write new code into memory, the processor may still be holding the old instructions in its cache. You have to clear the cache before the new code will run.
IDA is a program used to reverse engineer software: it takes a compiled program and shows you the code in a form a human can read.
Burp Suite is a tool that sits between your browser and a server. It lets you see the exact request your browser sends, and change it before it reaches the server. That is how you get past limits that only exist in the browser.
A breakpoint is a marker you put in a debugger that pauses the program at a chosen point, so you can look at the state of memory and registers.
A CVE is a public identifier for a known vulnerability, like a catalogue number. CVE-2022-30024 is one such number.
Setup
- Target: TP-Link TL-WR841N, model V10 for the CVE-2020-8423 analysis.
- Firmware:
3.16.9 Build 150310. - Tools: IDA for reverse engineering, Burp Suite for intercepting and modifying requests, a Python script to drive the exploit, and firmware simulation for running the exploit. The researcher notes that the reverse shell output appears as a log because the firmware is simulated.
- Architecture: MIPS. The researcher notes that no protection mechanism is enabled and that ASLR is turned off, which is what makes control-flow hijacking practical.
Finding it
The dispatcher
Before looking at any single bug, the researcher analyses Dispatcher() to understand how the program routes requests. When a request arrives, httpGenListDataGet() returns a LIST_ENTRY pointer to a list of function pointers, one per registered URL. The program then calls httpGenListFuncGet() to walk that list and check whether the URL in the incoming request matches a registered handler. If a match is found the handler is called; otherwise the check continues with the next entry.
A function pointer is a value in memory that says "the code for this job is over there". The list is like a phone book: each entry says which URL goes with which piece of code.
Handlers are registered against URL strings with httpRpmConfigAdd().
In plain words: at startup, the web server fills in its phone book. Each URL gets an entry pointing at the code that should answer it. When a request comes in, the server looks up the URL and calls the matching code.
CVE-2020-8423: the escape routine
The first bug is in stringModify(char * dst, int size, char * src). The function escapes characters: when it meets \, /, <, > or " it prepends a backslash, and when the following characters are not \n and \r it writes <br>. Processing stops when the destination buffer is full.
Escaping means making special characters safe to display. For example, if a user types < into a form, and the page shows it back, the browser might treat it as the start of an HTML tag. To prevent that, the program replaces it with something that displays as a literal <. The <br> tag is HTML for "line break".
The flaw is a size accounting error: writing <br> into dst consumes 4 bytes of the destination, but the program only accounts for 1 byte.
Think of a car park where the attendant writes down one space for every car, but some cars take up four spaces. The attendant thinks there is plenty of room, and keeps letting cars in, until they spill out into the next street.
So any caller that passes user input as src is a candidate for overflow. Tracing backwards, the researcher finds writePageParamSet(), which builds the page values returned to the user. It creates a dst[512] buffer and passes it to stringModify() to handle the escape characters.
dst[512] means a box of 512 bytes. If the function thinks it has written 512 bytes but has actually written more, the extra data lands outside the box.
Further back there is a callback that handles the URL string /userRpm/popupSiteSurveyRpm.htm at address 0x45FA94.
That function takes the GET request parameters and calls the vulnerable function.
The controllable input is the optional ssid parameter.
ssid is the name of a Wi-Fi network. The router's settings page lets you type it in, and the page shows it back to you. That is the value that flows into the buggy function.
CVE-2022-30024: the ping handler
After exploiting the first bug, the researcher reviewed the whole firmware and found more 1day and 0day issues. CVE-2022-24355 is described only as a critical buffer overflow allowing unauthenticated network attackers to execute arbitrary code; it is not analysed further here.
Unauthenticated means the attacker does not need to log in first. That makes a bug much more serious, because anyone who can reach the device can try it.
The new bug, CVE-2022-30024, is a stack-based buffer overflow in ipAddrDispose in the web service running in the httpd binary. The parameter value of a GET request is assigned to a stack variable, so a large value lets the attacker write past the variable and take control.
httpd is the name of the web server program. "Stack-based" means the overflowing buffer lives on the stack, which is why the return address can be overwritten.
The researcher starts from the ping feature in the UI.
Ping is a standard network test: the router sends a small message to a host and waits for a reply, to check whether the host is reachable. The settings page has a box where you type the host name or address.
Sending a long string of a characters through the UI only allows 50 characters, and the device answers ping request could not find host ….. Please check the name and try again.
That limit is in the web UI, so the next step is to find the handler. The browser is just a program on your computer; you can bypass it with a tool that talks to the server directly. Burp Suite captures the request containing /userRpm/PingIframeRpm.htm.
In IDA, the URL string leads to the handler at 0x44A530.
The handler calls httpGetEnv to read the values ping_addr, doType, isNew and others from the GET request parameters.
httpGetEnv is a helper that looks up a parameter by name in the request. It is like asking "what did the user put in the box labelled ping_addr?".
Those values flow into ipAddrDispose, called with the ping_addr argument, and that is where the overflow happens.
Inside, a stack variable buf_ip of 52 bytes receives each character of ping_addr until the end of the string. The length of ping_addr is never validated in the code; the only limit is the web UI, which Burp Suite bypasses trivially.
In plain words: the code copies the value of ping_addr into a 52-byte box, one character at a time, and never checks how long the value is. If you send more characters than the box holds, the extra data lands outside the box, on top of whatever is next in memory.
Exploitation
Step 1: verify CVE-2020-8423
The payload is built from escaped newlines followed by a run of A characters:
Payload = "/%0a" * 0x55 + "A" * 100
Line by line:
"/%0a"is a two-character string: a slash and the URL encoding of a newline.%0ais how a newline is written in a URL.* 0x55repeats that string 85 times.0x55is hexadecimal for 85.+ "A" * 100appends 100 capital A characters.- The whole thing is assigned to a variable called
Payload.
Why this shape? Each %0a becomes a newline in the request. The escape routine sees a newline and writes <br> (4 bytes) while only counting 1 byte. Repeating it 85 times makes the accounting drift by 3 bytes each time, so the buffer fills up long before the function thinks it has. The 100 A characters then spill past the end of the buffer and overwrite the return address.
With a breakpoint set, the researcher observes that $ra has been changed and that three registers, $s0, $s1 and $s2, have been overwritten, confirming the bug.
Step 2: exploit CVE-2020-8423
No protection mechanism is enabled, so shellcode can be placed on the stack and executed. On MIPS the Icache must be cleared before the shellcode runs, so the exploit first redirects execution into Sleep(). The ROP chain is adapted from an old public exploit, with debugging and tweaking for this case.
Why Sleep()?
Step 3: fix the shellcode
The referenced shellcode does not work as-is. When it passes through stringModify(), any byte in \x3c, \x3e, \x2f, \x22 or \x5c causes the program to insert a \x5c in front of \x5c\x3c or \x5c\x3e and so on, corrupting the shellcode. The shellcode contains two bad bytes, \x3c and \x2f, which are removed by rewriting the affected instructions.
\x3c is the byte for <, \x3e is >, \x2f is /, \x22 is ", and \x5c is \. These are exactly the characters the escape routine reacts to. If your shellcode happens to contain one of them, the routine inserts an extra byte, and the shellcode no longer does what it was meant to do. It is like a recipe where someone has slipped an extra word into every line: the dish comes out wrong.
Byte 0x3c. This byte appears in the lui instruction, where the original logic saves 4 bytes on the stack.
Replacing lui with li saves 2 bytes on the stack instead of 4.
lui and li are MIPS instructions. lui loads a value into the upper half of a register; li loads a small value directly. The point here is that the replacement avoids the byte 0x3c.
Byte 0x2f. The shellcode contains both 0x3c and 0x2f where the author puts the string //bin/sh on the stack.
//bin/sh is the path to a Unix shell. Putting it on the stack is how the shellcode prepares to launch a shell.
Using li removes 0x3c, and an xori instruction with an intermediate value fixes the 0x2f byte.
xori is an instruction that combines a value with a constant using exclusive-or. The trick is to build the byte you want without ever writing it literally, so the escape routine never sees it.
With the shellcode modified, the researcher gets control of the router.
Step 4: verify CVE-2022-30024
With Burp Suite, ping_addr is set to roughly 200 bytes of a. The program crashes, $ra is overwritten, and the vulnerability is confirmed.
A short Python script automates the trigger and produces the expected result.
Step 5: exploit CVE-2022-30024
The goal is remote code execution. Remote code execution means the attacker can make the device run code of their choosing, from across the network. No protection mechanism is enabled and ASLR is off, so $ra can be pointed at shellcode. From the function prologue and epilogue and the position of buf_ip, the offset to $ra is calculated as (0xD4 + 8) - (0xD4 – 0xA0) = 168 bytes, and two more registers, $s0 and $s1, can be controlled at the same time.
Prologue and epilogue are the opening and closing lines of a function: the prologue sets up the stack, the epilogue tears it down. Reading them tells you where the saved return address sits relative to the buffer. The arithmetic gives 168 bytes: that is how many bytes you have to send before you start overwriting $ra.
A memory diagram is drawn to model the layout before building the exploit.
As with the first bug, MIPS requires clearing the Icache before executing shellcode, so execution is redirected into sleep(). The same ROP chain from the earlier exploit is reused, since it comes from the same firmware.
The complete ROP chain gives the following stack model.
The device is successfully exploited through the stack overflow. Because the target is a firmware simulation, the reverse shell prints a log; on a real device this would not appear.
A reverse shell is a connection the victim device makes back to the attacker, giving the attacker a command prompt on the device. In a simulation, there is no real network, so the shell's output appears as a log instead.
Root cause
Two distinct mistakes produce the same class of bug.
In CVE-2020-8423, stringModify() writes <br> (4 bytes) into dst but advances its accounting by only 1 byte. The destination is a fixed dst[512] in writePageParamSet(), and the ssid GET parameter reaches it as src, so a request full of characters that expand to <br> overruns the buffer while the function still believes there is room.
In CVE-2022-30024, ipAddrDispose copies ping_addr character by character into a 52-byte stack buffer buf_ip with no length validation. The only limit is the web UI, which is not a security control.
In both cases the absence of enabled protection mechanisms and of ASLR is what turns the overflow into reliable code execution: the return address can be overwritten and pointed at attacker-controlled data on the stack.
Impact
CVE-2020-8423 lets an authenticated attacker execute arbitrary code remotely by sending a GET request to the Wi-Fi network configuration, specifically through the ssid parameter of /userRpm/popupSiteSurveyRpm.htm.
CVE-2022-30024 lets an attacker who can reach the web interface send an oversized ping_addr to /userRpm/PingIframeRpm.htm and take control of the device. The researcher states the bug exists on TL-WR841N V12 and below.
CVE-2022-24355 is described as allowing network attackers to execute arbitrary code without authentication, but the report does not analyse it further.
Fix
For CVE-2022-30024, TP-Link provided a fixed firmware for verification and later released it publicly. The researcher advises users to download the latest firmware for their model from TP-Link's site. The timeline given is:
- 14/04/2022: report sent to TP-Link.
- 27/04/2022: TP-Link security team sent a fixed firmware to check.
- 04/08/2022: TP-Link released the new firmware.
The report does not describe the code change itself.
Variants to test
- Other callers of
stringModify(). Enumerate every handler that passes a GET or POST parameter intostringModify()and send a value made of characters that expand to<br>. A positive result is a crash or an overwritten return address in the debugger. - Other parameters in
PingIframeRpm.htm. The handler readsping_addr,doType,isNewand others throughhttpGetEnv. Send oversized values for each and watch for crashes; a positive result is a corrupted$raor$s0/$s1. - Other URL handlers registered with
httpRpmConfigAdd(). Walk the handler table and test each URL with long parameters. A positive result is a crash in a handler that copies input into a fixed stack buffer. - Bad-byte handling in shellcode. When a payload passes through an escaping routine, check for
\x3c,\x3e,\x2f,\x22and\x5cand rewrite the affected instructions (luitoli,xorifor0x2f). A positive result is shellcode that survives the filter and executes. - Client-side-only limits. Any input field that caps length in the browser should be replayed through a proxy without the cap. A positive result is a server-side crash or unexpected behaviour beyond the UI limit.
Glossary
- 0day: a vulnerability that is not yet public, so the manufacturer has had no chance to fix it.
- 1day: a vulnerability that is already public, usually because a fix or advisory exists.
- ASLR: Address Space Layout Randomisation, a defence that shuffles memory locations so an attacker cannot predict where to jump.
- Breakpoint: a marker in a debugger that pauses the program at a chosen point.
- Buffer: a fixed-size area of memory used to hold data.
- Buffer overflow: writing more data into a buffer than it can hold, so the extra data spills into neighbouring memory.
- Burp Suite: a tool that sits between browser and server, letting you see and change requests.
- Callback: a function that is called when a particular event happens, such as a request for a particular URL.
- Client-side: enforced by the browser or the user's computer, not by the server.
- CVE: a public catalogue number for a known vulnerability.
- Dispatcher: the part of a program that decides which handler should answer a request.
- Epilogue: the closing lines of a function that tear down its stack frame.
- Escaping: replacing special characters with safe equivalents so they display literally.
- Firmware: the software baked into a device like a router.
- Function pointer: a value in memory that points at the code for a particular job.
- GET request: a request where the browser asks for a page by its address, optionally with parameters after a
?. - Handler: the piece of code that answers a particular URL.
- httpd: the name of the web server program.
- Icache: the instruction cache inside the processor; on MIPS it must be cleared before newly written code runs.
- IDA: a program for reverse engineering compiled software.
- lui / li / xori: MIPS processor instructions;
luiloads a value into the upper half of a register,liloads a small value directly,xoricombines a value with a constant using exclusive-or. - MIPS: a family of processor designs used in many embedded devices, including routers.
- Parameter: an extra value attached to a request, usually after a
?in the URL. - Prologue: the opening lines of a function that set up its stack frame.
- Register: a tiny, fast storage slot inside the processor.
- Remote code execution: making a device run code of your choosing from across the network.
- Request: what a browser sends to a server to ask for a page.
- Reverse shell: a connection the victim device makes back to the attacker, giving the attacker a command prompt.
- ROP chain: Return-Oriented Programming, a technique that chains together small existing code snippets to do something new.
- Router: a device that connects a home network to the internet and lets you configure it from a browser.
- Shellcode: a small piece of machine code an attacker wants the victim's processor to run.
- SSID: the name of a Wi-Fi network.
- Stack: the area of memory where a program keeps short-lived data, including return addresses.
- Unauthenticated: done without logging in first.
- URL: the address of a page.
- Web server: a program that listens for requests from browsers and sends back pages.