19 of 424 JSON-LD blocks were ... Note

19 of 424 JSON-LD blocks were not JSON. Every one had JavaScript stapled to the end.

The author audited structured data across 114 domains, analyzing a total of 424 JSON-LD blocks from 287 pages. Despite appearing valid to schema-checking tools, 19 of these blocks, spread across seven domains, failed JSON parsing. Each failing block contained extraneous data: a base64-encoded JavaScript snippet appended after the valid JSON object. This injected code, found in an eval() function, was designed to log a URL and numeric code based on a past timestamp.Crucially, because the code was within an "application/ld+json" script tag, browsers treat it as data and never execute it. This means the malicious payload remained inert, preventing any visible impact that might have prompted a fix. The silent failure led to 17 affected pages losing all usable structured data, as their only block became unparsable. This indicated a template-level injection rather than individual page errors, affecting all sampled pages on those specific domains.Beyond the injection, a larger issue was identified: 56 out of 70 pages carrying JSON-LD contained only site-level schema like Organization or BreadcrumbList, lacking vital page-specific entities like Article. Furthermore, some Article nodes were missing author properties or even @type declarations, rendering them effectively invisible to crawlers.The author emphasizes that structured data validators often miss these issues because they only process already-parsed JSON objects. To address this, a new deploy check was implemented. This check now specifically fails builds if any JSON-LD block causes a JSONDecodeError or contains suspicious executable JavaScript patterns.The immediate fix involves rebuilding templates for the seven affected domains to remove the injected code. The broader challenge is to implement a strategic decision to ensure every page type includes relevant page-level entities, a more substantial and ongoing task. The author concludes that while the injection was a dramatic find, the more insidious problem is the widespread absence of meaningful page-level structured data, which goes unnoticed.