Why Relying on LLMs for Code Can Be a Security Nightmare Relying on large language models (LLMs) to generate code without human security review can introduce serious vulnerabilities, as LLMs often replicate insecure patterns found in online examples. The article illustrates this with a real-world case where a JavaScript file, likely generated by an LLM, exposed a full email API endpoint and parameters in client-side code, allowing anyone to send arbitrary requests to the backend. The author warns that while security issues in example code are not new, LLMs scale the problem by blindly reproducing these flaws, making human oversight essential for threat modeling and abuse prevention. Why Relying on LLMs for Code Can Be a Security Nightmare Table of Contents I wanted to quickly highlight something I have noticed in multiple cases but this time let me explain with a real example. When code is written purely using LLMs vibe coded security often takes a back seat. LLMs work on data and most of what is available at training time essentially scraping the internet is NOT “secure by default” A lot of examples floating around online are meant to demonstrate functionality not teach security best practices. When those patterns are blindly reused or auto generated by an LLM the same insecure logic ends up in production code. This is NOT my first time stumbling across such issues. Some time ago, I found a bug in Coinbase’s x402 pay-per-view example code not in the core library itself, just the example . When I reported it through HackerOne, it was marked as informational—since the problem was only in the sample code. That experience stuck with me because it shows that even official documentation can contain insecure examples. If developers copy paste blindly, those vulnerabilities end up in live apps even when the code is not generated using LLM. And that’s the point: security issues in example code are not new. But with LLMs the problem scales faster, because LLMs often mimic those same insecure patterns. Now, let me share a live example I came across recently. The Vulnerable App details redacted ⌗ While browsing, I came across a JavaScript file on a site hosted on railway.com popular PaaS. The file contained this lightly paraphrased code: // Form Submission Handling const smtp api = "https://