CVE-2025-4318: @aws amplify/codegen ui react AWS Amplify Studio UI Component Vulnerability

CRITICAL
Advisory Identifier: GHSA-hf3j-86p7-mfw8
CWE-95
Published
Advisory Summary

CVE-2025-4318 is a CRITICAL aws amplify studio ui component vulnerability (CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection')) affecting @aws amplify/codegen ui react libraries in the npm ecosystem. The issue involves aws amplify studio ui component properties has an input validation issue. Remediation is available by upgrading affected packages to version 2.20.3.

CVE-2025-4318 at a Glance

CVE Identifier CVE-2025-4318
GHSA Identifier GHSA-hf3j-86p7-mfw8
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection')
Affected Product @aws amplify/codegen ui react
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2025-4318

To remediate this vulnerability, upgrade all affected @aws amplify/codegen ui react dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@aws-amplify/codegen-ui-react fixed: 2.20.3
npm install @aws-amplify/codegen-ui-react@2.20.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @aws-amplify/codegen-ui-react

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2025-4318, inspect your project dependencies using npm:

npm ls @aws-amplify/codegen-ui-react

Analyze the terminal output to locate any version of @aws amplify/codegen ui react in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.20.3), your application is affected.

Note: The npm ls @aws-amplify/codegen-ui-react command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection'), where the product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes code syntax before using the input in a dynamic evaluation call (e.g. "eval"). In @aws amplify/codegen ui react, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary The AWS Amplify Studio [amplify-codegen-ui](https://github.com/aws-amplify/amplify-codegen-ui) is a package that generates front-end code from UI Builder entities (components, forms, views, and themes) primarily used in AWS Amplify Studio for component previews and in AWS Command Line Interface (AWS CLI) for generating component files in customers' local applications. An issue exists in the Amplify Studio property binding process of the `amplify-codegen-ui `package that could potentially allow an authenticated user to run arbitrary JavaScript code during the component rendering and build process. ### Impact When importing a component schema using the [create-component](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/amplifyuibuilder/create-component.html) command, Amplify Studio will import and generate the component on the users' behalf. The expression-binding function does not validate the component schema properties before converting them to expressions. As a result, an authenticated user who can create or modify components could run arbitrary JavaScript code during the component rendering and build process. **Impacted versions: <=2.20.2** ### Patches This issue has been addressed partially in version [2.20.3](https://github.com/aws-amplify/amplify-codegen-ui/pull/1174) and additional fixes in [2.20.4](https://github.com/aws-amplify/amplify-codegen-ui/pull/1196). We recommend upgrading to the latest version and ensuring any forked or derivative code is patched to incorporate the new fixes. ### Workarounds There are no workarounds. Upgrade to version [2.20.4](https://github.com/aws-amplify/amplify-codegen-ui/releases/tag/v2.20.4). If you have any questions or comments about this advisory, AWS asks that you contact AWS/Amazon Security via the [issue-reporting page](https://aws.amazon.com/security/vulnerability-reporting/) or directly via email to [aws-security@amazon.com](mailto:aws-security@amazon.com). Please do not create a public GitHub issue. ### Credit AWS would like to thank `ray the bounty hunter` for collaborating on this issue through the coordinated issue disclosure process.

CVE-2025-4318 Affected @aws amplify/codegen ui react Versions

1 component(s)
Fixed Versions:
2.20.3
Product / Package Ecosystem Affected Versions Fixed Version
@aws-amplify/codegen-ui-react
npm
< 2.20.3
2.20.3

References

Frequently Asked Questions

What is CVE-2025-4318?
CVE-2025-4318 is a security vulnerability in @aws amplify/codegen ui react involving AWS Amplify Studio UI Component Properties Has an Input Validation Issue under CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection').
Which @aws amplify/codegen ui react versions are affected?
Affected versions include releases prior to 2.20.3 across affected packages: @aws-amplify/codegen-ui-react.
What version fixes CVE-2025-4318?
Upgrading to 2.20.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @aws-amplify/codegen-ui-react affected?
Yes, @aws-amplify/codegen-ui-react is affected in releases prior to 2.20.3. Upgrade your dependency to 2.20.3 or later.
What CWE is associated with CVE-2025-4318?
CVE-2025-4318 is classified under CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection') (The product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes code syntax before using the input in a dynamic evaluation call (e.g. "eval").).
How can I check npm dependencies for CVE-2025-4318?
Run the dependency tree command: 'npm ls @aws-amplify/codegen-ui-react'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-hf3j-86p7-mfw8",
  "modified" : "2026-07-30T20:57:24Z",
  "published" : "2026-07-30T20:57:24Z",
  "aliases" : [ "CVE-2025-4318" ],
  "summary" : "AWS Amplify Studio UI Component Properties Has an Input Validation Issue",
  "details" : "### Summary\nThe AWS Amplify Studio [amplify-codegen-ui](https://github.com/aws-amplify/amplify-codegen-ui) is a package that generates front-end code from UI Builder entities (components, forms, views, and themes) primarily used in AWS Amplify Studio for component previews and in AWS Command Line Interface (AWS CLI) for generating component files in customers' local applications.\n\nAn issue exists in the Amplify Studio property binding process of the `amplify-codegen-ui `package that could potentially allow an authenticated user to run arbitrary JavaScript code during the component rendering and build process.\n\n### Impact\nWhen importing a component schema using the [create-component](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/amplifyuibuilder/create-component.html) command, Amplify Studio will import and generate the component on the users' behalf. The expression-binding function does not validate the component schema properties before converting them to expressions. As a result, an authenticated user who can create or modify components could run arbitrary JavaScript code during the component rendering and build process. \n\n**Impacted versions: <=2.20.2**\n\n### Patches\nThis issue has been addressed partially in version [2.20.3](https://github.com/aws-amplify/amplify-codegen-ui/pull/1174) and additional fixes in [2.20.4](https://github.com/aws-amplify/amplify-codegen-ui/pull/1196). We recommend upgrading to the latest version and ensuring any forked or derivative code is patched to incorporate the new fixes.\n\n### Workarounds\nThere are no workarounds. Upgrade to version [2.20.4](https://github.com/aws-amplify/amplify-codegen-ui/releases/tag/v2.20.4).\n\nIf you have any questions or comments about this advisory, AWS asks that you contact AWS/Amazon Security via the [issue-reporting page](https://aws.amazon.com/security/vulnerability-reporting/) or directly via email to [aws-security@amazon.com](mailto:aws-security@amazon.com). Please do not create a public GitHub issue.\n\n### Credit\nAWS would like to thank `ray the bounty hunter` for collaborating on this issue through the coordinated issue disclosure process.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@aws-amplify/codegen-ui-react"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.20.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.20.2"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/aws-amplify/amplify-codegen-ui/security/advisories/GHSA-hf3j-86p7-mfw8"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-4318"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/aws-amplify/amplify-codegen-ui/commit/ca98c38b7c3d69ae7c94d2f62b51e32e8165dae6"
  }, {
    "type" : "WEB",
    "url" : "https://aws.amazon.com/security/security-bulletins/AWS-2025-010"
  }, {
    "type" : "WEB",
    "url" : "https://blog.securelayer7.net/cve-2025-4318-aws-amplify-rce"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/aws-amplify/amplify-codegen-ui"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/aws-amplify/amplify-codegen-ui/releases/tag/v2.20.3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-95" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-30T20:57:24Z",
    "nvd_published_at" : "2025-05-05T19:15:57Z"
  }
}