T09 · Insecure Skill Coding Practices
- Location
SKILL.md:44- Finding
Unsecured Local Persistence of Sensitive Lark Report Data
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 44–50
Vulnerability Type: Plaintext sensitive-data persistence and unsafe temporary-file handling
Risk Level: MediumVulnerable Code Snippet
markdown ### Step 4: Extract Submitted Members Data - Same page may show multiple weeks — only extract rows belonging to target week - Paginate through all rows for the target week - **Append to local file after each extraction** (prevents data loss)Technical Analysis
The Skill instructs the agent to append extracted weekly-report data to a local file after every extraction. Such data may contain confidential business reports, employee identities, and submission information.
The instruction does not define:
- An approved private storage directory
- Owner-only file permissions
- Encryption at rest
- A randomized and collision-resistant filename
- A retention period
- Cleanup on success or failure
- Restrictions against writing into shared or source-controlled directories
Consequently, sensitive records may remain on disk beyond the task's lifetime. An unspecified local path could also expose the data through backups, source-control operations, shared workspaces, permissive filesystem settings, or access by other local processes and users.
The Skill's authenticated access to Lark and its Lark-only network operations are consistent with its declared collection, document-creation, and notification functionality. No non-Lark exfiltration endpoint was identified. The confirmed weakness is the insufficiently controlled local persistence step.
Attack Path
- A user asks the Skill to collect reports for a team and target week.
- The agent accesses Lark through the user's authenticated browser session.
- The agent extracts report contents and employee submission data.
- Following the Skill's mandatory instruction, it appends each extraction to an unspecified local file.
- The file remains after the report summary is generated bec ...[truncated 834 chars]
- Remediation
View remediation
Remediation Suggestions
- Process report data in memory and avoid writing it to disk unless persistence is strictly necessary.
- If temporary persistence is required, use an explicitly approved private temporary directory outside shared workspaces and repositories.
- Create files atomically with owner-only permissions, such as mode
0600, and use randomized, non-predictable filenames. - Store only the minimum fields needed to produce the requested summary.
- Encrypt temporary data at rest when the execution environment cannot guarantee exclusive access.
- Delete temporary files immediately after document creation, including cleanup in error, cancellation, and timeout paths.
- Define and enforce a short retention limit for recoverable intermediate data.
- Prevent temporary artifacts from entering source control, logs, telemetry, or backups.
- Obtain explicit user approval before retaining report data beyond the active execution.
- Restrict collection to the user-requested templates and weeks, and restrict document sharing and notification recipients to those explicitly authorized.
