
A critical-severity security flaw has been identified in AWS Amplify Studio, specifically within the amplify-codegen-ui
package. This vulnerability, tracked as CVE-2025-4318 and with a critical CVSSv4 score of 9.5, could allow malicious actors to execute arbitrary JavaScript code, potentially leading to significant security breaches.
According to the official AWS security bulletin, the amplify-codegen-ui
package generates front-end code from UI Builder entities (components, forms, views, and themes), primarily used in Amplify Studio for component previews and in AWS Command Line Interface (AWS CLI) for generating component files in customers’ local applications.
The core of the issue lies in an input validation vulnerability present in the Amplify Studio UI component properties. The advisory explains that “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.”
This lack of proper validation opens a dangerous window for exploitation. As the advisory explicitly warns, “as a result, an authenticated user who can create or modify components could run arbitrary JavaScript code during the component rendering and build process.” Imagine the potential damage: unauthorized access, data theft, or even complete compromise of your application’s front-end.
The affected versions of aws-amplify/amplify-codegen-ui
are 2.20.2 and earlier. The good news is that AWS has swiftly addressed this critical issue.
If you are using AWS Amplify Studio and relying on the amplify-codegen-ui
package, it is paramount that you take immediate steps to mitigate this risk. The recommended resolution is straightforward:
- Upgrade Immediately: Update your
aws-amplify/amplify-codegen-ui
dependency to version 2.20.3 or later. This patch contains the necessary fixes to address the input validation vulnerability. - Patch Forked Code: If you maintain any forked or derivative versions of the code, ensure that these are also updated with the provided fixes. As the advisory emphasizes, “ensure any forked or derivative code is patched to incorporate the new fixes.”