Perhaps the best quote I've seen in a long time: "These kinds of attacks are common in smart contracts because many developers do not put in the legwork to define security properties for their code..." I'm sure that this would apply to many kinds of software, not just smart contracts.
This is from an article on a hacker that stole money by altering a smart contract. In this case, tokens used to replace parts of the contract overwrote other tokens, which allowed a smart hacker to change prices and make more money. Or steal it, with a contract change, I don't know that theft is actually the correct term.
The wider issue here is poor developer practices, and really, not listening to the results of security audits and making changes in code. Maybe they listened to the audits and hadn't completed the work. There were some critical issues, and some remediation, but not enough in this case.
Building security into software is hard. The threat landscape changes and hackers are incredibly creative. It is hard for developers to keep up, but it is important, especially where there are finances involved. There are tools to perform security assessments and automated pen-testing. Everyone ought to use these, and more importantly, management should take security more seriously. If they don't, they deserve some sort of penalty.
The problem for many of us is that we can raise issues, but we are powerless to do anything. We can change jobs, but that's not practical all the time. We can continue to raise awareness, but that can be detrimental to our careers. After all, management will get tired of us repeating ourselves at some point.
Mostly what we get to do is worry. We worry that the company will get penalized, which can affect our employment. We can worry that management will blame us for an issue they didn't allow us to fix or give us the tools to detect. We can worry management will blame us for not knowing about an issue as well.
I believe we ought to have more focus on security, but I'm not sure what that means or how to achieve this in a practical sense. I don't even know how we're set up regulations and penalties for such a complex situation.
Mostly I'm just sad for the state of software security.