Skip to content

Conversation

@james-elicx
Copy link
Collaborator

This PR bumps / overrides certain deps to address the following security issues flagged in a Snyk scan.

  ✗ Allocation of Resources Without Limits or Throttling [Medium Severity][https://security.snyk.io/vuln/SNYK-JS-BODYPARSER-14105059] in body-parser@2.2.0
    introduced by express@5.1.0 > body-parser@2.2.0
  This issue was fixed in versions: 2.2.1
  ✗ Regular Expression Denial of Service (ReDoS) [Low Severity][https://security.snyk.io/vuln/SNYK-JS-BRACEEXPANSION-9789073] in brace-expansion@2.0.1
    introduced by @node-minify/core@8.0.6 > glob@9.3.5 > minimatch@8.0.4 > brace-expansion@2.0.1
  This issue was fixed in versions: 1.1.12, 2.0.2, 3.0.1, 4.0.1
  ✗ Improper Input Validation [Medium Severity][https://security.snyk.io/vuln/SNYK-JS-NANOID-8492085] in nanoid@3.3.7
    introduced by next@16.0.10 > postcss@8.4.31 > nanoid@3.3.7
  This issue was fixed in versions: 3.3.8, 5.0.9
  ✗ Allocation of Resources Without Limits or Throttling [High Severity][https://security.snyk.io/vuln/SNYK-JS-QS-14724253] in qs@6.14.0
    introduced by express@5.1.0 > qs@6.14.0 and 1 other path(s)
  This issue was fixed in versions: 6.14.1

It also bumps the pnpm version used in the pipelines so that catalog overrides are respected.

@changeset-bot
Copy link

changeset-bot bot commented Jan 8, 2026

🦋 Changeset detected

Latest commit: 72beed9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@opennextjs/aws Patch
app-pages-router Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 8, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@opennextjs/aws@1075

commit: 72beed9

@james-elicx james-elicx marked this pull request as ready for review January 8, 2026 17:57
typescript: 5.9.3
esbuild: 0.25.4

overrides:
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a big fan of overrides...
Can we figure out if we depend on them at runtime?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

qs and body-parser are for express which is used by the express-dev wrapper and unlikely to ever be used by a consumer. brace-expansion is a deeply nested dependency of @node-minify/core which is used to minify JS in the server bundle.

These overrides are 1 patch version above the version that is currently depended on because those patches were released solely to resolve the security issue in their respective libraries.

],
"dependencies": {
"@ast-grep/napi": "^0.40.0",
"@aws-sdk/client-cloudfront": "3.398.0",

Choose a reason for hiding this comment

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

BTW, is this exact pinning really necessary? GHSA-6475-r3vj-m8vf

Copy link
Contributor

Choose a reason for hiding this comment

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

Aws has proven to be not very good at respecting semver, they had some big breaking changes at times (that broke thing for a few versions and was fixed after)
I think we should keep pinning, but just update the SDK and ensure that everything works, maybe in another PR

@james-elicx james-elicx requested a review from vicb January 13, 2026 09:31
"cookie": "^1.0.2",
"esbuild": "catalog:",
"express": "^5.1.0",
"express": "^5.2.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think express should be moved to the dev dependencies.

And because it's only used in dev, we should not have to override any package for security reason (qs here) WDYT?


overrides:
"qs@6.14.0": ^6.14.1
"brace-expansion@2.0.1": ^2.0.2
Copy link
Contributor

Choose a reason for hiding this comment

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

brace-expansion is a deeply nested dependency of @node-minify/core which is used to minify JS in the server bundle.

IIUC correctly, this is used to minify JSON only. I don't think there is much to minimize in JSON files.

So what we could do instead is to drop the dep and use parse followed by stringify(o, null, 0).

@conico974 anything I miss here?

overrides:
"qs@6.14.0": ^6.14.1
"brace-expansion@2.0.1": ^2.0.2
"nanoid@3.3.7": ^3.3.8
Copy link
Contributor

Choose a reason for hiding this comment

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

-> % pnpm -F  @opennextjs/aws why nanoid         
Legend: production dependency, optional only, dev only

@opennextjs/aws@3.9.11 /Users/vberchet/code/work/aws/packages/open-next

dependencies:
next 16.0.10
└─┬ postcss 8.4.31
  └── nanoid 3.3.7

I would say that no override is necessary here.
postcss is build time.

IMO the best thing to do here is ask Next to update postcss if not done in their latest version?

Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

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

Changes look good to me, beside the overrides.

I have several concern with overrides:

  • Even if the bump is small, we end up with non tested code. I have verified quite a few times that whatever is non tested doesn't work
  • If we override 9 with 10 but the original package update to 11 then we will still be pinned at 10

So I think we should strive to avoid overrides unless there is a critical reason not to. I don't think there is in this (see my inline comments)

@james-elicx
Copy link
Collaborator Author

No worries, I'll close this if there isn't much appetite for it.

For context, at work we have a policy of removing issues flagged by security tools from our apps wherever possible (we don't use OpenNext, but if we did, these would be flagged by one of our tools and we'd be asked to do something about them), so it's common to override deeply nested dependencies if there's a patched non-breaking version.

If we override 9 with 10 but the original package update to 11 then we will still be pinned at 10

I don't think this would be the case because the override is only for applying to a specific version of the dependency - if they upgrade, the override wouldn't apply anymore as the version is different to the one it's set to apply to.

@vicb
Copy link
Contributor

vicb commented Jan 22, 2026

I don't think this would be the case because the override is only for applying to a specific version of the dependency - if they upgrade, the override wouldn't apply anymore as the version is different to the one it's set to apply to.

Oh right, I missed that

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.

4 participants