T09 · Insecure Skill Coding Practices
- Location
index.js:20- Finding
Secret-redaction rules fail to sanitize common JSON credential fields
- Content
View full analysis
this.config.maxEntrySize) { sanitized = sanitized.slice(0, this.config.maxEntrySize) + '...[TRUNCATED]'; } return JSON.parse(sanitized); }, ``` ### Technical Analysis The implementation serializes `entry.args` with `JSON.stringify()` and then applies regular expressions designed for unquoted key-value syntax such as `password=value` or `password: value`. A typical JavaScript object is serialized as: ```json {"password":"sensitive-value","token":"sensitive-token"} ``` In this representation, a quote occurs between the key name and the colon. For example, the sequence is `password":"`, not `password:`. Consequently, patterns such as `/password[:=]/` and `/token[:=]/` do not match normal JSON properties. The remaining value-oriented patterns only recognize a narrow selection of credential formats. They do not compensate for the failure to identify ordinary password, token, API-key, or secret properties. Nested objects and arrays receive no structural key-based sanitization. The code therefore creates a false assurance that arguments are sanitized before they are appended to the audit log. ### Attack Path 1. ...[truncated 1423 chars]- Remediation
View remediation
