Advisories for Golang/Github.com/Jackc/Pgx/V5 package

2026

pgx: SQL Injection via placeholder confusion with dollar quoted string literals

SQL Injection can occur when: The non-default simple protocol is used. A dollar quoted string literal is used in the SQL query. That string literal contains text that would be would be interpreted as a placeholder outside of a string literal. The value of that placeholder is controllable by the attacker. e.g. attackValue := $tag$; drop table canary; -- _, err = tx.Exec(ctx, select $tag$ $1 $tag$, $1, pgx.QueryExecModeSimpleProtocol, attackValue) …

pgx: SQL Injection via placeholder confusion with dollar quoted string literals

SQL Injection can occur when: The non-default simple protocol is used. A dollar quoted string literal is used in the SQL query. That string literal contains text that would be would be interpreted as a placeholder outside of a string literal. The value of that placeholder is controllable by the attacker. e.g. attackValue := $tag$; drop table canary; -- _, err = tx.Exec(ctx, select $tag$ $1 $tag$, $1, pgx.QueryExecModeSimpleProtocol, attackValue) …

2024

pgproto3 SQL Injection via Protocol Message Size Overflow

Impact SQL injection can occur if an attacker can cause a single query or bind message to exceed 4 GB in size. An integer overflow in the calculated message size can cause the one large message to be sent as multiple messages under the attacker's control. Patches The problem is resolved in v2.3.3 Workarounds Reject user input large enough to cause a single query or bind message to exceed 4 …