CVE-2025-4318: Input validation issue in AWS Amplify Studio UI component properties
Summary The AWS Amplify Studio 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 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 and additional fixes in 2.20.4. 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.
If you have any questions or comments about this advisory, AWS asks that you contact AWS/Amazon Security via the issue-reporting page or directly via email to 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.
Other sources
The AWS Amplify Studio UI component property expressions in the aws-amplify/amplify-codegen-ui package lack input validation. This could potentially allow an authenticated user who has access to create or modify components to run arbitrary JavaScript code during the component rendering and build process.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/@aws-amplify/codegen-ui-reactto a version that resolves this vulnerability.Fixed in 2.20.3 - Upgrade
Upgrade
amplify-codegen-ui (aws-amplify/amplify-codegen-ui)to a version that resolves this vulnerability.Fixed in 2.20.4
Event History
Frequently Asked Questions
What is the severity of CVE-2025-4318?
CVE-2025-4318 is classified as a critical vulnerability due to its potential to allow arbitrary code execution.
How do I fix CVE-2025-4318?
Fix CVE-2025-4318 by upgrading to the latest version of AWS Amplify Studio that includes input validation improvements.
Who is affected by CVE-2025-4318?
CVE-2025-4318 affects users of AWS Amplify Studio and the amplify-codegen-ui package who create or modify components.
What are the implications of exploiting CVE-2025-4318?
Exploiting CVE-2025-4318 can lead to the execution of arbitrary JavaScript code, potentially compromising the application.
Is there a known exploit for CVE-2025-4318?
As of now, there are no publicly known exploits for CVE-2025-4318, but the vulnerability remains a significant risk.