← Back to Blog

Fix the class, not the instance: Yalguun Tumenkhuu on hunting bugs in MariaDB’s connectors

More than 90 security reports, 14 CVEs, and one finding that got fixed across five connectors. A conversation with the researcher behind them about drivers as attack surface, incomplete fixes, and what changes when AI agents get database access.

Yalguun Tumenkhuu
Yalguun Tumenkhuu (fg0x0), Cyber Security Lead at Khan Bank and HackerOne’s Brand Ambassador for Mongolia

Most of the security work around MariaDB that users never see happens in the connectors: the libraries in C, C++, Java, R2DBC, Node.js, Python and ODBC that every application uses to talk to the server. Over the past period, more than 90 reports on MariaDB have come from one researcher, most of them in those drivers. Fourteen have CVEs so far, and many more are triaged and waiting for their fix. One Connector/J report, about memory allocated from a count the server sends, led MariaDB to fix the same pattern in four more connectors: R2DBC, Node.js, C and Python.

That researcher is Yalguun Tumenkhuu, known online as fg0x0. He is Cyber Security Lead at Khan Bank in Mongolia, HackerOne’s Brand Ambassador for Mongolia, an OffSec and EC-Council instructor, and the creator of FantasM, a Mongolian-language security YouTube channel. We asked him how he hunts, why database drivers are a trust boundary few people audit, what DBAs and hosting providers should check first, and what worries him about AI agents with database access.

Getting started

You’ve been on HackerOne since 2019 and run a security YouTube channel in Mongolian. How did you get into offensive security, and what did the path look like from Ulaanbaatar?

As a kid I wanted to be a hacker. Not a “cybersecurity professional”, a hacker. From first grade I was taking computers apart and putting them back together, swapping parts just to see what would happen. At the Mongolian University of Science and Technology I could have studied software engineering, but I chose security, because it meant learning to write code and also how to attack and defend it.

Mongolia has few security professionals, but competition among them is strong, so I kept testing myself in different directions to find what would make me stand out. One of those experiments was FantasM, my YouTube channel. Many people in our field prefer to stay behind the keyboard, but I enjoy explaining what I learn, so in 2018, while still a student, I started making security videos in Mongolian.

In 2019 I sent my first HackerOne report and started working as a penetration tester. Over the next five years I tested banks, OT environments and private companies, led a team of pentesters, and became an official OffSec and EC-Council instructor, training more than 200 engineers toward certifications like OSCP and OSWE. I was also a member of the Synack Red Team. Today I am a Cyber Security Lead at Khan Bank and do open source research alongside it.

The path from Ulaanbaatar was slower than it would have been from a big tech hub. Most good resources were in a second language, and there were almost no mentors or bug bounty hunters nearby to learn from. But it taught me early that open source and bug bounty do not care where you live: if the bug is real and the report is clear, it gets fixed.

You hold OSCP and the full OSCE³ set. Which of those exams changed how you actually work, and which skills did you have to learn outside any certification?

OSWE changed my daily work the most. It trained me to read source code like an attacker: find where untrusted input enters, then follow it until it reaches something dangerous. That way of reading is behind almost all of my open source research. OSED did the same for C and C++ (lengths, buffers and memory handling), which is where my memory-safety findings in the connectors come from. OSEP shaped how I think about authentication bypass and privilege escalation chains. Teaching OffSec courses since 2019 deepened all three, because you only really understand a technique once you have explained it to a room of engineers.

What no certification taught me:

  • Reading a project’s history. Advisories, fix commits, issues and tests show what the developers think the bug was, and that is where the missed cases hide.
  • Protocol work, like writing a fake server to see how a client reacts to bytes it never expected.
  • Writing reports that maintainers want to act on: a clear threat model, an honest severity rating and a negative control.

An exam ends when you get a shell. A report only ends when someone can fix the bug.

How he hunts

In your AWS CLI write-up you describe “incomplete-fix hunting”: reading a vendor’s own patches and looking for the place they missed. Why does that work so well, and how do you pick which patches to study?

A security fix is a map. It tells you the bug class, the dangerous function and how the developer thought about the problem. But developers usually fix the instance in the report, not the pattern behind it. When the same pattern lives in several files, an older branch or a sister library in another language, some copies often stay behind.

The AWS CLI case shows it well. Within a few months AWS had fixed the same problem in four places: files holding secrets kept loose permissions if they already existed before the CLI wrote to them. I asked one question: what is the most sensitive file this tool writes? The answer was the credentials file, and none of the four fixes covered it. Reading the fixes, finding the fifth case and confirming it took about 30 minutes. AWS fixed it in v1.45.14 and v2.34.53.

How I pick patches to study:

  • Recent fixes in widely used code, where the patch touches one call site but the pattern clearly appears elsewhere.
  • Fixes whose tests only cover the exact input from the original report.
  • Projects with sibling implementations. That is why the MariaDB connectors suit this so well: seven libraries speak the same protocol in different languages, so a bug fixed in one is a question for the other six.

Walk us through a normal hunting session. How much is reading code, how much is tooling, and how much is just curiosity?

Most of it is reading. I start with the project’s recent advisories and fix commits, then read the code around them until I understand what the developers believe the code guarantees. Bugs live where the code does not do what they believe.

Tooling gives me breadth. I use AI agents to map large codebases, list every place a pattern appears and suggest leads, work that used to take days. But a lead is not a finding. Every candidate gets the same treatment: I build the exact released version, write a proof of concept against it, and run a negative control (the same test with the vulnerable condition removed, or with a fix applied) so I know the bug causes the result, not my setup. Most leads die at this step, and that is fine.

Curiosity picks the targets. A question like “what does this driver do when the server says a field is huge?” has found me more bugs than any scanner.

Your accepted reports range from AWS and Google to curl, Django and MariaDB. What makes open source infrastructure different to research than a company’s web app?

Three things. First, you can see everything: code, history, tests and past advisories. It is white-box research, and the history is often more useful than the code itself.

Second, impact multiplies. A bug in a web app affects one company. A bug in curl, Django or a database driver ships inside thousands of products whose owners have never read that code.

Third, the threat model is the hard part. In a web app the attacker is usually obvious: someone sending requests. In a library you have to argue who controls the input: the application’s user, an attacker on the network, or a malicious server. A good infrastructure report spends as much effort on that question as on the bug.

There is also no production system to test against, so I test the released artifact, the same jar from Maven Central or the same package from PyPI that users install. Maintainers trust a report much more when it reproduces on what their users actually run.

The MariaDB connectors

Most of your MariaDB findings are in the connectors rather than the server: Connector/ODBC, Connector/J, r2dbc-mariadb and the Node.js driver. What drew you to the drivers?

Drivers sit on a trust boundary that very few people audit. Every application that talks to MariaDB links one, and the driver does three risky jobs at once: it escapes values for the application, it handles credentials during authentication, and it parses bytes that arrive over the network. Each job maps to a bug class I found: SQL injection when escaping does not understand the connection’s character set, credentials sent in cleartext during authentication, and memory problems when a size or value from the network is trusted without checking it.

The second reason is the shape of the ecosystem. There are official connectors for C, C++, Java, R2DBC, Node.js, Python and ODBC, all speaking the same protocol. When I found a problem in one, the obvious next question was whether the other six had it too. Often they did. That turned single findings into a map, and it is why most of my more than 90 MariaDB reports are in the connectors.

One of your r2dbc reports showed a single injected packet could make the driver serve one user’s rows to another. Without going beyond the public advisory, can you explain in plain terms why that class of bug matters to people who never think about their driver?

A database connection is a conversation in strict order. The application asks, the server answers, and the driver hands each answer back to the question that asked for it. Imagine a waiter who never checks which table ordered what and simply brings each table the next plate from the kitchen. If someone slips one extra plate into the line, every table after that gets the previous table’s food, and nobody notices.

That is the class of bug in that report: one injected message, and answers start going to the wrong questions. In a web application that shares a pool of connections between many users, the wrong question can belong to a different user. The technical details belong in the advisory, so I will keep it at this level.

It matters to people who never think about their driver because their own code is correct. The queries are parameterized and the access checks pass, and the data still reaches the wrong person, because the mistake happens underneath the application. The attacker does need a way to get bytes into the connection, for example a compromised proxy or a network path without TLS. That is one more reason to encrypt and verify database connections.

Many developers treat the database driver as plumbing they install once and forget. What would you want them to do differently after reading your reports?

Treat the driver as part of your attack surface, not as plumbing.

  • Update it like any other dependency. Connector releases carry security fixes, and many applications pin one version for years. Put the driver in your dependency scanning and follow its advisories.
  • Encrypt the database connection and verify the server certificate. Encryption without verification still lets an attacker on the network in, and several connector bugs only matter when that check is missing.
  • Know how your driver handles parameters. Many drivers escape values on the client instead of sending them separately, and several of the SQL injection bugs I found were in that client-side escaping, for example under multi-byte character sets. Use server-side prepared statements where the driver supports them, and a utf8mb4 connection character set.
  • Enable only the features you use. Cleartext authentication plugins and LOCAL INFILE are useful in some setups and risky in most.
  • Never let untrusted input choose which server you connect to. Many driver bugs need a malicious server, and that stops being theoretical the moment a user or an AI agent can supply a connection string.

Disclosure and working with maintainers

What did the reporting process with MariaDB look like from your side, from first report to public disclosure?

Straightforward, and more technical than most programs I work with. I report through MariaDB’s HackerOne program, and the people triaging are the engineers who maintain the code, so the questions are the right ones: what exactly does the attacker need to control, and what do they gain? Once, a maintainer’s question showed that the premise behind my own severity rating was wrong, and I corrected my report. That kind of exchange makes the result better for both sides.

Triaged issues get a ticket in MariaDB’s JIRA, and fixes ship in the following releases. Fourteen of my MariaDB findings so far have CVEs, and many more are triaged and waiting for their fix. The best moment was a Connector/J report about memory being allocated from a count the server sends. MariaDB fixed it, then fixed the same pattern in four more connectors: R2DBC, Node.js, C and Python. That is the outcome I hope for: the class fixed, not only the instance. That report was also made public on HackerOne at MariaDB’s own request.

They were also clear about the threat model. At one point they explained that a malicious server is largely outside what a connector is expected to defend against. That made me more careful: for those reports I state the precondition up front and argue the real impact instead of assuming it counts. Several still became fixes, and some became advisories. My view is simple: a client should not fall over just because a server lies to it.

I am grateful to the MariaDB team for taking every report seriously, even when I sent a lot of them.

From a researcher’s point of view, what makes an open source project easy or hard to report to? What should maintainers do more of?

Easy: a SECURITY.md that names one channel, a stated threat model, engineers who answer on technical substance, and a public tracker where the fix and the credit end up. MariaDB has most of that.

Hard: no security policy and private vulnerability reporting switched off, so the only option left is a public issue. Long silence after the first acknowledgment. And scope pages that say “out of scope” without saying why, so you cannot tell whether a finding is unwanted or just misunderstood.

What I would ask maintainers to do more often: when you fix a security bug, search for the same pattern before you close the ticket. Many of my findings would not exist if every fix had been followed by a grep. And tell the researcher when the fix grows beyond the report. It shows them where to stop looking, and it is good to hear.

Your write-up has a section on handling “needs more info” from triage. What’s your advice for researchers whose reports get pushback?

Treat it as a question, not an attack. “Needs more info” usually means the triager cannot see the impact the way you do yet, and it is your job to close that gap.

In the AWS CLI case, triage asked whether credential files with loose permissions really exist in practice. Instead of arguing, I listed six real situations where that happens, with examples. I also pointed out that AWS’s own four earlier fixes had already forced restrictive permissions on existing files. If keeping existing permissions were the intended design, those fixes would not exist. The report went back to “New” in 25 minutes.

My rules:

  • Answer every question they asked, in order.
  • Separate what you confirmed from what you assumed, and say plainly what you did not test and why.
  • Use the vendor’s own fixes, documentation and tests as evidence.
  • If their question shows your severity was wrong, correct it yourself.
  • Be patient. One of my reports needed five rounds of questions before it was triaged.

Don’t argue. Demonstrate.

For DBAs and hosting providers

Many hosting providers still run end-of-life database versions and old client libraries. If you had five minutes with their engineering lead, what would you tell them to check first?

Start with the client side, because almost nobody inventories it. Customers’ applications bundle connector libraries inside container images, language runtimes and frameworks, and those copies keep their bugs long after the server is upgraded. The first question I would ask: which client libraries are in the images we ship and support, and when did they last get a security release?

Then three quick checks:

  1. Versions. Is any server or client library past end of life? End of life means a bug found tomorrow will never be fixed for you.
  2. Exposure. Can the database port be reached from the internet, or from other customers’ networks? It should not be.
  3. Transport. Is the connection between application and database encrypted, and does the client verify the server certificate? Encryption without verification is not enough.

If those three are clean, look at accounts next: who has broad privileges, and are any credentials shared between customers?

Which security mistake do you see most often in real database deployments, the one that isn’t exotic but keeps showing up?

Over-privileged application accounts. The application connects as root, or as a user with every privilege on every database, and the password sits in a config file that more people and systems can read than anyone realizes. Nothing about it is exotic, which is exactly why it survives. But it turns any small bug (an SQL injection, a leaked config file, a compromised app server) into full control of the data.

The fix is boring and it works: one account per application, only the privileges that application needs, no FILE or administrative privileges, and credentials in a secret store instead of the repository. In internal network assessments, a database password found in a config file is one of the most common steps in the attack chains I see.

AI and what’s next

You’ve spoken about AI and machine-speed security, and you’ve looked at AI tools like Flowise and coding agents. How is AI changing vulnerability research, for attackers and for people like you?

AI has made reading code cheap. For incomplete-fix hunting that is a big change: checking a patch against every sibling code path used to be slow manual work, and now an agent does the first pass in hours.

That speed works for attackers too. The time between a fix being published and someone finding the case it missed is getting shorter. That is the theme of my MNSEC 2026 talk, “Ghost in the Network: The Machine Hunts, the Chain Falls”: an AI agent can now drive a whole attack chain at machine speed, but human judgment still decides the outcome. For maintainers the lesson is simple: fix the class, not the instance, because someone will check the siblings much faster than before.

In practice, I use AI together with my own knowledge and experience, not instead of them. The agent gives me speed, but deciding which fix to study, which question to ask and whether a finding really matters comes from years of pentesting and reading code. Every lead also goes through my own review. Agents produce confident leads that are wrong, and maintainers already receive low-quality AI-generated reports. My rule: nothing leaves my hands until I have reproduced it myself on a real build, with a negative control. The research is faster now. Being right still takes the same work.

AI tools are also a new attack surface. Workflow builders and coding agents take untrusted text and turn it into actions on your machine. The bugs there are often old ones in new places, like a guard that blocks the short form of a command-line flag but not the long one.

More and more AI agents get direct access to databases. What worries you about that, and what would make you more comfortable?

What worries me is the combination: an agent that reads untrusted text, holds powerful database credentials and writes its own SQL. Prompt injection then becomes SQL injection with extra steps. A support ticket, an email or a web page tells the agent what to run, and the agent runs it with the permissions of whoever set it up, often an administrator.

There is a link to my driver research too. Many connector bugs need a malicious server, which used to be an unusual precondition. An agent that accepts connection details from a conversation can be talked into connecting wherever the attacker wants.

What would make me more comfortable:

  • A separate database account per agent with minimum privileges, read-only by default, ideally limited to views rather than whole tables.
  • Tools that run fixed, parameterized queries instead of free-form SQL.
  • Human approval for anything that writes, deletes or changes the schema.
  • Connection targets fixed in configuration, never taken from prompts.
  • Full logging, so you can see afterwards what the agent did and why.

Community

You teach in Mongolian through FantasM and your open repos. Why is teaching in your own language important to you, and what does the security community in Mongolia look like today?

Because language decides who gets to start. Almost every good security resource is in English, and that filters out many talented people before they write a single line of code. Teaching in Mongolian removes that first wall. I have been making FantasM since 2018, and it now has around 30,000 subscribers and more than 2 million views. For many students it is their first contact with ethical hacking. The open repos follow the same idea: material students can run on their own laptops, like the web exploitation lab I published for my class.

The community in Mongolia is small but growing fast. We have a national CTF, Haruul Zangi. My team won it in 2024 and 2025, and in 2026 I wrote challenges for it. There is MNSEC, our security conference, where I have been a speaker since 2021, and a group of bug hunters on international platforms that gets bigger every year. I also host 100 Hackers, a podcast where I talk with Mongolian hackers.

Two things are still missing: mentors, and local companies with their own vulnerability disclosure programs. I am working on both, people first. I teach a year-long program that takes students from zero to their first real bug reports, and as HackerOne’s Brand Ambassador for Mongolia I am starting the Mongolia HackerOne Club, beginning with an Intro to Bug Bounty workshop in Ulaanbaatar on 21 November 2026.

What would you say to a student who wants to start contributing to open source security, especially from a country with a smaller tech scene?

Your location matters much less than you think. Open source code, advisories and fix commits are public, and a good report from Ulaanbaatar is read exactly the same way as one from San Francisco.

Practical advice:

  • Start with software you already use, and read its last ten security fixes. For each one, ask what the fix might have missed.
  • Reproduce old vulnerabilities before you look for new ones. It teaches you the code and the tools at the same time.
  • Go deep on one ecosystem instead of skimming many.
  • Write clearly. Your English does not need to be perfect, but your steps, impact and evidence do.
  • Be honest in your reports. Say what you tested and what you did not. Reputation compounds.
  • When you can, send the fix together with the report.

And if there is no community where you live, start one. Two people meeting every week is already a community.

Quick-fire

One tool you can’t work without?

A terminal. With a terminal I can do almost anything. Where I can, I skip ready-made commercial software and build my own tools or write scripts around open source ones. I have a lot of jobs, so I automate as much as possible, but verifying results, organizing them and finding something new I always do by hand.

A bug class you think is still underrated?

Incomplete fixes. Strictly speaking it is not a bug class, but it is where engineers slip most often: the reported case gets fixed, and the variant right next to it keeps working for whoever looks.

The best security talk, book or write-up you’d recommend to our readers?

0xdf’s blog. When I was starting out I learned on Hack The Box, and 0xdf’s write-ups, together with IppSec’s and xct’s videos, kept me motivated and gave me ideas for my own channel. His posts are clean, and there is something to learn from every one. These days I spend more time on 0-day research and variant hunting than on Hack The Box, but 0xdf’s blog is still where I would send anyone starting out.

If you weren’t hunting bugs, what would you be doing?

Everything else I already do. Besides my job at Khan Bank, I teach PI Academy’s year-long Zero to Hero program, make videos for FantasM, often together with companies, and represent Mongolia as HackerOne’s Brand Ambassador. When there is time, I also run penetration tests and training for local companies. I work seven days a week as it is, so without bug hunting I would simply have more time for all of that.

Find Yalguun online

Interview by the MariaDB Foundation. Answers lightly edited for length and flow.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *