{
  "id": 23606712,
  "title": "Our auth error page looks its message up in an object literal, so ?reason=constructor renders a card with no title",
  "url": "https://urgent.news/2026/12/05/our-auth-error-page-looks-its-message-up-in-an-object-literal-so",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-12-05T11:29:06.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/daniel_pertu/our-auth-error-page-looks-its-message-up-in-an-object-literal-so-reasonconstructor-renders-a-1nnk"
  },
  "original_language": null,
  "account": "The error page for sign-in links reads a reason from the query string and displays a corresponding explanation. If the reason is unknown, it shows a generic \"Something went wrong\" message. The page's reason-checking logic is written as a lookup in an object literal, which inherits properties from Object.prototype. This includes keys like constructor, toString, hasOwnProperty, valueOf, and __proto__. As a result, an unknown reason like \"constructor\" renders a card with only the logo and a \"Sign in instead\" button, because the primary action of the object is undefined.\n\nThis bug slipped through review because the lookup only reads three fields of the object, and an untrusted query string is highly unlikely to appear by accident. A safer approach would be to only count own keys in the object, use a Map instead of an object literal, or create an object with no prototype. These changes would prevent the lookup from reading inherited keys and ensure the page displays the intended content.",
  "summary": "We have a page for sign-in links that did not work. It reads a reason from the query string and shows a matching explanation: an expired email link gets \"Link expired\" and a button back to sign up; a used or invalid one gets \"Access denied\" and a button to sign in; anything else gets a generic \"Something went wrong\". The lookup is the shape every one of us has written: const reasons : Record <…",
  "summary_source": "publisher",
  "key_points": [
    "Error page fetches reason from query string",
    "Object literal lookup includes inherited keys",
    "Bug caused unknown reason to display incomplete card"
  ],
  "editors_take": null,
  "opinion": false,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "outlets_capped": false,
    "also_reported_by": []
  },
  "machine_translated": false,
  "ai_generated": true,
  "disclaimer": "Accounts, briefs, key points, the editor’s take and translations are written by software from other outlets’ reporting and may contain errors. A summary whose summary_source is \"publisher\" is the outlet’s own feed text. Always check the linked original."
}