I haven't tried using Trezor wallet but I have been using my Ledger Nano S for quite a few months now and have never encountered such security flaws when it comes to connecting your Ledger device to my personal computer. As far as I know, the private keys that has been generated by your HW is protected by a specialized secure chip called a "
Secure Element" in order for your private keys to never leave the device and to protect it regardless if you accidentally connect it to a compromised computer..
[1]
https://www.ledger.com/academy/security/the-secure-element-whistanding-security-attacks/I also don't see any articles or news yet regarding this kind of issue.