Skip to content

fix: remove unused uuid dependency from api-graphql, predictions, and interactions#14788

Merged
bobbor merged 2 commits intoaws-amplify:mainfrom
AdrianoNicolucci:security/upgrade-uuid-package-dependancy
Apr 30, 2026
Merged

fix: remove unused uuid dependency from api-graphql, predictions, and interactions#14788
bobbor merged 2 commits intoaws-amplify:mainfrom
AdrianoNicolucci:security/upgrade-uuid-package-dependancy

Conversation

@AdrianoNicolucci
Copy link
Copy Markdown
Contributor

@AdrianoNicolucci AdrianoNicolucci commented Apr 24, 2026

Summary

Removes the direct uuid dependency from packages that don't need it, consolidating all UUID generation through @aws-amplify/core's amplifyUuid wrapper. This addresses the security advisory GHSA-w5hq-g745-h8pq.

Motivation

Dependabot flagged uuid for an out-of-bounds write vulnerability in v3(), v5(), and v6() when a caller-supplied buffer has an invalid offset. While this project only uses v4() (which is not affected), the cleanest resolution is to remove the unnecessary direct dependency from packages that never use it, and consolidate through core.

Changes

Package Change
@aws-amplify/api-graphql Removed uuid from dependencies — was never imported directly (uses amplifyUuid from core)
@aws-amplify/predictions Removed uuid from dependencies — was never imported anywhere in the package
@aws-amplify/interactions Replaced direct import { v4 as uuid } from 'uuid' with amplifyUuid from @aws-amplify/core/internals/utils, then removed uuid from dependencies

After these changes, uuid exists only as a dependency in @aws-amplify/core (^11.0.0), which is the single package that wraps uuid.v4() via amplifyUuid.

Why not upgrade to uuid@14?

uuid@12+ dropped CommonJS support. Since amplify-js builds both CJS and ESM outputs with uuid kept as an external (not bundled), upgrading would break the CJS build at runtime. Staying on v11 is safe because only v4() is used, which is unaffected by the vulnerability.

Testing

  • No behavioral change — amplifyUuid() is already a direct re-export of uuid.v4()
  • The interactions package already imports from @aws-amplify/core/internals/utils for getAmplifyUserAgentObject, so this follows the existing pattern

@AdrianoNicolucci AdrianoNicolucci requested a review from a team as a code owner April 24, 2026 12:07
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 28, 2026

🦋 Changeset detected

Latest commit: c7015ef

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

This PR includes changesets to release 6 packages
Name Type
@aws-amplify/api-graphql Patch
@aws-amplify/interactions Patch
@aws-amplify/predictions Patch
@aws-amplify/api Patch
@aws-amplify/datastore Patch
aws-amplify 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

@soberm
Copy link
Copy Markdown
Contributor

soberm commented Apr 28, 2026

Thank you for your contribution! There is another file that still uses uuid:

Additionally, please make sure to add a changeset.

… interactions

Remove direct uuid dependency from packages that don't need it to address GHSA-w5hq-g745-h8pq (out-of-bounds write in uuid v3/v5/v6).

- api-graphql: removed uuid dep (already uses amplifyUuid from core)

- predictions: removed uuid dep (never imported)

- interactions: replaced direct uuid import with amplifyUuid from core

The uuid dependency is now consolidated in @aws-amplify/core, which is the only package that wraps uuid v4 via amplifyUuid.
@AdrianoNicolucci AdrianoNicolucci force-pushed the security/upgrade-uuid-package-dependancy branch from a216d01 to 178a8c0 Compare April 29, 2026 11:33
@AdrianoNicolucci
Copy link
Copy Markdown
Contributor Author

Thank you for your contribution! There is another file that still uses uuid:

Additionally, please make sure to add a changeset.

Done

Copy link
Copy Markdown
Member

@bobbor bobbor left a comment

Choose a reason for hiding this comment

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

LGTM. let's do this

@bobbor bobbor merged commit 9fbd3ba into aws-amplify:main Apr 30, 2026
41 checks passed
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.

3 participants