I read about Mt. Gox and how 850,000 bitcoins has been "stolen" from it. I do not understand how someone can steal bitcoins: if MtGox has bitcoins, and MrThief wants to use this bitcoins, then MrThief must show a transaction moving bitcoins from MtGox's accout to MrThief's account. But such a tranasaction must be signed by the private key of MtGox. Does it mean that, in order to steal bitcoins, MrThief must somehow find the private key of MtGox and sign transactions in its name? Or is there another way by which bitcoins can be stolen?
1Simplifying greatly, MtGox's private keys were controlled by their software, so that transactions could be automated. Thus it was possible to exploit vulnerabilities in that software to get it to send out coins that should not have been sent. You don't have to steal the keys if you can trick the owner into using them the way you want. See also bitcoin.stackexchange.com/questions/22104/…– Nate EldredgeMar 28, 2017 at 4:58
As you described, a valid transaction must be submitted to the network to change ownership of funds. Mt.Gox P2PKH addresses, so spending the funds indeed required a signature of the corresponding private key to move the funds.
As Nate Eldredge commented above, this can be achieved either through gaining control of the key, or by causing the owner to use the key in the attacker's favor. Both occurred in the context of MtGox.
First, MtGox got hacked in 2011 where the attacker attained a copy of the service's hot wallet. Not only did they take the funds available at the time, but Mt.Gox continued to get deposits to tho addresses the attacker had keys for, which the attacker immediately redirected for the next two years.
Later, MtGox described losing funds due to attackers malleating withdrawal transactions. In such an attack, one or multiple signatures on a transaction get modified which results in an equivalent transaction with a different transaction id (txid). MtGox was tracking withdrawals by txid. Since the original transaction never confirmed, MtGox misinterpreted the corresponding withrdrawals to have failed and reissued the same withdrawal again, paying out the withdrawal twice. Later research showed that this caused a much smaller portion of the losses than initially suspected.
If you are interested in reading more about the MtGox saga specifically, I would recommend the corresponding article series on the WizSec blog.