T05 · Unauthorized Access and Privilege Escalation
- Location
- SKILL.md:9
- Finding
- Excessive Access to Credentials, Database Resources, Network Egress, and Public Port Binding<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 9-24 **Vulnerability Type**: Excessive capability declaration and violation of least privilege **Risk Level**: High ### Vulnerable Code ```yaml # Capability disclosure (NVIDIA MCP Least-Privilege): declared vs. actual. # The skill's runtime engine (second_perspective) requires the following # beyond `python3`. Loaders must grant these explicitly, not implicitly. capabilities: network_egress: - purpose: "OIDC discovery & JWKS fetch (HTTPS only, issuer-controlled host)" scope: "outbound to SP_OIDC_ISSUER and its jwks_uri only" env_read: - SP_API_KEY - SP_DATABASE_DSN # contains PostgreSQL credentials - SP_OIDC_ISSUER - SP_OIDC_CLIENT_ID - SP_OIDC_AUDIENCE - SP_PUBLIC_BASE_URL database: "PostgreSQL connection via SP_DATABASE_DSN" docker_deploy: true binds_port: "0.0.0.0:8000 (configurable; requires external network isolation)" ``` ### Technical Analysis The Skill asks its loader to grant access to an API key, PostgreSQL credentials, identity-provider configuration, database connectivity, outbound network access, Docker deployment, and a listener on all network interfaces. These capabilities materially exceed what is needed by the executable code included in the audited artifact. The only supplied Python program, `scripts/export_openapi.py`, reads `SP_PUBLIC_BASE_URL` and writes an OpenAPI document. No included implementation uses the API key, database DSN, OIDC variables, database access, or OIDC network egress. The capability request also conflicts with the artifact's documented implementation status. `BRANCH_MANIFEST.md`, lines 49-55, identifies durable databases, OIDC, delegated authority, RBAC/ABAC, and other production controls as deferred. Moreover, the actual `second_perspective` runtime source is absent, so it is impossible to verify that the requested secrets and egress are safely handled. Granting sensitive environment access ...[truncated 1587 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove every capability that the included executable code does not require. 2. Restrict the OpenAPI exporter to `SP_PUBLIC_BASE_URL`; do not expose API keys, database credentials, or OIDC configuration to it. 3. Separate API deployment from the documentation/export Skill so that each component receives an independent capability profile. 4. Include and audit the complete `second_perspective` runtime before granting it credentials or network access. 5. Pin the runtime package by exact version and cryptographic hash. 6. Grant database access through a narrowly scoped account with only the required tables and operations. 7. Use a secret manager or short-lived credentials rather than broadly inherited environment variables. 8. Restrict OIDC egress at the network layer to a validated HTTPS issuer and its validated JWKS endpoint. 9. Bind to `127.0.0.1` by default. Require an explicit deployment option to listen on `0.0.0.0`. 10. Add automated tests that fail when declared capabilities exceed capabilities exercised by the audited source. ]]>
