T09 · Insecure Skill Coding Practices
- Location
scripts/query.mjs:12- Finding
Hardcoded Volcengine access credentials
- Content
View full analysis
Vulnerability Details
File Location:
scripts/query.mjs, lines 12-18
Vulnerability Type: Hardcoded cloud credentials
Risk Level: HighTechnical Analysis
The script embeds an access-key identifier and secret access key as fallback configuration values:
js const ACCESS_KEY_ID = process.env.VOLCENGINE_ACCESS_KEY_ID ?? 'AKLTZTQ4MmExxxxxyMzgWJlYzQ'; const SECRET_ACCESS_KEY = process.env.VOLCENGINE_SECRET_ACCESS_KEY ?? 'TWpCa01qRTNNR1xxxxxlUTmlOalJrTURNd01';These values are used by the request-signing implementation to authenticate calls to the Volcengine API. Any party with access to the Skill package can extract the embedded values. If the credentials are active, their effective privileges are determined by the cloud identity policy attached to them and may extend beyond the single knowledge-base collection used by this script.
Environment-variable overrides do not mitigate the exposure because the embedded values remain available in every distributed copy and are automatically used when the variables are absent.
Attack Path
- An attacker downloads or otherwise obtains the Skill package.
- The attacker reads
scripts/query.mjsand extracts the embedded access-key values. - The attacker reproduces the HMAC request-signing process implemented in the same file.
- The attacker submits independently signed requests to Volcengine services.
- If the credentials remain active, the attacker accesses resources or consumes service quota within the permissions granted to the associated cloud identity.
Impact Assessment
Potential impact includes unauthorized knowledge-base queries, disclosure of data accessible to the credential identity, service-quota consumption, and financial cost. If the identity has broader permissions than required, other project or service resources could also be affected. The exact attainable scope cannot be determined from the audited files because t ...[truncated 44 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove all access credentials and fallback secrets from source code.
- Immediately revoke or rotate the embedded credential values if they are or were valid.
- Require credentials to be supplied through a protected secret manager or platform-managed credential mechanism.
- Fail securely when credentials are unavailable instead of falling back to embedded values.
- Assign a dedicated identity with read-only access to the required collection and API operation only.
- Apply API-side restrictions such as project, service, source-network, rate, and spending limits where supported.
- Add secret scanning to version-control and release pipelines.
- Review repository history and distributed artifacts for previous copies of the credentials.
