Description
pg-protocol through 1.16.1 (node-postgres pg through 8.23.1) contains a NUL byte injection vulnerability in the startup() serializer that allows attackers to add server parameters. Attackers who influence connection values like application_name or database can inject search_path or a second database key to change the session's database or schema resolution.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| brianc | pg-protocol | 0 ≤1.16.1 | — |
References
- https://github.com/brianc/node-postgres/blob/0980cefebe0ae461da8883703be049fe13ca96cf/packages/pg-protocol/src/serializer.ts#L21-L35
- https://github.com/brianc/node-postgres/blob/0980cefebe0ae461da8883703be049fe13ca96cf/packages/pg-protocol/src/buffer-writer.ts#L39-L51
- https://github.com/brianc/node-postgres/blob/0980cefebe0ae461da8883703be049fe13ca96cf/packages/pg/lib/client.js#L543-L571
- https://www.vulncheck.com/advisories/pg-protocol-through-1.16.1-nul-byte-injection-via-startupmessage-parameters