NestJS follows mostly the same security rules as the Node.js server and Express.
NestJS has an dedicated security section in its documentation that addresses these topics:
When it comes to protecting against SQL Injection, I think sanitize input and parameterized statements are the most important.
Overall, however, it is most important that programmers do not cause security holes through code and architecture, but follow with good security practices and as administrators to expose to production hardened services with the least privileges. It is important to educate ourselves in this area all the time.