T09 · Insecure Skill Coding Practices
- Location
SKILL.md:131- Finding
Sensitive Inputs and Encoded Outputs Retained in Cleartext History
- Content
View full analysis
str: """Base64 encoding""" result = base64.b64encode(text.encode("utf-8")).decode("ascii") self._log("base64_encode", text, result) return result ``` ```python def url_encode(self, text: str) -> str: """URL encoding""" from urllib.parse import quote result = quote(text, safe="") self._log("url_encode", text, result) return result ``` ```python def sha256(self, text: str) -> str: """SHA256 hash""" result = hashlib.sha256(text.encode("utf-8")).hexdigest() self._log("sha256", text, result) return result ``` ```python def _log(self, operation: str, input_val: str, output_val: str): self.history.append({ "operation": operation, "input": input_val[:50], "output": output_val[:50], "timestamp": datetime.now().isoformat() }) ``` ### Technical Analysis Base64, URL encoding, and SHA-256 operations automatically pass their input and output to `_log`. The logger retains the first 50 characters of each value in the mutable `history` property for the lifetime of the `CryptoEncoder` instance. Inputs to an encoding utility may include Basic Authentication values, bearer tokens, API keys, personal data, or other secrets. Truncation to 50 characters is not effective redaction: many credentials fit entirely within that limit, while prefixes may still contain security-relevant information. This retention is not required to perform the declared transformations and therefore exceeds minimum data-handling requirements. Base64 and URL encoding themselves are necessary for the Skill's declared purpose, and the audit found no network transmission or covert exfiltration mechanism. The risk arises from unnecessary in-process ...[truncated 997 chars]- Remediation
View remediation
