Repository navigation
Close two known security holes in the libraries the app ships - #537
Merged
Merged
Conversation
pdfjs-dist 6.1.200 -> 6.3.289. GHSA-hq66-cqwq-w95j (high): "Arbitrary JavaScript execution upon opening a malicious PDF", affecting pdfjs-dist >=5.6.83 <6.2.108. This one is real for us: the app opens builder plansets in pdf.js, and since the Monday connector landed those PDFs arrive from another company's board rather than from someone in this office. Checked the pdf.js release notes for v6.2.108 and v6.3.289 against how we use the library. Every documented api-minor change is a return type moving to Map/Set — getDestinations, getViewerPreferences, getOpenAction, getJSActions, getFieldObjects, getPermissions, and StructElementNode's tableAttributes. We call none of them. What we do use is unchanged: getDocument, getPage, getViewport, page.render({ canvas, canvasContext, viewport }), getTextContent, getAnnotations, numPages and OPS. The legacy build paths and the worker filename are the same, so pdf.ts's import, the ?worker&url entry in pdfWorkerEntry.ts and the workerSrc assignment all still point at real files, and the types still live at pdfjs-dist/types/src/display/api. The Map polyfill stays load-bearing: 6.2.108 added more Map.prototype.getOrInsertComputed calls, including one in CanvasGraphics, which is main-thread rendering code. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
react-router-dom 7.18.1 -> 7.18.3 (which pins react-router 7.18.1 -> 7.18.3). GHSA-qwww-vcr4-c8h2 (high): "RSC Mode CSRF Bypass Allows Action Execution Before 400 Response", affecting react-router 7.12.0 through 7.18.1. It is not exploitable here — this is a Vite single-page app with no server, no React Server Components and no router actions — but leaving a known-high advisory sitting in the audit means the next one that IS real gets lost in the noise. Bumped so `npm audit --omit=dev` reads zero. Stayed inside major 7 on purpose: react-router 8 removed the react-router-dom package entirely, which is what every screen here imports from. That is a migration, not a security fix. Read the 7.18.2 and 7.18.3 notes for anything that touches a plain BrowserRouter app. 7.18.2 is only the RSC CSRF hardening. 7.18.3 is faster route matching for long paths, stricter validation of action request origins (server-side, so nothing here), and stricter validation of client-side navigation targets — that last one rejects programmatic navigation to external destinations, and every navigate() and <Link> in this app goes to an in-app path, so nothing changes. react-router is not listed as a direct dependency and stays that way; react-router-dom depends on the exact matching version, so bumping the one we actually import carries it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two HIGH advisories were showing in
npm audit --omit=dev. This clears both, one commit per package.pdfjs-distreact-router-domreact-router(transitive, pinned byreact-router-dom)npm audit --omit=devnow reports found 0 vulnerabilities.1. pdfjs-dist — the one that matters
GHSA-hq66-cqwq-w95j, high:
"PDF.js: Arbitrary JavaScript execution upon opening a malicious PDF". Vulnerable
range
>=5.6.83 <6.2.108; we were on 6.1.200.This is a real exposure, not a paper one. The app opens builder plansets in pdf.js
(
lib/install/pdf.ts, the planset viewer, the project map, the plan tracer, theschedule and placement readers), and since the Monday connector went live those
PDFs arrive from another company's board rather than from someone in this office.
A booby-trapped sheet was a way to run code inside the app.
^6.2.108resolves to 6.3.289 — npm only publishes 6.1.200, 6.2.108 and 6.3.289in that range, and 6.3.289 is the latest 6.x.
Changelog items checked (v6.2.108 and v6.3.289)
Every
[api-minor]change across those two releases is a return type moving froma plain object to a
Map/Set:getDestinations→ Map ([api-minor] ConvertgetDestinationsto return data in a Map mozilla/pdf.js#21597)getViewerPreferences→ Map ([api-minor] ConvertgetViewerPreferencesto return data in a Map mozilla/pdf.js#21607)getOpenAction→ Map ([api-minor] ConvertgetOpenActionto return data in a Map mozilla/pdf.js#21621)getJSActions→ Map ([api-minor] ConvertgetJSActionsto return data in a Map mozilla/pdf.js#21664)getFieldObjects→ Map ([api-minor] ConvertgetFieldObjectsto return data in a Map mozilla/pdf.js#21671)getPermissions→ Set ([api-minor] ConvertgetPermissionsto return data in a Set mozilla/pdf.js#21738)StructElementNode.tableAttributes→ Map (Let theStructElementNode.prototype.tableAttributesgetter return a Map mozilla/pdf.js#21761)This app calls none of them. What it does call is unchanged:
getDocument,getPage,getViewport,page.render({ canvas, canvasContext, viewport }),getTextContent,getAnnotations({ intent }),numPages, andOPS. Checkedeach against the shipped
types/src/display/api.d.ts—RenderParametersstillaccepts both
canvasandcanvasContext, andcanvasContextis not deprecated.Also checked, because these are the pieces of the integration that are easy to
break on a pdf.js bump:
pdfjs-dist/legacy/build/pdf.mjsandpdfjs-dist/legacy/build/pdf.worker.min.mjsboth still exist in the publishedpackage. We deliberately use the legacy build so older Safari/Chrome can open
plansets, so a rename there would have been silent breakage.
GlobalWorkerOptions.workerSrcis still the way to point at it,and
pdfWorkerEntry.ts(our polyfill wrapper, imported as?worker&url) stillresolves — the built bundle contains
pdfWorkerEntry-*.js.pdfjs-dist/types/src/display/apiis unchanged, which iswhat nine files here import
PDFDocumentProxyandTextItemfrom.lib/mapPolyfill.tsis still load-bearing, more so than before. 6.2.108added more
Map.prototype.getOrInsertComputedcallers, including one inCanvasGraphics.prototype._getPattern(UsegetOrInsertComputedin theCanvasGraphics.prototype._getPatternmethod mozilla/pdf.js#21590) — main-thread rendering code.The polyfill covers exactly that.
No Vite config change was needed.
2. react-router-dom — noise removal, not a fix
GHSA-qwww-vcr4-c8h2, high:
"React Router: RSC Mode CSRF Bypass Allows Action Execution Before 400 Response".
Vulnerable range 7.12.0–7.18.1.
Not exploitable here. This is a Vite single-page app:
BrowserRouter+Routes/Route,useNavigate,useLocation,useParams,useSearchParams.No server, no React Server Components, no router actions, no data router. Bumped
anyway so the audit reads clean and the next advisory that is real does not get
buried under a permanent red line.
Stayed inside major 7 deliberately: react-router 8 removed the
react-router-dompackage outright, which is what all 60 files here import from. That is a
migration, not a security bump.
react-routeris not a direct dependency andstays that way —
react-router-dom@7.18.3depends on the exact matchingreact-router@7.18.3, so bumping the package we actually import carries it.Changelog items checked (7.18.2 and 7.18.3)
itself, and it is RSC-only.
"Improve validation of action request origins" (fix: validate schemeful action origins remix-run/react-router#15420), server-side so nothing
here; "Add additional URL validation on client side navigations/redirects"
([v7] Validate client-side navigation targets remix-run/react-router#15446); plus a
@react-router/nodestreaming fix we don't use.The one worth a second look is remix-run/react-router#15446, since it touches
hooks.tsxandcomponents.tsxand so applies in declarative mode: it makes programmaticnavigation reject external destinations. Grepped every
navigate(...)call andevery
<Link>/<NavLink to=...>insrc/— all of them are in-app paths(
/projects/:id/...,/warehouse,navigate(-1), and so on). Nothing points athttp…,mailto:ortel:, so nothing changes.Gate
gate-generic.shon this branch, port 5183: ALL GREEN.The extraction and planset specs are the ones that carry this change, since they
are what actually drives pdf.js over a real planset.