T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/audit-firewall.sh:56- Finding
Unnecessary Cloud Instance Metadata Probing
- Content
View full analysis
/dev/null 2>&1; then CLOUD_PROVIDER="aws" elif curl -s --max-time 2 -H "Metadata-Flavor: Google" http://metadata.google.internal/ >/dev/null 2>&1; then CLOUD_PROVIDER="gcp" elif curl -s --max-time 2 -H "Metadata: true" "http://169.254.169.254/metadata/instance?api-version=2021-02-01" >/dev/null 2>&1; then CLOUD_PROVIDER="azure" fi } ``` ### Technical Analysis Every invocation of the audit script sends requests to AWS, GCP, and Azure instance metadata endpoints until one responds. Cloud metadata services are security-sensitive because neighboring paths may expose instance identity documents, access tokens, or temporary credentials. The current implementation requests only provider root or instance metadata paths, discards the responses, uses a two-second timeout, and does not request credential endpoints. Therefore, the observed code does not steal credentials or exfiltrate metadata. However, directly contacting metadata services is unnecessary for inspecting the host firewall and exceeds the minimum network access needed for the Skill's principal function. The AWS request also does not use an IMDSv2 token. Although the requested path is not itself a credential endpoint, normalizing unauthenticated metadata access is undesirable on systems where IMDSv1 remains enabled. ### Attack Path 1. An operator invokes `scripts/audit-firewall.sh`. 2. The script sends HTTP requests to link-local or internally resolved cloud metadata services. 3. It infers the cloud provider from the first successful response. 4. If this logic were later extended or influenced to request sensitive subpaths, the same access ch ...[truncated 613 chars]- Remediation
View remediation
