GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — [Security] Prototype pollution via server-supplied column names in result rows · Issue #3654 · brianc/node-postgres Closed Labels DescriptionSplit from #3651 as suggested by @charmander. SummaryWhen a PostgreSQL server returns column names like Affected code
// addFields() builds the pre-built empty result object: const row = {} for (let i = 0; i < fieldDescriptions.length; i++) { const desc = fieldDescriptions[i] row[desc.name] = null // desc.name comes from server } this._prebuiltEmptyResultObject = { ...row } // parseRow() assigns parsed values using server-supplied field names: parseRow(rowData) { const row = { ...this._prebuiltEmptyResultObject } for (let i = 0, len = rowData.length; i < len; i++) { const field = this.fields[i].name // server-controlled row[field] = this._parsers[i](v) // value also server-controlled } return row } Threat modelThis is a rogue server scenario, not a trusted-config issue. If a client connects to a malicious PostgreSQL server (e.g. via DNS hijack, MITM without TLS verification, or a compromised host), the server controls the column names in Steps to reproduce
Impact
Suggested fixUse const row = Object.create(null) Activity
|
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |