basic flaws like buffer overflows, command injections, and SQL injections
I teach students how to avoid these kinds of flaws in my basic programming courses. Most students don't understand the importance, or don't care, or are actually incapable of avoiding these issues in their programs.
It's yet another aspect of a well-known issue: We have a massive demand for software, but very few programmers are actually competent. I've taught in high-quality degree programs: maybe 10% of the students are really good, and another 30%-40% could contribute competently - as long as they are supervised by someone good. Those are self-selected students in high-quality degree programs.
In less technical degree programs, where I also teach some programming courses, I feel fortunate to have 1 or 2 students who have any real potential. The other learn to copy-and-paste (or, now, use AI), without any real understanding of what they are doing. These make up the vast majority of programmers out there, and they are the reason why injection attacks are still a thing.
FWIW: This is especially true in Asian software sweat-shops: rooms full of people pasting in code with no clue what they are doing, while their boss walks around looking over their shoulders, telling each person what their next task is. Push out code, fast and cheap, that's all that matters.