T09 · Insecure Skill Coding Practices
- Location
scripts/query.sh:5- Finding
Hardcoded NocoDB API Token
- Content
View full analysis
Vulnerability Details
File Location:
scripts/query.sh, line 5
Vulnerability Type: Hardcoded external-service credential
Risk Level: MediumVulnerable Code
bash XC_TOKEN="${NOCODB_XC_TOKEN:-cCCOb9nNdeWSFIWr7tg7rWfOZeKyTfJ0Qtis_bm3}"Technical Analysis
The script embeds a NocoDB API token as the default value used whenever the
NOCODB_XC_TOKENenvironment variable is not defined. Because the token is distributed with the Skill package in plaintext, any person with access to the package can recover and reuse it independently of the Skill.The script sends this credential in the
xc-tokenheader tohttps://nocodb.dixchain.com/api/v2. The repository does not establish the token's server-side privileges, expiration, or resource restrictions. Consequently, its exact authorization scope cannot be confirmed through static analysis.Attack Path
- Obtain a copy of the Skill package or source repository.
- Read
scripts/query.shand extract the plaintext token from line 5. - Construct requests to the NocoDB API at
https://nocodb.dixchain.com/api/v2. - Supply the recovered value in the
xc-tokenrequest header. - Access, enumerate, or modify resources to the extent permitted by the token's server-side privileges.
No additional local compromise or code execution is required to recover the credential.
Impact Assessment
An attacker can obtain the same NocoDB privileges assigned to the exposed token. Potential consequences include unauthorized access to yoga-pose records, dataset enumeration, API quota consumption, and record modification if write privileges are enabled.
The exposure also prevents reliable attribution because all installations and unauthorized users may operate under the same credential. The maximum impact is limited by the token's actual server-side permissions, which could not be determined from the audited files.
- Remediation
View remediation
Remediation Suggestions
-
Immediately revoke and rotate the exposed token.
-
Remove the fallback credential from
scripts/query.sh. -
Require the token to be supplied through an environment variable or secret manager and terminate safely when it is absent:
bash : "${NOCODB_XC_TOKEN:?NOCODB_XC_TOKEN must be configured}" XC_TOKEN="$NOCODB_XC_TOKEN" -
Provision a dedicated read-only token restricted to the required table, view, and API operation.
-
Apply expiration, rotation, rate limiting, and audit logging to the replacement credential.
-
Review API logs for unauthorized use of the exposed token.
-
Purge the credential from repository history and release artifacts where practical.
-
Add automated secret scanning to the development and release pipeline.
-
