T09 · Insecure Skill Coding Practices
- Location
SKILL.md:12- Finding
Canvas bearer token may be transmitted to an untrusted configurable endpoint
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 12-20
Vulnerability Type: Unvalidated credential destination and insufficient transport enforcement
Risk Level: MediumVulnerable Code
bash export CANVAS_TOKEN="your_token_here" export CANVAS_URL="https://your-school.instructure.com" # or canvas.yourschool.edubash curl -s -H "Authorization: Bearer $CANVAS_TOKEN" "$CANVAS_URL/api/v1/..."Technical Analysis
The Skill instructs the agent to obtain the request destination from the environment-controlled
CANVAS_URLvariable and sendCANVAS_TOKENin an HTTP authorization header. It does not require HTTPS at execution time, validate the destination hostname against a trusted Canvas instance, or request confirmation before sending the credential.Although the documented example uses HTTPS, a modified, poisoned, or mistakenly configured
CANVAS_URLcan identify an attacker-controlled server or an unencrypted HTTP endpoint. Following the documented command would then disclose the bearer token to that endpoint. The exposed token could subsequently be reused according to the permissions granted by Canvas.Network access and Canvas authentication are necessary for the declared functionality. However, transmitting a sensitive bearer token without validating the configured destination exceeds safe minimum credential-handling requirements.
The separate
curl ... | python3 -c ...response-processing example is not remote payload execution: it parses downloaded content as JSON using fixed local Python code and does not evaluate the response as Python or shell source.Attack Path
- An attacker, compromised setup process, or erroneous configuration changes
CANVAS_URLto an attacker-controlled hostname or an HTTP endpoint. - The user or agent executes a documented Canvas API request without validating the configured scheme and hostname.
curlsends the `Authorization: Beare ...[truncated 927 chars]
- An attacker, compromised setup process, or erroneous configuration changes
- Remediation
View remediation
Remediation Suggestions
-
Require an HTTPS URL and reject every other scheme before transmitting the token.
-
Parse and validate
CANVAS_URLrather than concatenating an arbitrary environment value into authenticated requests. -
Require the hostname to match a user-approved Canvas domain or an explicit allowlist.
-
Reject URLs containing embedded credentials, unexpected paths, query strings, fragments, or nonstandard ports unless explicitly required.
-
Use hardened curl options such as:
bash curl --fail-with-body --show-error --silent \ --proto '=https' \ --max-redirs 0 \ --connect-timeout 10 \ --max-time 30 \ -H "Authorization: Bearer $CANVAS_TOKEN" \ "$VALIDATED_CANVAS_URL/api/v1/..." -
If redirects are later enabled, ensure authentication headers cannot be forwarded to a different origin and validate every redirect destination.
-
Prompt the user to confirm the normalized destination hostname before the first authenticated request.
-
Recommend a least-privilege, revocable Canvas token and document immediate revocation and replacement procedures for suspected exposure.
-
Store the token in a protected secret manager or tightly permissioned environment configuration. Avoid committing it to the project or placing it in an unprotected
.envfile.
-
