opensearch-project / opensearch-ci

Enables continuous integration across OpenSearch, OpenSearch Dashboards, and plugins.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

aws-cdk-lib-2.39.1.tgz: 2 vulnerabilities (highest severity is: 8.8) - autoclosed

mend-for-github-com opened this issue · comments

Vulnerable Library - aws-cdk-lib-2.39.1.tgz

Library home page: https://registry.npmjs.org/aws-cdk-lib/-/aws-cdk-lib-2.39.1.tgz

Path to dependency file: /package.json

Path to vulnerable library: /package.json

Found in HEAD commit: 3b5ece44c139375299409535782d956b9bbcf9c7

Vulnerabilities

CVE Severity CVSS Dependency Type Fixed in (aws-cdk-lib version) Remediation Possible**
CVE-2023-35165 High 8.8 aws-cdk-lib-2.39.1.tgz Direct 2.80.0
CVE-2022-25883 High 7.5 semver-7.3.7.tgz Transitive 2.88.0

**In some cases, Remediation PR cannot be created automatically for a vulnerability despite the availability of remediation

Details

CVE-2023-35165

Vulnerable Library - aws-cdk-lib-2.39.1.tgz

Library home page: https://registry.npmjs.org/aws-cdk-lib/-/aws-cdk-lib-2.39.1.tgz

Path to dependency file: /package.json

Path to vulnerable library: /package.json

Dependency Hierarchy:

  • aws-cdk-lib-2.39.1.tgz (Vulnerable Library)

Found in HEAD commit: 3b5ece44c139375299409535782d956b9bbcf9c7

Found in base branch: main

Vulnerability Details

AWS Cloud Development Kit (AWS CDK) is an open-source software development framework to define cloud infrastructure in code and provision it through AWS CloudFormation. In the packages aws-cdk-lib 2.0.0 until 2.80.0 and @aws-cdk/aws-eks 1.57.0 until 1.202.0, eks.Cluster and eks.FargateCluster constructs create two roles, CreationRole and default MastersRole, that have an overly permissive trust policy.

The first, referred to as the CreationRole, is used by lambda handlers to create the cluster and deploy Kubernetes resources (e.g KubernetesManifest, HelmChart, ...) onto it. Users with CDK version higher or equal to 1.62.0 (including v2 users) may be affected.

The second, referred to as the default MastersRole, is provisioned only if the mastersRole property isn't provided and has permissions to execute kubectl commands on the cluster. Users with CDK version higher or equal to 1.57.0 (including v2 users) may be affected.

The issue has been fixed in @aws-cdk/aws-eks v1.202.0 and aws-cdk-lib v2.80.0. These versions no longer use the account root principal. Instead, they restrict the trust policy to the specific roles of lambda handlers that need it. There is no workaround available for CreationRole. To avoid creating the default MastersRole, use the mastersRole property to explicitly provide a role.

Publish Date: 2023-06-23

URL: CVE-2023-35165

CVSS 3 Score Details (8.8)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: Low
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: High
    • Integrity Impact: High
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: GHSA-rx28-r23p-2qc3

Release Date: 2023-06-23

Fix Resolution: 2.80.0

⛑️ Automatic Remediation will be attempted for this issue.

CVE-2022-25883

Vulnerable Library - semver-7.3.7.tgz

The semantic version parser used by npm.

Library home page: https://registry.npmjs.org/semver/-/semver-7.3.7.tgz

Path to dependency file: /package.json

Path to vulnerable library: /package.json

Dependency Hierarchy:

  • aws-cdk-lib-2.39.1.tgz (Root Library)
    • semver-7.3.7.tgz (Vulnerable Library)

Found in HEAD commit: 3b5ece44c139375299409535782d956b9bbcf9c7

Found in base branch: main

Vulnerability Details

Versions of the package semver before 7.5.2 are vulnerable to Regular Expression Denial of Service (ReDoS) via the function new Range, when untrusted user data is provided as a range.

Publish Date: 2023-06-21

URL: CVE-2022-25883

CVSS 3 Score Details (7.5)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: None
    • Availability Impact: High

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: GHSA-c2qf-rxjj-qqgw

Release Date: 2023-06-21

Fix Resolution (semver): 7.5.2

Direct dependency fix Resolution (aws-cdk-lib): 2.88.0

⛑️ Automatic Remediation will be attempted for this issue.


⛑️Automatic Remediation will be attempted for this issue.

Updated aws-cdk-lib to version 2.134.0 and the only difference I see is in the IAM policy for loadBalancerAccessLogs. Below is the diff:

IAM Statement Changes
┌───┬──────────────────────────────────────────────────────────────────────────────┬────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────┬──────────────────────────────────────────────────┬───────────┐
│   │ Resource                                                                     │ Effect │ Action                                                                                                       │ Principal                                        │ Condition │
├───┼──────────────────────────────────────────────────────────────────────────────┼────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────────┼───────────┤
│ - │ ${jenkinsAuditBucket.Arn}/loadBalancerAccessLogs/AWSLogs/${AWS::AccountId}/* │ Allow  │ s3:Abort*                                                                                                    │ AWS:arn:${AWS::Partition}:iam::127311923021:root │           │
│   │                                                                              │        │ s3:PutObject                                                                                                 │                                                  │           │
│   │                                                                              │        │ s3:PutObjectLegalHold                                                                                        │                                                  │           │
│   │                                                                              │        │ s3:PutObjectRetention                                                                                        │                                                  │           │
│   │                                                                              │        │ s3:PutObjectTagging                                                                                          │                                                  │           │
│   │                                                                              │        │ s3:PutObjectVersionTagging                                                                                   │                                                  │           │
├───┼──────────────────────────────────────────────────────────────────────────────┼────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────────┼───────────┤
│ + │ ${jenkinsAuditBucket.Arn}/loadBalancerAccessLogs/AWSLogs/${AWS::AccountId}/* │ Allow  │ s3:PutObject                                                                                                 │ AWS:arn:${AWS::Partition}:iam::127311923021:root │           │
└───┴──────────────────────────────────────────────────────────────────────────────┴────────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────────────────────────────────────────┴───────────┘

As of now it does not break the stack deployed using previous version.

✔️ This issue was automatically closed by Mend because the vulnerable library in the specific branch(es) was either marked as ignored or it is no longer part of the Mend inventory.