If you are not using a HD wallet, anytime you sign a transaction, your wallet.dat will be unencrypted in RAM, or more specifically, the decryption key to decrypt the wallet.dat file will be in RAM, along with the private key(s) of what you are using to sign. If an attacker has access to your RAM when you are signing a transaction, all of your money is effectively stolen.
If you are using an HD wallet, anytime you sign a transaction, the private key(s) used to sign the transaction will be stored in RAM. An attacker could use the private key along with the xpubkey (which will always be in an unencrypted state), to be able to calculate the rest of your private keys in your wallet.
Also, an attacker is likely able to monitor what you enter into your keyboard, so they can get your passphraise anyway, so an attacker could simply copy your wallet.dat and use what you typed as your passphraise.
The part I highlighted in red is where my questions focuses. I apologize if it sonds n00b… I'm not very well versed with the core wallet and such.
Suppose I have an airgap PC that I want to use to sign a transaction with but the wallet is passphrase protected. I assume that the wallet can't sign the transaction if it's kept locked correct? Therefore keeping it safe. The issue
is once the wallet is opened the info is then sent to RAM and
then it's game over.
I'm also wondering what malware they created to be able to
pull this off!? Super scary stuff!!
[/quote]I would not call it “game over” especially if you are using an air gapped computer.
You are correct in that your wallet cannot sign a transaction as long as your wallet is “locked” however your private keys may still be vulnerable if you have a weak pass phrase- if someone can gain access to your wallet and you have a weak pass phrase, they could guess the pass phrase and access your private keys.
As a general rule, if your computer is infected with malware, there is a fairly high chance any private keys on your computer will leak unless you catch this quickly and know what to do.