Hacking Unity Games with Malicious GameObjects, Part 2
Unity games that load AssetBundles from untrusted sources can be attacked by malicious GameObjects containing built-in components. An attacker can achieve zero-click code execution by using an autoplaying animation to toggle a UI Toggle, which fires a UnityEvent, or by using AnimationEvents to call methods on components from public assets.
blog.includesecurity.com
Published on blog.includesecurity.com
In the last post I talked about a way I found to execute arbitrary code in Unity using no custom scripts, only built-in components. This allowed potential attacks against Unity games that load AssetBundles from untrusted sources since, although AssetBundles can’t include custom scripts, they can include GameObjects…
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
Impact
An attacker could execute arbitrary code or perform other harmful actions on the user's computer, depending on available components, with no user interaction required for the zero-click exploit.
What the attacker needed
Game loads AssetBundles from untrusted sources; attacker can supply a malicious AssetBundle
The fix
Game developers should reject GameObjects that contain denylisted components, or better, reject any objects containing non-allowlisted components before instantiating them.
How it was found
- Add a Unity UI Toggle, along with an EventSystem
- Create an autoplaying animation that toggles the UI Toggle
- Unity will fire the onValueChanged UnityEvent when the animation changes the Toggle state
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.
Unity games can load extra content called AssetBundles from outside sources, like mods. If a game loads a malicious bundle, an attacker can make the game run harmful actions without the player doing anything, because the bundle can include special objects that trigger code when the game processes them.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.