T05 · Unauthorized Access and Privilege Escalation
Warning
- Location
- SKILL.md:86
- Finding
- Mandatory Broad Cloud Reconnaissance Exceeds Task-Scoped Least Privilege<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:86` **Vulnerability Type**: Mandatory enumeration of GCP projects, resources, and billing data **Risk Level**: Medium ### Vulnerable Code Snippet ```markdown 1. **Inventory before architecture.** Never propose infrastructure into an unknown project — and never rediscover a project you already mapped. Read the stored inventory first: `## Current Infrastructure` in `memory.md`, whatever its `## Boxes` line points to, and `~/Clawic/data/servers/servers.md`. Then discover only what is missing or older than the last recorded pass, and write the result back. Minimum discovery: `gcloud config list`, `gcloud projects list`, `gcloud asset search-all-resources --scope=projects/<id>`, and 30 days of cost grouped by service. Asset Inventory is the one GCP tool with no AWS equivalent worth envying — it answers "what exists here" across every API in one call, including resources whose API you never thought to check. ``` ### Technical Analysis The Skill defines project listing, Cloud Asset Inventory enumeration, configuration inspection, and 30 days of billing analysis as the minimum discovery procedure before providing architecture guidance. This behavior is broader than necessary for many supported tasks, such as comparing two GCP services, reviewing one known resource, or explaining a documented error. The commands use the credentials already available to `gcloud`. They do not independently grant new IAM permissions, but they exercise all relevant read permissions held by the current identity. In particular: - `gcloud projects list` may enumerate every project visible to the authenticated principal. - `gcloud asset search-all-resources` can expose resource types and names across many APIs in the selected project. - Billing analysis exposes financial and usage information unrelated to a narrow technical request. - `gcloud config list` reveals the active account, project, region, and local CLI configuratio ...[truncated 1843 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace mandatory full-estate discovery with task-scoped discovery: - Query only the project explicitly named by the user. - Query only resource types relevant to the request. - Avoid billing access unless the request concerns cost or capacity planning. 2. Require informed approval before broad enumeration: - State which projects, resource types, and billing periods will be queried. - Explain why each query is necessary. - Obtain explicit confirmation before organization-wide or multi-project discovery. 3. Use progressive discovery: - Begin with the user-provided resource and project. - Expand only when missing information prevents completion. - Prefer cached inventory only when the user has enabled persistent inventory. 4. Support a restricted read-only identity: - Recommend a dedicated audit identity with only the required viewer roles. - Avoid running general architecture questions under Owner, Editor, or organization-admin identities. - Separate billing access from asset inventory access. 5. Do not persist discovery output automatically. Ask separately whether the user wants an inventory record saved, and redact unnecessary identifiers before writing. ]]>
