AI finds the bugs now. For both sides.
Over the last few months, AI has helped find a remote code execution flaw in GitHub's git infrastructure, an 18-year-old vulnerability in NGINX, a zero-day in the Linux kernel and critical holes in Grafana Enterprise.
That's great news for defenders. It's also the problem: if AI can find these bugs so we can fix them, attackers can use the same models to find them first. And they already do.
While most of us were excited about AI writing code faster, we didn't spend much time on the obvious follow-up question: what happens when the same tools are pointed at the systems they helped build?
This post goes through the most important AI-discovered vulnerabilities of 2025 and 2026, the breach in Ecuador that exposed close to 15 million people, and what I think it means for how we build software.
Three bugs AI found
GitHub, CVE-2026-3854: RCE with a git push
In early 2026, researchers at Wiz used AI to find a critical remote code execution bug in GitHub's internal git infrastructure:
- CVSS: 8.7 (high)
- Impact: RCE on GitHub.com and GitHub Enterprise Server
- How they found it: AI-assisted reverse engineering of closed-source binaries
It's one of the first critical bugs found this way in closed-source code. The researchers said they'd been "chasing this target since September 2024" but couldn't justify the effort of traditional reverse engineering, which would have taken weeks or months. With AI, they got there.
The exploit was almost embarrassingly simple: an authenticated user could run arbitrary commands on GitHub's backend with a git push. On GitHub.com that meant code execution on shared storage nodes holding repositories from millions of other users and organizations. On GitHub Enterprise Server, it meant full server compromise: every repository and every internal secret.
GitHub mitigated it on GitHub.com within six hours of the report. But at disclosure, 88% of Enterprise Server instances were still vulnerable, which is the part that should worry anyone running self-hosted infrastructure.
NGINX, CVE-2026-42945: hiding since 2008
In April 2026, the AI security company DepthFirst found a critical buffer overflow in NGINX that had been there since 2008:
- Affected versions: 0.6.27 (November 2008) through 1.30.0 (April 2026)
- Impact: remote code execution and denial of service
- How they found it: AI-driven code analysis
Nobody found it in eighteen years because it needs a very specific setup: a configuration that combines the rewrite and set directives in particular patterns, plus ASLR turned off, which is rare but happens in some VMs and embedded deployments. With that in place, a single unauthenticated request could trigger the overflow.
NGINX runs a big share of the world's busiest sites, banks, e-commerce and cloud providers included. The AI's advantage here was patience: reasoning through combinations of configuration and edge cases that normal testing never explores.
Linux kernel, CVE-2025-37899: a zero-day found with o3
In May 2025, security researcher Sean Heelan published how he used OpenAI's o3 model to find a zero-day in the Linux kernel, in ksmbd, the in-kernel SMB3 server. It was a use-after-free: when several connections bind to the same session, one thread handling a LOGOFF frees sess->user while another thread is still using it.
Heelan gave o3 about 12,000 lines of the ksmbd code and asked it to look for use-after-free bugs. What's interesting is how it found it. It didn't just match a pattern; it reasoned about concurrency, followed the logic across threads and proposed an unsafe interleaving that most linters would never flag.
The uncomfortable implication: if a researcher can find a kernel zero-day with a publicly available model, so can an attacker.
Ecuador: when bad security meets national ID data
While AI was finding bugs in software, Ecuador was going through one of the worst data breaches I've seen, and it had nothing to do with clever AI.
In May 2026, dark web monitoring picked up a massive breach of the Dirección General de Registro Civil, Identificación y Cedulación (DIGERCIC), the national civil registry. A group calling itself "L4TAMFUCKERS" claimed a "joint operation" and published:
- 14.8 million records (10.8 GB of SQL)
- 10.6 million high-resolution ID card images (165 GB)
- full names and national ID numbers
- biometric data: fingerprints and face images
- digital signatures
Ecuador has roughly 12 to 13 million adults. In practice, this is almost every adult in the country.
Why it's so bad
A password can be changed. A credit card can be cancelled. Your fingerprint and your face can't. Once they're out, they're out for good, and that changes the risk completely:
- Deepfakes for KYC bypass. High-resolution ID photos are exactly what you need to fool identity checks on financial platforms.
- Identity theft at scale. Photo, signature, ID number and biometrics: everything needed to impersonate someone.
- A very long tail. This data will keep circulating for years, maybe decades.
- Broken trust. Everything that relies on the civil registry as the source of truth, from social security to electronic voting, is now built on compromised data.
How it probably happened
The Registro Civil denied a direct breach of its current systems and said the data came from "external sources" or "historical records". At the same time, the institution reported more than 3.5 million attack attempts between 2024 and 2025, mostly around elections.
We don't know the exact entry point. The usual suspects in cases like this are SQL injection, compromised admin accounts, misconfigured cloud storage, no encryption at rest and weak access control. The data showed up on Dark Forums, with a free sample published to prove it was real. The Superintendencia de Protección de Datos opened an investigation, but the damage was done.
The "L4TAM" in the name suggests an actor focused on Latin American governments, and it isn't the first case: Ecuador's Agencia Nacional de Tránsito (ANT) has had leaks too, and other countries in the region have seen similar attacks. Poor security in critical government systems isn't just negligence. It's a national security problem.
The same tool on both sides
AI doesn't care which side it's on. Copilot helps you write code faster, ChatGPT suggests whole functions, agents refactor a codebase in seconds. The same models can look at the authentication logic they wrote and find the hole in it.
Attackers are already using AI to:
- dig through legacy code looking for patterns humans missed, like that 18-year-old NGINX bug
- turn a vulnerability description into a working exploit quickly
- automate reconnaissance: map the attack surface, find weak spots and prioritize targets
- write phishing that's very hard to tell apart from a real email
- brute-force defenses, trying thousands of payloads to get past a WAF or input validation
So we're in an arms race where both sides have the same tools, and the real question is who's faster. Right now attackers have an edge for a simple reason: defenders have to protect everything, and attackers only need one gap.
The holes AI leaves in your own code
There's also a quieter problem: AI-generated code often ships with security bugs, because the models learned from a lot of public code full of bad habits. The ones I see most:
Unsafe deserialization.
import pickle
data = pickle.load(open("user_data.pkl", "rb")) # runs arbitrary code if the file isn't trusted
No input validation.
app.get('/user/:id', (req, res) => {
const userId = req.params.id;
db.query(`SELECT * FROM users WHERE id = ${userId}`); // SQL injection
});
Secrets in the code.
API_KEY = "sk-1234567890abcdef" # now it's in Git forever
Also common: concurrent code without proper synchronization (the same family of bug as the kernel one above) and error handling that leaks stack traces or internal details to the user.
If you use AI to write code faster, you also ship vulnerabilities faster. Without real security review, it becomes a very efficient way to produce them.
What I'd actually do
The good news is that defense can use AI too. This is what I'd put in place:
Audit your code with AI before someone else does. CodeQL with GitHub code scanning and Copilot Autofix, Snyk, Semgrep. Run them in CI on every pull request, not once a year:
semgrep --config=auto --json > security-report.json
Ask for security explicitly. "Write a login function" gets you a login function. "Write a login function with bcrypt, rate limiting, CSRF protection, parameterized queries, input validation and secure sessions" gets you something you can ship.
Never trust generated code blindly. Review it for input validation, authentication and authorization, secret handling, error handling and injection (SQL, XSS, commands).
Use AI for threat modeling. "Look at this auth flow and tell me how you'd attack it, considering the OWASP Top 10" is a surprisingly useful prompt.
Layer your defenses. A WAF, rate limiting, encryption at rest and in transit, zero trust between services, MFA, and monitoring that catches anomalies in real time. No single layer is enough.
Keep dependencies updated. Bugs found by AI are being patched constantly, and npm audit or pip-audit only help if you actually run them.
Train the team. Security is a people problem as much as a technical one: secure coding practices, regular reviews, pentests, phishing drills and a culture where raising a concern is normal.
If you build AI features, secure them too. Follow the OWASP guidance for LLM applications, defend against prompt injection and data poisoning, protect your training data and watch how the model behaves in production.
Encrypt sensitive data properly. The Ecuador lesson: keys in an HSM, TLS 1.3 in transit, fine-grained access control (ABAC) and logs of who accesses what.
Assume you'll be breached. Have an incident response plan, a notification process, tested backups and the ability to investigate what happened.
Can we win this?
AI is finding vulnerabilities faster than we can patch them, and attackers are using it to exploit systems faster than we can secure them. Eighteen-year-old NGINX bugs, an RCE in GitHub found through AI-assisted reverse engineering, a kernel zero-day found with a public model, and 15 million people exposed by basic security failures.
The optimistic view is that AI can also be our best defense: scanning at scale, real-time detection, finding risks before they're exploited and helping write patches faster. The pessimistic view is that attackers only need one bug, have no ethical constraints, have money as a motive and work in the dark.
What I actually believe is in between: security is a continuous process, not something you finish. Invest in AI-assisted defense, teach people to write secure code, build security into the development process, share threat intelligence across companies and countries, and regulate how AI is used in this space.
If AI writes your code, it can also break it. The same tools that make us faster make us more exposed. So start now: audit your systems, train your team and use AI for defense before someone uses it against you. Breaches will happen. The worst case is one you never find out about.
What did you think?
Found this article helpful? Share it!
Help others discover this content by sharing it on your favorite platform.



