Developers can familiarize themselves with the vulnerabilities in Bitcoin nodes that can be exploited to replace legitimate peer addresses with their own.
As you can see, attackers can exploit the above-mentioned vulnerabilities. However, there are also some ways to avoid them: