T09 · Insecure Skill Coding Practices
- Location
SKILL.md:56- Finding
API Credentials Exposed by Documented Verification Command
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 56–59
Vulnerability Type: Plaintext sensitive-data exposure
Risk Level: MediumVulnerable Code Snippet:
python import os print("API Key:", os.environ.get("FINOVIEW_API_KEY", "未配置")) print("API Secret:", os.environ.get("FINOVIEW_API_SECRET", "未配置"))Technical Analysis
The documented credential-verification procedure prints the complete values of
FINOVIEW_API_KEYandFINOVIEW_API_SECRETto standard output. Although the credentials are appropriately sourced from environment variables rather than hardcoded in the application, disclosing their full values defeats the confidentiality benefit of that storage mechanism.Terminal output may be retained in scrollback buffers, CI/CD logs, remote-session recordings, support transcripts, screenshots, or agent conversation history. Any person or system able to access such output could recover both credentials.
Attack Path
- A user configures valid Finoview API credentials as instructed.
- The user runs the documented verification snippet.
- The complete API key and secret are written to standard output.
- The output is captured through terminal logging, session recording, CI logs, screenshots, or copied diagnostic output.
- An unauthorized party obtains the captured output and extracts the credentials.
- The party uses the credentials to authenticate to the Finoview API, subject to the permissions and restrictions assigned to that credential pair.
Impact Assessment
Successful exploitation exposes the Finoview API key and secret. An attacker could make authenticated API requests with the compromised account's privileges, consume applicable quotas, access API data available to that account, and cause requests to be attributed to the legitimate credential owner.
The impact is limited to the permissions granted to the compromised Finoview credentials; the reviewed code does n ...[truncated 122 chars]
- Remediation
View remediation
Remediation Suggestions
Replace the verification example with a presence-only check that never prints credential values:
python import os key_configured = bool(os.environ.get("FINOVIEW_API_KEY")) secret_configured = bool(os.environ.get("FINOVIEW_API_SECRET")) print("API Key configured:", key_configured) print("API Secret configured:", secret_configured)Additional hardening measures:
- Explicitly warn users never to print, log, screenshot, or paste complete credentials.
- If identification is necessary, display only a short masked suffix and avoid revealing credential length.
- Ensure application and CI logging systems redact both environment-variable values.
- Rotate any credentials that may already have been exposed through this verification procedure.
- Apply least-privilege permissions, usage quotas, expiration, and source restrictions to API credentials where supported.
- Prefer a managed secret store for production deployments and audit access to stored credentials.
