Skip to content
SQL injection Write-up Intermediate

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.

Marco Nappi, on medium.com

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

  1. Run SonarQube against Moodle and VtigerCRM source code.
  2. Note the flagged pg_insert_id sink in the adodb driver files.
  3. Confirm the function is not called in either project's main code.
  4. 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.

Similar reports

View all

Same bug class and techniques, clearest first.

SQL injection

The lesson behind this report.

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.