T09 · Insecure Skill Coding Practices
- Location
SKILL.md:65- Finding
Path Traversal Through Unsanitized Charter Filename Components
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 65–72
Vulnerability Type: Path traversal and unsafe file-path construction
Risk Level: MediumVulnerable Code Snippet:
text meeting-charters/ └── <meeting-code>-<topic>.mdtext 没有会议号时使用 <YYYY-MM-DD>-<topic>.md。Technical Analysis
The skill instructs the agent to construct a persistent charter filename directly from the meeting code and topic. These values may originate from user-provided content or external meeting metadata, but the instructions do not require sanitization, canonicalization, rejection of path separators, or verification that the resolved destination remains inside the intended
meeting-charters/directory.If an implementation follows this filename template literally, crafted values containing path separators or traversal components such as
../could escape the intended storage directory. This conflicts with the stated requirement to save charters only in the current workspace'smeeting-charters/directory.Attack Path
- An attacker supplies a crafted meeting code or topic containing traversal components or path separators.
- The attacker asks the agent to save the resulting meeting charter.
- The agent interpolates the untrusted value into
meeting-charters/<meeting-code>-<topic>.mdwithout sanitization. - Path resolution escapes the intended
meeting-charters/directory. - The agent creates or overwrites an accessible Markdown file elsewhere in the workspace or filesystem, subject to its existing file permissions.
- If a reminder is requested, the escaped absolute path may also be associated with the scheduled reminder and read again when it triggers.
Impact Assessment
Successful exploitation could permit creation or overwrite of files outside the intended charter directory wherever the agent already has write access. It does not grant additio ...[truncated 284 chars]
- Remediation
View remediation
Remediation Suggestions
- Convert the meeting code and topic into strictly validated filename-safe slugs.
- Allow only a conservative character set, such as ASCII letters, digits, hyphens, and underscores.
- Reject or replace
/,\,.., absolute-path prefixes, control characters, and platform-specific reserved characters. - Enforce a reasonable maximum filename length.
- Resolve and canonicalize the destination path before writing.
- Verify that the canonical destination remains beneath the canonical
meeting-charters/directory. - Refuse the operation if containment validation fails.
- Avoid overwriting an existing file unless it is the confirmed charter for the same meeting or the user explicitly approves the overwrite.
- Apply the same containment check before storing the charter path in a reminder and again before reading it when the reminder triggers.
