T09 · Insecure Skill Coding Practices
- Location
handler.ts:68- Finding
Unrestricted Context Data Is Written to Application Logs
- Content
View full analysis
Vulnerability Details
File Location:
handler.ts, lines 68-70
Vulnerability Type: Sensitive information exposure through logging
Risk Level: MediumVulnerable Code:
typescript if (Object.keys(context).length > 0) { console.log(` Context:`, context); }Technical Analysis
The
contextinput is an unrestricted, caller-controlled object intended to carry additional workflow information. The implementation writes the entire object to standard output without filtering, redaction, size limits, or an explicit debug-mode requirement.Agent workflows may include credentials, access tokens, customer information, internal deployment details, file paths, or other sensitive values in this object. Standard output is frequently retained by process supervisors, CI/CD systems, container platforms, or centralized logging services. These logs may have broader readership and longer retention than the original in-memory data.
This issue does not independently transmit information over the network or grant system access. Exploitation requires a sensitive value to be supplied in
contextand an attacker or unauthorized operator to have access to the resulting logs.Attack Path
- A caller or integrated agent invokes
run()with sensitive information in thecontextobject. - The implementation accepts the object without restricting or classifying its fields.
- Lines 68-70 pass the complete object to
console.log. - The runtime, process supervisor, or hosting platform stores or forwards standard output.
- A user or service with access to those logs retrieves the exposed information.
- If the logged data includes active credentials, the recipient may use the privileges already associated with those credentials.
Impact Assessment
The direct impact is loss of confidentiality for data supplied through
context. The affected scope includes the local console and any downstream logging, r ...[truncated 501 chars]- A caller or integrated agent invokes
- Remediation
View remediation
Remediation Suggestions
- Remove wholesale logging of the
contextobject from normal operation. - If diagnostic logging is necessary, require an explicit debug configuration that is disabled by default in production.
- Allowlist fields that are safe to log rather than attempting to block only known secret names.
- Apply recursive redaction to credential-like fields such as
password,secret,token,apiKey,authorization,cookie, and private-key material. - Limit the permitted depth, field count, and serialized size of context data to reduce accidental disclosure and log abuse.
- Log only metadata when possible, such as the names or count of context fields, rather than their values.
- Document that callers must not place secrets or regulated personal data in diagnostic fields.
- Configure deployment logs with least-privilege access, suitable retention limits, and secure deletion practices.
- Add automated tests confirming that representative secrets are absent from captured standard output.
- Remove wholesale logging of the
