Thanks for sharing this! however, I plug the USB stick into my online device(macbook) for reasons like transfer the verified Electrum installer to my air-gapped offline laptop which means i need to enable the writing function.
The goal is to keep anything in the Air-Gap machine from leaving the Cold-storage when you transfer the Electrum Binary to it.
So, in the slightest chance that the flash drive is infected with a malware specifically designed to steal from Cold-storage systems,
It wont be able to send whatever data that needs to transfer to the online machine if the flash drive in write protected when plugged in the Air-Gap machine.
Otherwise, there's no way to install Electrum aside from manually copying the whole source code then run it from source, including the dependencies (
which needs an off-site topic).
If you'd somehow consider it, here's the source code:
github.com/spesmilo/electrummeantime, I just noticed there is an option to transfer the transaction/signed transaction between the offline and online devices via Camera. please forgive my ignorance here, does this "camera transfer" impose any risk here?
There was a security issue that can be utilized to run arbitrary script when a BIP70 payment request QR is scanned, but that was patched in v4.2.2.
If you're using the latest version, that attack will not work.
And also, like in the note of it being "
complicated"; the attack has to be very specific with steps involving getting a script in the Air-Gap machine and making it scan the QR code, then find a way to send the script's "
hacked" data to the online machine.
For the transaction, that should be a good alternative to PSBT transfer.
But take note that Electrum doesn't support animated QR so if the transaction's size is big (
e.g: lots of signatures/inputs), it may not work or may omit some data.
The QR Code window has a warning for that:

This usually doesn't cause issue with transactions containing pure Native SegWit inputs.
It'll fail anyway if the cold-storage can't sign it. Just always check the final transaction before broadcasting.