Title: [Low][i18n] interpolate/ICU resolve inherited Object.prototype names via 'in' operator (contract violation) · Issue #174 · bQuery/bQuery · GitHub
Open Graph Title: [Low][i18n] interpolate/ICU resolve inherited Object.prototype names via 'in' operator (contract violation) · Issue #174 · bQuery/bQuery
X Title: [Low][i18n] interpolate/ICU resolve inherited Object.prototype names via 'in' operator (contract violation) · Issue #174 · bQuery/bQuery
Description: Severity: 🟢 Low (correctness + minor info-shape leak) Location src/i18n/translate.ts:49-54 (interpolate — if (key in params)); src/i18n/icu.ts:280 (arg node) and :284 (select node). Description Placeholder resolution uses the in operator...
Open Graph Description: Severity: 🟢 Low (correctness + minor info-shape leak) Location src/i18n/translate.ts:49-54 (interpolate — if (key in params)); src/i18n/icu.ts:280 (arg node) and :284 (select node). Description Pla...
X Description: Severity: 🟢 Low (correctness + minor info-shape leak) Location src/i18n/translate.ts:49-54 (interpolate — if (key in params)); src/i18n/icu.ts:280 (arg node) and :284 (select node). Description Pla...
Opengraph URL: https://github.com/bQuery/bQuery/issues/174
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Low][i18n] interpolate/ICU resolve inherited Object.prototype names via 'in' operator (contract violation)","articleBody":"## Severity: 🟢 Low (correctness + minor info-shape leak)\n\n## Location\n[`src/i18n/translate.ts:49-54`](../blob/main/src/i18n/translate.ts#L49-L54) (`interpolate` — `if (key in params)`); [`src/i18n/icu.ts:280`](../blob/main/src/i18n/icu.ts#L280) (`arg` node) and `:284` (`select` node).\n\n## Description\nPlaceholder resolution uses the `in` operator, which walks the prototype chain, then `String(params[key])`. A placeholder whose name matches an `Object.prototype` member (`toString`, `valueOf`, `constructor`, `hasOwnProperty`, `__proto__`, …) is treated as \"present\" even when `params` is `{}`, and is substituted with the inherited value instead of being left as the literal `{name}`.\n\n```ts\ninterpolate('Hello {toString}', {});\n// =\u003e 'Hello function toString() { [native code] }'\n// expected (documented contract): 'Hello {toString}'\n```\nSame for `formatMessage('{x, select, other {{toString}}}', {})`. Impact is limited (`params` is app-supplied and the placeholder must collide with a prototype member), so it is primarily a **contract violation** of \"unmatched placeholders are left intact\", with a minor info-shape leak (native function source) when a translation catalog is attacker/translator-controlled and the param is absent. Not a pollution or code-execution vector.\n\n## Suggested fix\nUse an own-property check consistently at all three sites:\n```ts\nif (Object.prototype.hasOwnProperty.call(params, key)) { … }\n```\nConsider the same guard defensively in `resolveKey` (`translate.ts:20-31`), which currently traverses key segments without a prototype check (mitigated today only because messages are built with `Object.create(null)`).\n\n---\n_Filed as part of a full-codebase security \u0026 correctness audit._\n","author":{"url":"https://github.com/JosunLP","@type":"Person","name":"JosunLP"},"datePublished":"2026-07-05T17:03:41.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/174/bQuery/issues/174"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:54dc0994-8eaf-0937-18e3-392417156d1d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B45E:73567:9B1D9C:E4AAD3:6A4E1CD3 |
| html-safe-nonce | c8a6fb660733fe3d4957c56fd03d3b396e851472356b4e75d7573b781b0e1681 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNDVFOjczNTY3OjlCMUQ5QzpFNEFBRDM6NkE0RTFDRDMiLCJ2aXNpdG9yX2lkIjoiMTE1ODk1MjA5MTQ0NTUwMTEzOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 05c9c88da8d2d9eb9b78f281bdfd7e454be1604004e3cbc2ed7cadc6451de4fc |
| hovercard-subject-tag | issue:4813695941 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/bQuery/bQuery/174/issue_layout |
| twitter:image | https://opengraph.githubassets.com/17cf703fadd4267556c95dc55dd51b22b06dc004ada447bafffadfa0361d904a/bQuery/bQuery/issues/174 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/17cf703fadd4267556c95dc55dd51b22b06dc004ada447bafffadfa0361d904a/bQuery/bQuery/issues/174 |
| og:image:alt | Severity: 🟢 Low (correctness + minor info-shape leak) Location src/i18n/translate.ts:49-54 (interpolate — if (key in params)); src/i18n/icu.ts:280 (arg node) and :284 (select node). Description Pla... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JosunLP |
| hostname | github.com |
| expected-hostname | github.com |
| None | 030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/bQuery/bQuery git https://github.com/bQuery/bQuery.git |
| octolytics-dimension-user_id | 256381806 |
| octolytics-dimension-user_login | bQuery |
| octolytics-dimension-repository_id | 1139284244 |
| octolytics-dimension-repository_nwo | bQuery/bQuery |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1139284244 |
| octolytics-dimension-repository_network_root_nwo | bQuery/bQuery |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5fe497b4815fcce3df76c0e246faa739a82c3124 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width