Code security is directly proportional to the amount of resources devoted to finding and fixing bugs regardless of open or closed. If nobody is maintaining the code, it doesn’t matter.
One advantage with open you is that you can look at the version control to see how active the code is being maintained.
TIL that Linux users are a bunch of lucky crabs.