r/programming • u/Davipb • Aug 12 '22
RCE Vulnerability found in Electron, affects Discord, Teams, and more
https://www.vice.com/en/article/m7gb7y/researchers-find-vulnerability-in-software-underlying-discord-microsoft-teams-and-other-apps
1.9k
Upvotes
View all comments
Show parent comment
2
u/pancomputationalist Aug 13 '22
Don't know about the issue with
Stream, but I wouldn't say that there is "often" an issue with incorrect types. This is coming from a full stack developer writing Typescript all day, every day.Reasons to have incorrect types:
anytype. This can actually happen a lot with Junior developers. It's a bit like usingreinterpret_castin C++, albeit less scary looking and therefore easier to do. This is an actual problem, but easy to fix: don't useanyThat said, it's true that Typescript allows you to shoot yourself in the foot, if you want to do it (or don't understand why you need correct types).
But nominally typed languages can do the same. Null pointer exceptions are very common, and inheritance and downcasting will often produce similar errors - because this is where the languages also allow you to specify incorrect types.
I guess something like Rust is much safer, and I wouldn't argue that TS is equally safe. But compared to Java, or C++, I doubt that there are measurably more errors in Typescript-Code of similarly knowledgeable programmers.