Skip to content
RCE Write-up Intermediate

Apple TV for Fire OS code execution

The Apple TV app on Fire OS extracted an embedded zip file to external storage and executed a script from there. Any app with external storage permission could modify that script to run code in the Apple TV app's context.

Razvan Sima Follow

Published on 0xra.github.io

Any app on Fire OS that has been granted permission to use external storage can execute code in the context of the Apple TV app.

Razvan Sima, on 0xra.github.io

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.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The app extracted and executed a script from external storage, which is writable by other apps that have the external storage permission.

Impact

An attacker could execute code in the Apple TV app, potentially steal session tokens or credentials, or perform actions on behalf of the user.

What the attacker needed

Attacker app installed on same device; attacker app has external storage permission; victim opens Apple TV app

The fix

The issue was fixed in version 5.1 by extracting the zip file to internal storage.

How it was found

  1. Create an Android app that requests the WRITE_EXTERNAL_STORAGE permission.
  2. Once permission is granted, read the app.js file from the Apple TV app's external storage folder.
  3. Insert exploit code into the firmwareCheck method of app.js.
  4. Write the modified file back to external storage.
  5. Open the Apple TV app to trigger the injected code.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

On Android, apps can save files to shared storage that other apps can also access if they have permission. The Apple TV app saved a program file there and then ran it, so another app could change that file to make the Apple TV app run the attacker's code.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More from Apple

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.