As a freelancer, I inherit a lot of poorly developed custom web projects. Most of these projects do not safeguard against XSS and SQL injection. On some of these projects, I've been the sole developer for over 1 year. When clients ask me to add new features, I do it without making significant changes to the underlying system's architecture.
So for example, if a client asked me to build a registration page on a limited budget, I do so re-using the system's Data Access Objects which do not prevent SQL injection, and I render the pages with the system's View Objects which do not sanitize the code for XSS.
If at a later time, a hacker exploits these security breaches in the registration page, am I held accountable? I was never asked to re-write the systems Data Access Objects or the View Objects. And because the client is on a limited budget, they won't pay me to write a new DAO or View for the system. So does it automatically become my fault the day I decide to inherit such a disastrous project?
And what if there are other parts of a system I rarely touched? I may have gone in to change some of the text on the views, or added a new if
statement in the controller. Once I've "touched" something, does it mean I am liable for the entire module until I retire from the project?