For the first time ever, this is actually now becoming a possibility for every-day computers, thanks to the wide-scale introduction into most computers of a device intended for high energy-density storage: lithium-ion batteries. Obligatory XKCD:
Of course, we can't base an answer just on a webcomic (even if it is XKCD), but given the information in the answers to this question we can confirm that a laptop battery can indeed contain more energy than a hand grenade. This gives us a feasible avenue by which a personal computer may "explode". Of course we have two main obstacles.
- Batteries are obviously designed to release their energy in a controlled fashion, and making one explode may not be easy or possible
- Even if a battery can be made to explode (or, more accurately, "burn quickly") that doesn't mean a hacker can make one explode, or do so remotely.
Let's see which of the above challenges may be solvable:
This one isn't actually hard to establish. Even in worst-case scenarios batteries don't normally explode, but rather burn (possibly rather quickly). However, a quick google for "exploding batteries" will show you plenty of examples of people intentionally causing their batteries to ignite, some of which could easily be considered an "explosion" from a non-technical standpoint. Puncturing batteries is one easy way to make this happen (that obviously won't help our hackers), but another way is to simply over-charge the batteries. Li-ion batteries are susceptible to spontaneous combustion as a result of over-volting and over-charging. As a result, all batteries used in modern electronics have built-in chips specifically designed to protect the batteries from the kind of voltage conditions that would cause a critical failure.
Hacking a battery
This leads directly to the question of whether or not a battery could be hacked into exploding. Causing a li-ion battery "explosion" may in fact be feasible if a hacker can control the chips that protect the batteries, and force the chips to cause an over-volt instead of protecting from one. The trouble of course is that these are separate and independent chips built into the battery itself, and whether or not there is even a way for a malicious computer to override these protective chips is a question that hasn't (to my knowledge) been well studdied. The only results I am aware of are from a security research back in 2011 who studied apple computers:
He discovered that (back then anyway) apple installed the batteries with the default manufacturer "password" still in place on the chips. As a result he found that he could in fact gain access to the chips protecting the battery and even flash the firmware. He published a POC showing how to flash the firmware on the battery protection chips. Theoretically this could allow an attacker to rewrite it in such a way to cause it to intentionally overvolt the battery itself, leading to fire or a close approximation of an explosion. The researcher in question suggested these as realistic possibilities, but made no attempt to overvolt batteries and see what could result from doing so. I guess not everyone wants to be the one to publish a POC that demonstrates how to weaponize everyday computers...
Of course it still isn't necessarily a matter of "over-volt battery and instantpy explode". In videos of people intentionally over-volting batteries it certainly isn't instant and the batteries usually expand substantially before exploding. Over-volting a battery wouldn't be possible with the laptop unplugged, so if the laptop shows enough signs of trouble it would be simple enough for someone to unplug it and stop a potential disaster. All of this is to say that while this is potentially feasible, there are plenty of variables even still.
However, I think this does show that hacking a computer to cause an "explosion" is a possibility given the right circumstances. Probably the most straight-forward way to do it (for a directed attack) would be to build a hacked battery designed to overvolt once some "trigger" is met, and then swap out a target's battery with the hacked one. Presuming of course that they have a laptop with a swappable battery.
Hacking a battery remotely
Hacking a battery remotely will require another level of challenge, and may not be possible for all systems. My reading leads me to believe that the researcher in 2011 would have been able to remotely overwrite the battery controller firmware once he gained remote access to the mac in question. This suggests that a remote attack may in fact even be possible. However, we're talking about firmware-level hacks here, so the vulnerability level will vary wildly from model-to-model, and there certainly wouldn't be a one-size-fits-all solution that a hacker could use to remotely "detonate" any random person's computer.
So overall I would say:
A realistic threat: No!