{"answers":{"affected":"2 open source packages ship an affected version, including basti-cdk.","exploited":"There is no known exploitation of GHSA-q4pp-j36h-3gqg in the wild and no public exploit code.","fix":"Upgrade basti-cdk to 1.0.1 or later.","what":"GHSA-q4pp-j36h-3gqg is a missing authorization vulnerability in basti-cdk, published on 24 Aug 2023. Any signed-in user can exploit it over the network, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-q4pp-j36h-3gqg and fix it if it is affected.\n\nWhat it is: GHSA-q4pp-j36h-3gqg is a missing authorization vulnerability in basti-cdk, published on 24 Aug 2023. Any signed-in user can exploit it over the network, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-q4pp-j36h-3gqg in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- basti-cdk (npm): affected all versions; fixed in 1.0.1\n- basti-cdk (npm): affected all versions; fixed in 1.0.1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-q4pp-j36h-3gqg/ (Markdown: https://insights.sbomify.com/GHSA-q4pp-j36h-3gqg/index.md)","id":"GHSA-q4pp-j36h-3gqg","markdown":"https://insights.sbomify.com/GHSA-q4pp-j36h-3gqg/index.md","name":"GHSA-q4pp-j36h-3gqg","record":{"aliases":[],"analysis":{"component_type":"cloud_service","fix_type":"configuration_change","impacts":["privilege_escalation","code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"AWS bastion tool","requires_auth":"low_privilege","summary":"The minimal IAM policy for basti allows users to obtain shell access on the bastion host instead of just port forwarding, leading to privilege escalation.","user_interaction":"not_required","vuln_class":"missing_authorization"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"### 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:\u003cyour-region\u003e:\u003cyour-account-id\u003e:instance/\u003cyour-basti-instance-id\u003e\"\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:\u003cyour-region\u003e:\u003cyour-account-id\u003e:instance/\u003cyour-basti-instance-id\u003e\"\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.","ecosystems":["npm"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"Minimal `basti` IAM Policy Allows Shell Access","id":"GHSA-q4pp-j36h-3gqg","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"npm","product":null,"products":[],"type":"missing_authorization","year":"2023"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"npm","fixed":["1.0.1"],"introduced":["0"],"last_affected":[],"package":"basti-cdk","purl":null,"source":"GHSA-q4pp-j36h-3gqg"},{"ecosystem":"npm","fixed":["1.0.1"],"introduced":["0"],"last_affected":[],"package":"basti-cdk","purl":"pkg:npm/basti-cdk","source":"GHSA-q4pp-j36h-3gqg"}],"products":null,"published":"2023-08-24","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"The minimal IAM policy for basti allows users to obtain shell access on the bastion host instead of just port forwarding, leading to privilege escalation.","url":"https://insights.sbomify.com/GHSA-q4pp-j36h-3gqg/"}