GHSA-q4pp-j36h-3gqg: Basti cdk Minimal `basti` IAM Policy Allows Vulnerability

LOW
Published
Advisory Summary

GHSA-q4pp-j36h-3gqg is a LOW minimal `basti` iam policy allows vulnerability (General Security Weakness) affecting Basti cdk libraries in the npm ecosystem. The issue involves minimal `basti` iam policy allows shell access. Remediation is available by upgrading affected packages to version 1.0.1.

GHSA-q4pp-j36h-3gqg at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-q4pp-j36h-3gqg
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Basti cdk
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-q4pp-j36h-3gqg

To remediate this vulnerability, upgrade all affected Basti cdk dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

basti-cdk fixed: 1.0.1
npm install basti-cdk@1.0.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 basti-cdk

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-q4pp-j36h-3gqg, inspect your project dependencies using npm:

npm ls basti-cdk

Analyze the terminal output to locate any version of Basti cdk in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.1), your application is affected.

Note: The npm ls basti-cdk 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 General Security Weakness. In Basti cdk, 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

### Summary The provided Minimal IAM Policy for `bastic connect` does not include `ssm:SessionDocumentAccessCheck`. This results in the ability to get a shell session on the bastion, not just the intended access for Port Forwarding. ### Details `basti connect` is designed to "securely connect to your RDS/Aurora/Elasticache/EC2 instances", using a bastion instance "with [AWS Session Manager](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager.html) port forwarding capability to make the target available on your localhost." The [Minimal IAM Policy](https://github.com/BohdanPetryshyn/basti#minimal-iam-permissions) allows port forwarding via the following statement: ``` { "Effect": "Allow", "Action": "ssm:StartSession", "Resource": [ "arn:aws:ssm:*:*:document/AWS-StartPortForwardingSessionToRemoteHost", "arn:aws:ec2:<your-region>:<your-account-id>:instance/<your-basti-instance-id>" ] } ``` This statement does not include the following condition: ``` "Condition": { "BoolIfExists": { "ssm:SessionDocumentAccessCheck": "true" } } ``` As a result, the `basti connect` minimal policy is logically identical to: ``` { "Effect": "Allow", "Action": "ssm:StartSession", "Resource": [ "arn:aws:ssm:*:*:document/AWS-StartPortForwardingSessionToRemoteHost", "arn:aws:ssm:*:*:document/SSM-SessionManagerRunShell", "arn:aws:ec2:<your-region>:<your-account-id>:instance/<your-basti-instance-id>" ] } ``` A `basti` admin would expect users under the minimal policy to be able to port forward. However, they could also get a shell on the bastion. For more details on this footgun, see: https://ramimac.me/ssm-iam ### PoC _Complete instructions, including specific configuration details, to reproduce the vulnerability._ ### Impact Impact would depend on configuration/hardening of the bastion. I've seen examples where bastions have credentials to downstream systems in configuration or memory that would be exposed.

GHSA-q4pp-j36h-3gqg Affected Basti cdk Versions

1 component(s)
Fixed Versions:
1.0.1
Product / Package Ecosystem Affected Versions Fixed Version
basti-cdk
npm
< 1.0.1
1.0.1

References

Frequently Asked Questions

What is GHSA-q4pp-j36h-3gqg?
GHSA-q4pp-j36h-3gqg is a security vulnerability in Basti cdk involving Minimal `basti` IAM Policy Allows Shell Access under General Security Weakness.
Which Basti cdk versions are affected?
Affected versions include releases prior to 1.0.1 across affected packages: basti-cdk.
What version fixes GHSA-q4pp-j36h-3gqg?
Upgrading to 1.0.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is basti-cdk affected?
Yes, basti-cdk is affected in releases prior to 1.0.1. Upgrade your dependency to 1.0.1 or later.
What CWE is associated with GHSA-q4pp-j36h-3gqg?
GHSA-q4pp-j36h-3gqg is classified under General Security Weakness.
How can I check npm dependencies for GHSA-q4pp-j36h-3gqg?
Run the dependency tree command: 'npm ls basti-cdk'. 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-q4pp-j36h-3gqg",
  "modified" : "2023-08-24T12:53:06Z",
  "published" : "2023-08-24T12:53:06Z",
  "aliases" : [ ],
  "summary" : "Minimal `basti` IAM Policy Allows Shell Access",
  "details" : "### Summary\n\nThe provided Minimal IAM Policy for `bastic connect` does not include `ssm:SessionDocumentAccessCheck`. This results in the ability to get a shell session on the bastion, not just the intended access for Port Forwarding.\n\n### Details\n\n`basti connect` is designed to \"securely connect to your RDS/Aurora/Elasticache/EC2 instances\", using a bastion instance \"with [AWS Session Manager](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager.html) port forwarding capability to make the target available on your localhost.\"\n\nThe [Minimal IAM Policy](https://github.com/BohdanPetryshyn/basti#minimal-iam-permissions) allows port forwarding via the following statement:\n\n```   \n {\n      \"Effect\": \"Allow\",\n      \"Action\": \"ssm:StartSession\",\n      \"Resource\": [\n        \"arn:aws:ssm:*:*:document/AWS-StartPortForwardingSessionToRemoteHost\",\n        \"arn:aws:ec2:<your-region>:<your-account-id>:instance/<your-basti-instance-id>\"\n      ]\n    }\n```\n\nThis statement does not include the following condition:\n\n```\n\"Condition\": {\n    \"BoolIfExists\": {\n        \"ssm:SessionDocumentAccessCheck\": \"true\"\n    }\n}\n```\n\nAs a result, the `basti connect` minimal policy is logically identical to:\n\n```\n {\n      \"Effect\": \"Allow\",\n      \"Action\": \"ssm:StartSession\",\n      \"Resource\": [\n        \"arn:aws:ssm:*:*:document/AWS-StartPortForwardingSessionToRemoteHost\",\n        \"arn:aws:ssm:*:*:document/SSM-SessionManagerRunShell\",\n        \"arn:aws:ec2:<your-region>:<your-account-id>:instance/<your-basti-instance-id>\"\n      ]\n    }\n```\n\nA `basti` admin would expect users under the minimal policy to be able to port forward. However, they could also get a shell on the bastion.\n\nFor more details on this footgun, see: https://ramimac.me/ssm-iam\n\n### PoC\n_Complete instructions, including specific configuration details, to reproduce the vulnerability._\n\n### Impact\n\nImpact would depend on configuration/hardening of the bastion. I've seen examples where bastions have credentials to downstream systems in configuration or memory that would be exposed. ",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "basti-cdk"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/BohdanPetryshyn/basti/security/advisories/GHSA-q4pp-j36h-3gqg"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/BohdanPetryshyn/basti/commit/f6f218e7cd450e29aeb616960b7abbe8dfc87796"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/BohdanPetryshyn/basti"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-08-24T12:53:06Z",
    "nvd_published_at" : null
  }
}