T09 · Insecure Skill Coding Practices
- Location
tavily_config.py:10- Finding
Hard-Coded Tavily API Credential Committed to the Repository
- Content
View full analysis
Vulnerability Details
File Location:
tavily_config.py:10
Vulnerability Type: Plaintext hard-coded API credential
Risk Level: HighVulnerable Code
python TAVILY_API_KEY = "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"Technical Analysis
The repository contains a Tavily API credential directly embedded in source code. Anyone with access to the repository, distributed Skill package, source archive, build artifacts, or repository history can recover the credential without authentication.
The
get_tavily_api_key()function returns this value to callers. Although the primary analysis implementation currently obtains its Tavily key from the environment instead of importing this configuration module, the exposed key remains independently usable. Removing the file from the latest revision would also be insufficient if the credential remains available in version-control history or previously distributed packages.Attack Path
- An attacker obtains a copy of the repository or Skill package.
- The attacker opens
tavily_config.py. - The attacker extracts the plaintext Tavily API key from line 10.
- The attacker configures a Tavily client or sends Tavily API requests using the exposed key.
- Requests consume the legitimate account's quota and may incur charges or interfere with authorized service usage.
- Attribution becomes difficult because authorized and unauthorized requests use the same credential.
Impact Assessment
The attacker obtains the privileges assigned to this Tavily API key. Potential consequences include:
- Unauthorized Tavily API usage.
- Search-quota exhaustion and denial of service to legitimate users.
- Potential billing exposure, depending on the associated account plan.
- Access to any Tavily features authorized for the key.
- Loss of request accountability and audit integrity.
There is no evidence that the key grants local operating-system privileges or ...[truncated 89 chars]
- Remediation
View remediation
Remediation Suggestions
- Revoke the exposed Tavily key immediately and generate a replacement.
- Remove the credential from the current source tree and all version-control history.
- Store the replacement in an environment variable, operating-system credential store, or managed secret service.
- Delete
tavily_config.pyif it is obsolete, or replace the value with a nonfunctional placeholder. - Add local secret files to
.gitignoreand ensure generated packages exclude them. - Introduce pre-commit and continuous-integration secret scanning.
- Review Tavily account logs and usage records for unauthorized requests.
- Apply usage limits and alerts where supported by the provider.
