Skip to content

fix(electron): update examples to patched supported Electron - #115

Open
MahmoudElsayad wants to merge 3 commits into
mainfrom
security/nov6-electron-certificates
Open

MahmoudElsayad wants to merge 3 commits into
mainfrom
security/nov6-electron-certificates

Conversation

@MahmoudElsayad

@MahmoudElsayad MahmoudElsayad commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Why

Both Electron examples lock Electron 41.10.7, which is affected by GHSA-jr5w-w6x2-84p9 (CVE-2026-115570). Dependabot reports it as https://github.com/PSPDFKit/nutrient-web-examples/security/dependabot/1788 and https://github.com/PSPDFKit/nutrient-web-examples/security/dependabot/1780. This PR updates both examples to 43.8.4, which blocks the compromised eMudhra certificates. Electron 43 is the oldest supported major, because Electron 42 reached end of life on October 20: https://releases.electronjs.org/schedule.

What changed

Both manifests require ^43.8.4, and both lockfiles resolve 43.8.4. npm published this version on October 27, more than seven days before this change. No transitive dependency entries change, and the PR adds no overrides.

Each example adds an .npmrc with min-release-age=7 and engine-strict=true, and its engines field requires Node 22.12.0 or later. The engines field does not require an npm version, because the lockfile pins Electron 43.8.4 for any npm version, and an npm requirement broke the SDK bump workflow, which runs Node 22.20.0 with npm 10.9.3. So the 7-day cooldown only takes effect with npm 11.10.0 or later, the first release that enforces min-release-age, and npm 10 ignores the setting without a warning. The READMEs say this, and they also say that Electron 43 downloads its binary on the first npm start instead of during npm install.

How I tested it

  • Biome passes for both manifests, and ./tests/pnpm-workflows.test.sh and git diff --check pass.
  • npm install with npm 11.19.1 and with npm 10.9.3 installs Electron 43.8.4 and Viewer 1.25.0 in both examples, and neither changes the lockfile.
  • I launched both apps on macOS with the Playwright Electron launcher. Electron 43.8.4 opens the sample PDF, and the ink tool draws an annotation in both examples.
  • In the node integration example, Save writes a PDF that contains the ink annotation. The script stubbed the native dialogs in the main process, so it did not exercise the real dialogs.
  • I ran the same script against main with Electron 41.10.7 for comparison.

Existing issues outside this PR

Two failures happen in the same way on main with Electron 41.10.7, so this PR does not cause them. They need a separate fix.

  • In the context isolation example, Save fails with instance.exportPDF is not a function. The toolbar sends the viewer instance to the preload script through contextBridge, which does not keep prototype methods.
  • In the node integration example, Open fails with File not in PDF format or corrupted. for a PDF picked by its absolute path, including the bundled sample PDF.

I did not test packaging with @electron/packager, the native dialog defaults that changed in Electron 43 (https://www.electronjs.org/docs/latest/breaking-changes), or Windows and Linux. The shared browser suite excludes both Electron examples, so CI does not cover the app itself.

@MahmoudElsayad MahmoudElsayad self-assigned this Nov 5, 2026
…in-release-age

npm 11.21.1 is newer than the npm that Node 24 LTS bundles (11.19.1), so the
Playwright workflow failed with EBADENGINE while installing the Electron examples.
npm 11.10.0 is the first release that withholds versions younger than
min-release-age, so the cooldown still holds wherever the install succeeds.
@MahmoudElsayad
MahmoudElsayad marked this pull request as ready for review November 9, 2026 14:44
@MahmoudElsayad
MahmoudElsayad requested a review from a team as a code owner November 9, 2026 14:44

@miguelcalderon miguelcalderon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, the Electron bump looks good and the testing notes are really helpful. One request: please drop the npm 11.10 requirement. The lockfile already pins the patched Electron for any npm version, and the requirement breaks the automated SDK bump, which runs on Node 22 with npm 10. Details inline.

Comment thread examples/electron/package.json Resolved
Comment thread examples/electron/README.md Resolved
Comment thread examples/electron/README.md Resolved
The lockfiles already pin Electron 43.8.4 for any npm version, and the
npm requirement broke the SDK bump workflow, which runs npm 10.9.3.
Also note that Electron downloads its binary on the first npm start.
@MahmoudElsayad
MahmoudElsayad force-pushed the security/nov6-electron-certificates branch from 1805176 to 5a6574e Compare November 11, 2026 13:38

@miguelcalderon miguelcalderon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fixes. The npm requirement is gone and the READMEs read well, so LGTM 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants