GHSA-q4pp-j36h-3gqg: Basti cdk Minimal `basti` IAM Policy Allows Vulnerability
LOWGHSA-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
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.
npm install basti-cdk@1.0.1
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
GHSA-q4pp-j36h-3gqg Affected Basti cdk Versions
1 component(s)| 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?
Which Basti cdk versions are affected?
What version fixes GHSA-q4pp-j36h-3gqg?
Is basti-cdk affected?
What CWE is associated with GHSA-q4pp-j36h-3gqg?
How can I check npm dependencies for GHSA-q4pp-j36h-3gqg?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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
}
}