T09 · Insecure Skill Coding Practices
- Location
scripts/narrative.js:377- Finding
Plaintext Persistence of Sensitive Personal Narratives
- Content
View full analysis
Vulnerability Details
File Location:
scripts/narrative.js:377-382andscripts/narrative.js:441-444
Vulnerability Type: Plaintext storage of sensitive personal data
Risk Level: MediumVulnerable Code
js content: { core_statement: extractCoreStatement(text), detailed_description: text.substring(0, 500), source_text: text },js function saveNarrative(narrative) { ensureFiles(); const line = JSON.stringify(narrative) + '\n'; appendFileSync(NARRATIVE_PATH, line, 'utf-8'); console.log(`叙事记录已保存: ${narrative.id}`); console.log(`标题: ${narrative.title}`); console.log(`重要性: ${narrative.analysis.importance_score.toFixed(2)}`); }Technical Analysis
The Skill records the complete input in
content.source_text, along with a summary, emotional context, detected values, decisions, and inferred behavioral patterns.saveNarrative()serializes this information directly into a plaintext JSONL file at:text ~/.openclaw/workspace/.soul/narratives.jsonlNo encryption-at-rest mechanism or explicit restrictive file mode is applied. Consequently, the file permissions are determined by the process umask and surrounding directory permissions rather than being securely enforced by the Skill.
This is particularly significant because the intended data includes personal decisions, emotional changes, reflections, values, and life events. Repeated operation creates a persistent behavioral profile rather than a single low-value record.
The behavior also conflicts with the encryption claim in
references/narrative-guidelines.md:309-312, which states that records are locally encrypted. No corresponding encryption implementation was found. The documentation also describes user deletion rights, but no record-deletion command is implemented in the audited scripts.Attack Path
- A user or local automation invokes the Skill with personal text through
--process-text,--process-signal, or daily-context processi ...[truncated 1221 chars]
- A user or local automation invokes the Skill with personal text through
- Remediation
View remediation
Remediation Suggestions
- Encrypt narrative and accumulation data at rest with an authenticated-encryption construction such as AES-256-GCM.
- Store encryption keys outside the narrative files, preferably in an operating-system credential store or appropriately secured key-management facility.
- Create the
.souldirectory with mode0700and sensitive files with mode0600; verify and correct permissions on existing files. - Do not retain
source_textby default. Store only the minimum summary needed for the feature, and require explicit user opt-in for full-text retention. - Add configurable retention periods and automatic deletion for old records.
- Implement commands that let users list, inspect, export, redact, and permanently delete individual or all narrative records.
- Use atomic, permission-preserving writes for state and configuration files.
- Update the documentation so encryption and deletion claims precisely match implemented behavior.
- Provide a migration utility that encrypts or securely removes existing plaintext records.
