From SAST to CVE-2025–46337
A static analysis tool flagged a database helper function in the ADOdb PHP library as an SQL injection sink. The author built a proof of concept showing the function could be abused, leading to a CVE.
medium.com
Published on medium.com
From the start of my career in cybersecurity, I have always worked as a black box pentester. Since I believe that learning new topics is always a good use of my time and that I should expand my knowledge of white box penetration testing, I decided to explore the Static Analysis Security Testing (SAST) topic.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the pg_insert_id helper in ADOdb's PostgreSQL driver builds a query from input without proper parameterisation, allowing SQL injection.
What the attacker needed
Code using ADOdb pg_insert_id; ability to influence its input
The fix
The issue was fixed, with the author thanking Dregad for managing the advisory process.
How it was found
- Run SonarQube against Moodle and VtigerCRM source code.
- Note the flagged pg_insert_id sink in the adodb driver files.
- Confirm the function is not called in either project's main code.
- Write a script that calls the vulnerable function to build a proof of concept.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A static analysis tool scans source code without running it and points at places that look dangerous. Here it flagged a helper function in a shared database library, and the author wrote a small test program to confirm the problem was real.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.