CVE-2025-4318: Remote Code Execution in AWS Amplify codegen-ui
Vulnerability ID: CVE-2025-4318
CVSS Score: 9.0
Published: 2026-07-30
A critical remote code execution (RCE) vulnerability exists in AWS Amplify Studio's code-generation library (@aws-amplify/codegen-ui). An authenticated attacker with permissions to create or modify component schemas can inject malicious JavaScript code into those schemas. When the Amplify CLI or the build environment processes these schemas, the unvalidated expressions are executed within the host Node.js environment, leading to full system compromise.
TL;DR
Remote code execution vulnerability in @aws-amplify/codegen-ui allows authenticated users to execute arbitrary commands during build/generation phases via crafted component schemas.
⚠️ Exploit Status: POC
Technical Details
- CWE ID: CWE-95
- Attack Vector: Network
- Privileges Required: Low
- User Interaction: None
- Impact: High (Confidentiality, Integrity, Availability)
- Exploit Status: PoC available
- KEV Status: Not listed
Affected Systems
- AWS Amplify Studio UI Builder
- @aws-amplify/codegen-ui
- @aws-amplify/codegen-ui-react
-
@aws-amplify/codegen-ui: >= 0.1.0, < 2.20.4 (Fixed in:
2.20.4) -
@aws-amplify/codegen-ui-react: >= 0.1.0, < 2.20.4 (Fixed in:
2.20.4)
Code Analysis
Commit: ca98c38
Initial property AST input validation and scripting patterns denylist filter
Commit: 7ce5200
Sanitise bindingEvent and event fields to prevent bypass in UI actions
Exploit Details
- SecureLayer7: Detailed write-up of the initial RCE and the event binding bypass.
Mitigation Strategies
- Upgrade @aws-amplify/codegen-ui to version 2.20.4 or above
- Upgrade @aws-amplify/codegen-ui-react to version 2.20.4 or above
- Restrict user permissions in AWS Amplify Studio to trusted personnel
- Network-isolate the build pipelines and developer environments to prevent outbound data exfiltration
Remediation Steps:
- Run 'npm list @aws-amplify/codegen-ui' to identify the active version.
- Execute 'npm install @aws-amplify/codegen-ui@latest @aws-amplify/codegen-ui-react@latest' in all project directories.
- Re-generate package lockfiles and commit updates to source control.
- Verify global tools with 'npm install -g @aws-amplify/cli@latest'.
References
- AWS Security Advisory AWS-2025-010
- GitHub Security Advisory GHSA-hf3j-86p7-mfw8
- SecureLayer7 Technical Vulnerability Analysis
Read the full report for CVE-2025-4318 on our website for more details including interactive diagrams and full exploit analysis.
Top comments (0)