SQL Injection Affecting github.com/go-pg/pg/types package, versions >=4.0.0


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.04% (13th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about SQL Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-GOLANG-GITHUBCOMGOPGPGTYPES-10345754
  • published13 Jun 2025
  • disclosed12 Jun 2025
  • creditPaul Gerste

Introduced: 12 Jun 2025

CVE-2024-44905  (opens in a new tab)
CWE-89  (opens in a new tab)

How to fix?

There is no fixed version for github.com/go-pg/pg/types.

Overview

Affected versions of this package are vulnerable to SQL Injection in the /types/append_value.go component. When a placeholder is directly preceded by a minus - and not separated by any whitespace, the library does not handle the particular case when a negative number is inserted for the placeholder. This leads to two consecutive minus signs in the query, turning them into the start of a line comment.

Note:

To exploit this behavior and cause SQL Injection, the following conditions must be met by a parameterized query:

  1. a placeholder for a numeric value must be immediately preceded by a minus (as described above).

  2. there must be a second placeholder for a string value after the first placeholder; both must be on the same line.

  3. both parameter values must be user-controlled.

CVSS Base Scores

version 4.0
version 3.1