PDF.js viewer pages need origin-aware inventory, not a library version claim
PDF.js viewer pages need origin-aware inventory, not a library version claim PDF.js is often embedded as a viewer in another application. The page may show a PDF title, a toolbar, or a document URL without identifying
PDF.js viewer pages need origin-aware inventory, not a library version claim
PDF.js is often embedded as a viewer in another application. The page may show a PDF title, a toolbar, or a document URL without identifying the JavaScript library that renders it. A public count of viewer pages can help a document-platform owner find the right assets, but the origin and embedding context matter more than the library name.
The fixed measurement on November 23, 2026 returned zero matches for app="PDF.js", 431 for title="PDF.js", and 2,530 for http.body="PDF.js viewer". The scope was sub_type=all, page 1, page size 1. These are index matches, not confirmed vulnerable viewer instances.
The browser boundary is the security boundary
The PDF.js FAQ says the viewer runs with the permissions of ordinary JavaScript and follows the browser's same-origin policy. That means a viewer served beside an authenticated application shares the browser's origin model unless the deployer separates it. A malicious PDF can only reach what the viewer origin can reach, and those permissions should be designed deliberately.
The project has also disclosed historical arbitrary-JavaScript behavior when eval-based execution was enabled. Teams should inspect the current configuration instead of assuming a default from an old release. Pay attention to isEvalSupported, viewer origin settings, message handlers, and any wrapper that accepts document URLs.
Turn a title match into a deployment review
Use the application query, title query, and body query as separate leads. Confirm ownership before opening a document. A viewer page may be a public documentation portal, a customer file link, or an internal application that leaked through a proxy.
For an owned viewer, record the origin, parent-frame allowlist, CSP, package version, and document source. Test a PDF that tries to call a dangerous URL or reach the parent application. Check whether the iframe sandbox and browser policies block the attempt.
Operate the viewer safely
Pin the package and worker build together. Review advisories before updating. Serve untrusted documents from a separate origin and keep cookies and application storage out of that origin. Sanitize document titles and links. Monitor anomalous document loads and viewer-origin errors.
The count of 431 title matches is a discovery lead. A useful inventory links each viewer page to its owner, embedded application, document source, and browser boundary. That mapping is more durable than a count of pages that happen to include the product name.
References
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.