Skip to content

fix: upgrade open to v11 to address GHSA-jgwm-4pmq-r4w4 - #952

Open
chetan2002 wants to merge 1 commit into
adobe:masterfrom
chetan2002:fix-open-11
Open

chetan2002 wants to merge 1 commit into
adobe:masterfrom
chetan2002:fix-open-11

Conversation

@chetan2002

Copy link
Copy Markdown

Description

Upgrades open from ^8.4.2 to ^11.0.4.

open@11 is ESM-only, so require('open') no longer works: it throws ERR_REQUIRE_ESM on Node 20 and gives "open is not a function" on Node 22+. Each call site now loads it with const { default: open } = await import('open'). This is the same pattern @adobe/aio-cli-plugin-console already uses.

Changed:

  • app run: src/commands/app/run.js, 2 call sites.
  • app deploy: src/commands/app/deploy.js.
  • The tests now mock open with jest.unstable_mockModule. The unit-test script already runs jest with --experimental-vm-modules.

No behavior change: the same URLs are opened at the same points.

Related Issue

Security advisory GHSA-jgwm-4pmq-r4w4 (CVE-2026-119025). There is no separate issue in this repo.

Motivation and Context

open versions 7.2.0 through 10.x are affected by a command injection on Windows/WSL (PowerShell). The fix is only in open@11; there is no backport to 8.x.

The @adobe/aio-cli lockfile currently resolves open@8.4.2 through this plugin. aio-cli can't drop the vulnerable version until this plugin is released with open@11.

The plugin's engines already require Node >=20.17.0, which open@11 (node >=20) supports, so this is not a breaking change.

How Has This Been Tested?

Tested on macOS with Node 20.17.0, 22.23.4 and 24.22.3.

  • npm test: 943/943 unit tests pass with 100% coverage on all three Node versions.
  • Regression check: removing the open(...) call makes the run and deploy tests fail.
  • Real open@11, not mocked: I replaced the system open launcher with a stub that records its arguments. It launched the expected URL.
  • Integration with @adobe/aio-cli: I packed this plugin and installed it into aio-cli.
    • aio-cli's lockfile no longer contains open@8.4.2.
    • aio-cli's unit tests and e2e tests pass on all three Node versions.
    • aio app run --help and aio app deploy --help load.

Known issue, also present on the base branch: npm run lint fails on exactly Node 20.17.0, because neostandard is ESM-only and can't be require()d. Lint passes on Node 22 and 24. CI uses the latest Node 20.x.

Not tested: launching on actual Windows/WSL.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes. (Updated the existing open tests in run.test.js and deploy.test.js.)
  • All new and existing tests passed.

open@11 is ESM-only, so load it with a dynamic import at the call site.
@codecov

codecov Bot commented Dec 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@chetan2002
chetan2002 marked this pull request as ready for review December 1, 2026 10:08
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.

1 participant