concept legacy code in category security

This is an excerpt from Manning's book Secure by Design.
You have now gained a conceptual view of why bounded contexts are important and how context maps are created, but we still need to show you how they relate to security. In the upcoming chapters, you’ll see how bounded contexts help when analyzing code from a security point of view; for example, in chapter 9, when looking at failure handling, or in chapters 12 and 13, when working with legacy code.
You’ll start by learning why ambiguous parameters in methods and constructors are a common source of security flaws. Then you’ll learn what to look out for when logging and why defensive code constructs are problematic. We then show you how seemingly well-designed code can have subtle issues that cause security issues. At the end of this chapter, you’ll learn about some mistakes that are commonly made when introducing domain primitives in legacy code and what to watch out for when you start implementing domain primitives.