Minimal `basti` IAM Policy Allows Shell Access
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- —
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from GitHub.
Summary
### 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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | basti-cdk (npm) | before 1.0.1 | 1.0.1 | Patch available | GHSA-q4pp-j36h-3gqg |
- basti-cdk (npm) Vendor— Affected before 1.0.1 Fixed in 1.0.1 Patch available GHSA-q4pp-j36h-3gqg
Remediation
- Fix · GHSA-q4pp-j36h-3gqg basti-cdk (npm) Fixed in 1.0.1 Advisory →
Timeline
- 2026-10-03 Threatist record created from GHSA-q4pp-j36h-3gqg
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences