- Location
- README.md:328
- Finding
- Sensitive User Prompts and Generated Outputs Persisted Without Documented Privacy Controls<![CDATA[
## Vulnerability Details
**File Location**: `README.md:141-151`, `README.md:328-359`
**Vulnerability Type**: Insecure collection and storage of potentially sensitive user content
**Risk Level**: Medium
### Vulnerable Snippet
The documented dashboard client records user content and identity metadata:
```python
from scripts.dashboard_client import record_to_dashboard
record_to_dashboard(
user_input="User input",
user_id="User ID",
channel="feishu",
llm_model="qwen3.5-plus",
skill_name="lingxi",
status="completed",
response_time_ms=123.45
)
```
The proposed API endpoint persists prompts and generated responses in SQLite:
```python
cursor.execute("""
INSERT OR REPLACE INTO tasks (
id, user_id, channel, user_input, status, task_type,
created_at, updated_at, completed_at, skill_name, llm_model,
response_time_ms, llm_tokens_in, llm_tokens_out, final_output
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
""", [
task_id,
task_data.get("user_id", "unknown"),
task_data.get("channel", "unknown"),
task_data.get("user_input", "")[:500],
task_data.get("status", "completed"),
task_data.get("task_type", "realtime"),
task_data.get("created_at", now),
now,
task_data.get("completed_at", now),
task_data.get("skill_name", ""),
task_data.get("llm_model", ""),
task_data.get("response_time_ms", 0),
task_data.get("llm_tokens_in", 0),
task_data.get("llm_tokens_out", 0),
task_data.get("final_output", "")[:1000]
])
conn.commit()
conn.close()
```
### Technical Analysis
The proposed implementation stores `user_id`, `channel`, `user_input`, and `final_output`. Prompts and generated responses can contain credentials, personal information, private communications, source code, or proprietary business data.
Limiting strings to 500 or 1,000 characters does not sanitize or redact sensitive information. The supplied documentation does not require user co
...[truncated 1561 chars]
- Remediation
- <![CDATA[
## Remediation Suggestions
1. Make task telemetry and conversation retention explicitly opt-in.
2. Do not store raw prompts or generated outputs unless they are essential to a user-enabled feature.
3. Apply structured redaction for passwords, API keys, tokens, personal identifiers, and other sensitive values before persistence.
4. Replace stable user identifiers with scoped pseudonymous identifiers where possible.
5. Encrypt the database at rest and protect encryption keys separately from the database.
6. Enforce least-privilege authorization for every read, write, update, and deletion operation.
7. Define short default retention periods and automatically delete expired records.
8. Provide users with clear inspection, export, and deletion controls.
9. Record access in tamper-resistant audit logs without duplicating sensitive content.
10. Document all collected fields, purposes, destinations, retention periods, and access controls.
11. Add tests confirming that sensitive fields are redacted before storage and are not emitted to ordinary logs.
]]>