CVE-2024-28056: @aws amplify/cli AWS Amplify CLI Has Incorrect Vulnerability

CRITICAL
Advisory Identifier: GHSA-846g-p7hm-f54r
CVSS 9.8
CWE-269 CWE-276
Published
Advisory Summary

CVE-2024-28056 is a CRITICAL (CVSS 9.8) aws amplify cli has incorrect vulnerability (CWE-269: Improper Privilege Management) affecting @aws amplify/cli libraries in the npm ecosystem. The issue involves aws amplify cli has incorrect trust policy management. Remediation is available by upgrading affected packages to version 12.10.1.

CVE-2024-28056 at a Glance

CVE Identifier CVE-2024-28056
GHSA Identifier GHSA-846g-p7hm-f54r
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-269: Improper Privilege Management
Affected Product @aws amplify/cli
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 9.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2024-28056

To remediate this vulnerability, upgrade all affected @aws amplify/cli 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/cli fixed: 12.10.1
npm install @aws-amplify/cli@12.10.1
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/cli

How to Check if You Are Affected

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

npm ls @aws-amplify/cli

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

Note: The npm ls @aws-amplify/cli 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-269: Improper Privilege Management, where the product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor. In @aws amplify/cli, 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

Amazon AWS Amplify CLI before 12.10.1 incorrectly configures the role trust policy of IAM roles associated with Amplify projects. When the Authentication component is removed from an Amplify project, a Condition property is removed but "Effect":"Allow" remains present, and consequently sts:AssumeRoleWithWebIdentity would be available to threat actors with no conditions. Thus, if Amplify CLI had been used to remove the Authentication component from a project built between August 2019 and January 2024, an "assume role" may have occurred, and may have been leveraged to obtain unauthorized access to an organization's AWS resources. NOTE: the problem could only occur if an authorized AWS user removed an Authentication component. (The vulnerability did not give a threat actor the ability to remove an Authentication component.) However, in realistic situations, an authorized AWS user may have removed an Authentication component, e.g., if the objective were to stop using built-in Cognito resources, or move to a completely different identity provider.

CVE-2024-28056 Affected @aws amplify/cli Versions

1 component(s)
Fixed Versions:
12.10.1
Product / Package Ecosystem Affected Versions Fixed Version
@aws-amplify/cli
npm
< 12.10.1
12.10.1

References

Frequently Asked Questions

What is CVE-2024-28056?
CVE-2024-28056 is a security vulnerability in @aws amplify/cli involving AWS Amplify CLI has incorrect trust policy management under CWE-269: Improper Privilege Management.
Which @aws amplify/cli versions are affected?
Affected versions include releases prior to 12.10.1 across affected packages: @aws-amplify/cli.
What version fixes CVE-2024-28056?
Upgrading to 12.10.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @aws-amplify/cli affected?
Yes, @aws-amplify/cli is affected in releases prior to 12.10.1. Upgrade your dependency to 12.10.1 or later.
What is the CVSS score of CVE-2024-28056?
CVE-2024-28056 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2024-28056?
CVE-2024-28056 is classified under CWE-269: Improper Privilege Management (The product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor.).
How can I check npm dependencies for CVE-2024-28056?
Run the dependency tree command: 'npm ls @aws-amplify/cli'. 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-846g-p7hm-f54r",
  "modified" : "2024-08-15T21:38:29Z",
  "published" : "2024-04-15T18:30:51Z",
  "aliases" : [ "CVE-2024-28056" ],
  "summary" : "AWS Amplify CLI has incorrect trust policy management",
  "details" : "Amazon AWS Amplify CLI before 12.10.1 incorrectly configures the role trust policy of IAM roles associated with Amplify projects. When the Authentication component is removed from an Amplify project, a Condition property is removed but \"Effect\":\"Allow\" remains present, and consequently sts:AssumeRoleWithWebIdentity would be available to threat actors with no conditions. Thus, if Amplify CLI had been used to remove the Authentication component from a project built between August 2019 and January 2024, an \"assume role\" may have occurred, and may have been leveraged to obtain unauthorized access to an organization's AWS resources. NOTE: the problem could only occur if an authorized AWS user removed an Authentication component. (The vulnerability did not give a threat actor the ability to remove an Authentication component.) However, in realistic situations, an authorized AWS user may have removed an Authentication component, e.g., if the objective were to stop using built-in Cognito resources, or move to a completely different identity provider.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@aws-amplify/cli"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "12.10.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-28056"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/aws-amplify/amplify-cli/commit/73b08dc424db2fb60399c5343c314e02e849d4a1"
  }, {
    "type" : "WEB",
    "url" : "https://aws.amazon.com/security/security-bulletins/AWS-2024-003"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/aws-amplify/amplify-cli"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/aws-amplify/amplify-cli/blob/8ad57bf99a404f3c92547c8a175458016f682fac/packages/amplify-provider-awscloudformation/resources/update-idp-roles-cfn.json"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/aws-amplify/amplify-cli/releases/tag/v12.10.1"
  }, {
    "type" : "WEB",
    "url" : "https://securitylabs.datadoghq.com/articles/amplified-exposure-how-aws-flaws-made-amplify-iam-roles-vulnerable-to-takeover"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-269", "CWE-276" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-15T20:25:04Z",
    "nvd_published_at" : "2024-04-15T18:15:10Z"
  }
}