That's not an open source problem, though; that's a supply chain problem. Some random little proprietary freeware isn't better.
The problem isn't the open source (in fact, that's better). The problem is downloading random shit from the internet, and the biased assumption that open-source == trustworthy.
Debian repos are not NPM. Yes, the package are actually vetted to some degree.
At least with open source you have a chance to prevent this. With proprietary its pure trust.
It can happen anywhere, really