René's URL Explorer Experiment


Title: [Security] Prototype pollution via server-supplied column names in result rows · Issue #3654 · brianc/node-postgres · GitHub

Open Graph Title: [Security] Prototype pollution via server-supplied column names in result rows · Issue #3654 · brianc/node-postgres

X Title: [Security] Prototype pollution via server-supplied column names in result rows · Issue #3654 · brianc/node-postgres

Description: Split from #3651 as suggested by @charmander. Summary When a PostgreSQL server returns column names like __proto__, constructor, or toString, these are used as object keys in result rows without any sanitization. A rogue or compromised P...

Open Graph Description: Split from #3651 as suggested by @charmander. Summary When a PostgreSQL server returns column names like __proto__, constructor, or toString, these are used as object keys in result rows without an...

X Description: Split from #3651 as suggested by @charmander. Summary When a PostgreSQL server returns column names like __proto__, constructor, or toString, these are used as object keys in result rows without an...

Opengraph URL: https://github.com/brianc/node-postgres/issues/3654

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Security] Prototype pollution via server-supplied column names in result rows","articleBody":"Split from #3651 as suggested by @charmander.\n\n## Summary\n\nWhen a PostgreSQL server returns column names like `__proto__`, `constructor`, or `toString`, these are used as object keys in result rows without any sanitization. A rogue or compromised PostgreSQL server can exploit this to pollute `Object.prototype` on the client.\n\n## Affected code\n\n`packages/pg/lib/result.js` — both `addFields()` and `parseRow()`:\n\n```js\n// addFields() builds the pre-built empty result object:\nconst row = {}\nfor (let i = 0; i \u003c fieldDescriptions.length; i++) {\n  const desc = fieldDescriptions[i]\n  row[desc.name] = null  // desc.name comes from server\n}\nthis._prebuiltEmptyResultObject = { ...row }\n\n// parseRow() assigns parsed values using server-supplied field names:\nparseRow(rowData) {\n  const row = { ...this._prebuiltEmptyResultObject }\n  for (let i = 0, len = rowData.length; i \u003c len; i++) {\n    const field = this.fields[i].name  // server-controlled\n    row[field] = this._parsers[i](v)   // value also server-controlled\n  }\n  return row\n}\n```\n\n## Threat model\n\nThis 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 `RowDescription` messages. A column named `__proto__` with a crafted value can pollute the prototype chain of all objects in the Node.js process.\n\n## Steps to reproduce\n\n1. Set up a mock PostgreSQL server that returns a `RowDescription` with a field named `__proto__` and a `DataRow` with the value `{\"polluted\": true}` (as a JSON/text column)\n2. Connect a `pg` client to this server and execute any query\n3. After the result is parsed, check `({}).polluted` — it will be `true`\n\n## Impact\n\n- Denial of service (crash or undefined behavior in downstream code)\n- Potential RCE depending on how the application uses objects after pollution\n\n## Suggested fix\n\nUse `Object.create(null)` instead of `{}` for result rows, or reject/rename column names that collide with `Object.prototype` properties:\n\n```js\nconst row = Object.create(null)\n```","author":{"url":"https://github.com/eddieran","@type":"Person","name":"eddieran"},"datePublished":"2026-04-13T09:19:04.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/3654/node-postgres/issues/3654"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:5f66b2c3-8b55-4da0-cc88-17f7c40d8859
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA71C:25435F:2F2FCE:430826:6A4BC3FE
html-safe-noncea98da8cd4b2a8bc451c23430f8c5a965302a0ad36c665f1b0f6cef8e86893fc1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzFDOjI1NDM1RjoyRjJGQ0U6NDMwODI2OjZBNEJDM0ZFIiwidmlzaXRvcl9pZCI6IjMwMTY4NzQ1MjQ3MjcyOTcwMjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac4ea431a320eeac7005ed70e90328cba3a66001fc819e3808e43a93a7d49f937c
hovercard-subject-tagissue:4253073426
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/brianc/node-postgres/3654/issue_layout
twitter:imagehttps://opengraph.githubassets.com/db9f41cfdb3178af2b577cb7f35a288fc82e8273ebbd27a54a515ea9d2f9380a/brianc/node-postgres/issues/3654
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/db9f41cfdb3178af2b577cb7f35a288fc82e8273ebbd27a54a515ea9d2f9380a/brianc/node-postgres/issues/3654
og:image:altSplit from #3651 as suggested by @charmander. Summary When a PostgreSQL server returns column names like __proto__, constructor, or toString, these are used as object keys in result rows without an...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameeddieran
hostnamegithub.com
expected-hostnamegithub.com
None14aa00ce5bdb34d0eefb5facbffd7de9e144c688d8a93ef8df902d5f94b51dd7
turbo-cache-controlno-preview
go-importgithub.com/brianc/node-postgres git https://github.com/brianc/node-postgres.git
octolytics-dimension-user_id50081
octolytics-dimension-user_loginbrianc
octolytics-dimension-repository_id991475
octolytics-dimension-repository_nwobrianc/node-postgres
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id991475
octolytics-dimension-repository_network_root_nwobrianc/node-postgres
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release58b8f89190447502561829f30862aa0a99d53367
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/brianc/node-postgres/issues/3654#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fbrianc%2Fnode-postgres%2Fissues%2F3654
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fbrianc%2Fnode-postgres%2Fissues%2F3654
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=brianc%2Fnode-postgres
Reloadhttps://github.com/brianc/node-postgres/issues/3654
Reloadhttps://github.com/brianc/node-postgres/issues/3654
Reloadhttps://github.com/brianc/node-postgres/issues/3654
brianc https://github.com/brianc
node-postgreshttps://github.com/brianc/node-postgres
Please reload this pagehttps://github.com/brianc/node-postgres/issues/3654
Notifications https://github.com/login?return_to=%2Fbrianc%2Fnode-postgres
Fork 1.3k https://github.com/login?return_to=%2Fbrianc%2Fnode-postgres
Star 13.2k https://github.com/login?return_to=%2Fbrianc%2Fnode-postgres
Code https://github.com/brianc/node-postgres
Issues 451 https://github.com/brianc/node-postgres/issues
Pull requests 59 https://github.com/brianc/node-postgres/pulls
Discussions https://github.com/brianc/node-postgres/discussions
Actions https://github.com/brianc/node-postgres/actions
Wiki https://github.com/brianc/node-postgres/wiki
Security and quality 0 https://github.com/brianc/node-postgres/security
Insights https://github.com/brianc/node-postgres/pulse
Code https://github.com/brianc/node-postgres
Issues https://github.com/brianc/node-postgres/issues
Pull requests https://github.com/brianc/node-postgres/pulls
Discussions https://github.com/brianc/node-postgres/discussions
Actions https://github.com/brianc/node-postgres/actions
Wiki https://github.com/brianc/node-postgres/wiki
Security and quality https://github.com/brianc/node-postgres/security
Insights https://github.com/brianc/node-postgres/pulse
[Security] Prototype pollution via server-supplied column names in result rowshttps://github.com/brianc/node-postgres/issues/3654#top
https://github.com/hjr3
bughttps://github.com/brianc/node-postgres/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com/eddieran
eddieranhttps://github.com/eddieran
on Apr 13, 2026https://github.com/brianc/node-postgres/issues/3654#issue-4253073426
#3651https://github.com/brianc/node-postgres/issues/3651
@charmanderhttps://github.com/charmander
hjr3https://github.com/hjr3
bughttps://github.com/brianc/node-postgres/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.