T05 · Unauthorized Access and Privilege Escalation
Warning
- Location
- config.json:5
- Finding
- Unnecessary Collection of a Sensitive Instagram Access Token## Vulnerability Details **File Location**: `config.json:5-10` **Vulnerability Type**: Excessive credential access and violation of least privilege **Risk Level**: Medium **Complete Code Snippet**: ```json "inputs": { "instagram_id": "string", "access_token": "string" }, "api": { "base_url": "https://graph.facebook.com/v25.0" } ``` ### Technical Analysis The skill configuration declares `access_token` as an input even though the executable entry point does not use this credential. The implementation in `index.js` ignores both `input` and `config` and returns only a fixed activation message. Moreover, `SKILL.md` describes the expected input as text containing artist context or a post idea rather than a privileged Instagram credential. Requiring a bearer token that is unnecessary for the implemented functionality violates the principle of least privilege. Supplying the token places it within the skill runtime and its surrounding configuration, telemetry, and logging boundaries without a legitimate operational need. The audited code does not transmit, log, or steal the token, and the configured URL is the official Facebook Graph API endpoint; therefore, this finding concerns unnecessary credential exposure rather than confirmed exfiltration. ### Attack Path 1. A user or orchestration platform installs and configures the skill. 2. Based on `config.json`, the platform requests or supplies an Instagram/Facebook access token. 3. The credential enters the skill's configuration or execution boundary despite not being used by `index.js`. 4. If the surrounding runtime, configuration store, diagnostics, or logs are later compromised or improperly exposed, an attacker could recover the unnecessarily supplied token. 5. The attacker could then use the token against the Facebook Graph API within the permissions and lifetime granted to that token. This attack path depends on a separate exposure of the ...[truncated 595 chars]
- Remediation
- ## Remediation Suggestions 1. Remove `access_token`, `instagram_id`, and the unused API configuration until API access is actually implemented. 2. Align the declared inputs with the documented functionality in `SKILL.md`, accepting only the artist context or post data needed for analysis. 3. If Graph API integration is implemented later, request only the minimum required permissions and use short-lived tokens where supported. 4. Supply credentials through a dedicated secret manager or protected runtime secret facility rather than ordinary user input or plaintext configuration. 5. Ensure tokens are never included in logs, error messages, analytics, generated content, or persisted execution traces. 6. Restrict outbound requests to the expected official Facebook Graph API host and validate request destinations before attaching credentials. 7. Document the required token type, permissions, purpose, retention policy, and revocation procedure. 8. Add automated tests verifying that credentials are neither returned in responses nor disclosed through exception handling and diagnostics.
