| Package | Affected versions | Patched versions |
|---|---|---|
| github.com/jackc/pgx | ≤ 3.6.2all versions | |
| github.com/jackc/pgx/v4 | ≤ 4.18.3all versions | |
| github.com/jackc/pgx/v5 | < 5.9.2 | 5.9.2 |
| pgx | < 5.9.2 | 5.9.2 |
SQL Injection can occur when:
e.g.
attackValue := `$tag$; drop table canary; --`
_, err = tx.Exec(ctx, `select $tag$ $1 $tag$, $1`, pgx.QueryExecModeSimpleProtocol, attackValue)
This is unlikely to occur outside of a contrived scenario.
The problem is resolved in v5.9.2.
Do not use the simple protocol to execute queries matching all the above conditions.
Running one of these products? Scan your site to see whether it exposes a vulnerable version.
Scan my site free