T09 · Insecure Skill Coding Practices
- Location
get_tldr.py:91- Finding
Plaintext Logging of Sensitive URLs and API Responses
- Content
View full analysis
Vulnerability Details
File Location:
get_tldr.py:91-103
Vulnerability Type: Sensitive information stored in plaintext
Risk Level: MediumVulnerable Code
python result = summarize(url) # append a log entry: timestamp, sent payload and response payload (ignore errors) try: sent_payload = {"input": url} with open(LOGFILE, "a", encoding="utf-8") as lf: lf.write(json.dumps({ "timestamp": datetime.utcnow().isoformat() + "Z", "sent": sent_payload, "response": result }, ensure_ascii=False) + "\n") except Exception: pass print(json.dumps(result, ensure_ascii=False, indent=2))Technical Analysis
The script persistently records every submitted URL and the complete response from the summarization API. By default, these records are written to
~/.config/get-tldr/skill.log. URLs can contain sensitive query parameters, signed access tokens, private document identifiers, session information, or personal data. API responses may also include confidential content extracted from the submitted resource.The log is opened using the process's default file-creation permissions rather than an explicitly restrictive mode. Its effective permissions consequently depend on the parent directory and the user's
umask. No redaction, retention limit, rotation, encryption, or explicit user consent is implemented. Logging exceptions are also suppressed, preventing users from knowing whether and where sensitive information was stored.Attack Path
- A user invokes the skill with a private or tokenized URL.
- The script sends the URL to the declared external summarization service.
- The script writes both the complete URL and API response to the configured or default log file.
- A local process, another user with filesystem access, a backup system, or an overly broad logfile destination reads the retained record.
- The exposed URL t ...[truncated 616 chars]
- Remediation
View remediation
Remediation Suggestions
- Disable request and response logging by default and require explicit user opt-in.
- Do not log complete URLs. Remove query strings and fragments or redact known secret-bearing parameters such as
token,key,signature, andauth. - Avoid logging API response bodies unless necessary for explicitly enabled debugging.
- Create the logfile with mode
0600and verify that the parent directory is accessible only to the current user. - Reject logfile paths that resolve to unsafe or unexpectedly shared locations, or clearly document the trust boundary when custom paths are allowed.
- Add bounded retention, secure rotation, and deletion controls.
- Notify users when logging is active and report logging failures without exposing secrets.
- Review existing logfiles and securely delete records that are no longer required.
