I've been curious about arbitrary code execution (ACE) and its prevalence in software. I've seen instances of this, particularly in older Nintendo games, where it seems like bizarre actions overload the system and trigger ACE. I'm wondering if it's theoretically possible to manipulate any program into achieving ACE, assuming the program is complex enough, or if this is just common in certain types of software.
6 Answers
Not every program can have ACE. For example, if a program completely ignores user input, there wouldn’t be any way to execute arbitrary code through user actions. ACE doesn’t rely solely on user input, though, as certain programs can manipulate memory in a way that exposes vulnerabilities.
You could argue that if a program has functions that are purely automated, then it becomes a lot harder to achieve ACE.
The risk of ACE isn’t just a function of the program itself; it heavily relies on the operating system. Some operating systems allow more freedom to execute code, which increases vulnerability. In modern environments, various safeguards are in place to prevent this kind of exploitation, further complicating the picture.
Absolutely! Back in the day, older consoles allowed for more direct memory access, which made it easier to find these vulnerabilities.
Right, and modern systems have multiple layers of security that reduce the chance of ACE happening.
The question itself isn’t clearly defined. If you say a program must be 'sufficiently complex' to have ACE, it leads to circular reasoning. If we decide that anything without an ACE vulnerability isn't complex enough, then we’ve made the definition too vague to dissect meaningfully.
You might be interpreting it right. I think the asker meant the process to reach ACE needs to be complex, rather than the program itself.
It's a tricky definition that doesn't really provide clear criteria to assess what qualifies.
From what I understand, no single program can be deemed entirely protected from ACE. Each program generally needs at least one bug or unexpected behavior that can be exploited to achieve ACE. Older video games, due to their less sophisticated development tools, often exhibited these vulnerabilities, mainly because programming was much less constrained back then, allowing errors to go unnoticed.
Yes, any program can have a vulnerability that might be exploited for ACE, but not all programs have these vulnerabilities. The presence of such weaknesses largely depends on how the software was developed and whether it’s been adequately tested against potential exploits.
How feasible would it be to make a modern AAA game free of vulnerabilities that could lead to ACE?
Historically, it's believed that most programs have vulnerabilities; we just might not have discovered them yet.
In theory, not every program can be subject to ACE. Some hardware architectures even restrict code execution to specific memory types, which would eliminate the possibility for many programs.

ACE doesn’t need user input at all. For example, one program could exploit another by injecting code into its execution space, like how some Zelda games have tackled this.