Intel

AIKIDO-2026-532883

pg is vulnerable to SQL Injection

Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Oct 13, 2026
October 13, 2026

59

CVE Score

Medium

SQL Injection

Are you affected? Scan for Free

TL;DR

PG::Connection#set_client_encoding passes the caller supplied encoding name into a command sent to the PostgreSQL backend. When an application forwards a user controlled or externally influenced encoding value to this method, unescaped SQL metacharacters in that value reach the backend as part of the command, so unexpected SQL executes on the connection. The patch stops building that command from the raw unvalidated argument.

How do I fix this?

Upgrade the pg library to the patch version.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you pass a user controlled or externally influenced value to set_client_encoding.

Package

Versions

0.7.9.2008.01.28 - 1.6.3

Fixed in 1.7.0

Background info

pg is vulnerable to SQL Injection in versions 0.7.9.2008.01.28 - 1.6.3.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea