Summary
A path traversal vulnerability in AgentScope's LocalWorkspace.add_skill allows an untrusted source path to reference arbitrary directories on the server. When the skill operation is reachable and the supplied path is accepted, files may be copied into the agent workspace and exposed through skill listing functionality.
Affected context
The vulnerability occurs in AgentScope deployments that use LocalWorkspace.add_skill and accept a caller-controlled skill_path parameter. The risk is present when the parameter is not constrained to an approved skills directory and the service account can read the referenced server paths. Copied content may then become accessible through the agent workspace's skill-listing behavior.
Exploit preconditions
- Attack surface: The workspace skill-management interface or request path invoking
LocalWorkspace.add_skill - Required access: Ability to submit or influence a skill-addition request
- Trigger point: Processing of the
skill_pathparameter during skill installation - Why exploitation is possible: The source path is not sufficiently confined to an approved directory, allowing directory traversal or arbitrary server-directory selection when filesystem permissions permit access
Why this happens
The underlying bug is improper limitation of a filesystem path derived from external input. The application uses the supplied source path for file-copy operations without reliably enforcing that it remains beneath an intended trusted base directory. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal.
Potential impact
- Sensitive files may be copied into an agent workspace
- Unauthorized content may become visible through skill listings
- Workspace integrity could be altered by introducing unapproved files
- Downstream agents or tools could consume attacker-controlled skill content
- File permissions and deployment configuration could increase the scope of disclosure
General mitigation guidance
Mitigation generally focuses on making filesystem boundaries explicit and reducing trust in caller-controlled paths.
Common defensive patterns include:
- Accepting logical skill identifiers rather than arbitrary filesystem paths
- Resolving paths against a fixed allowlisted base directory and verifying the final canonical path remains within it
- Rejecting absolute paths, traversal components, symbolic-link escapes, and unexpected path formats
- Applying strict schema and policy validation before any copy operation
- Running the service with least-privilege filesystem permissions and separating sensitive directories from workspace access
- Using isolated, read-only source locations where practical and limiting which workspace content can be listed or consumed
How teams detect issues like this
Organizations can look for path traversal risks through:
- Static analysis rules for filesystem APIs receiving request parameters or other untrusted input
- Code review checks for missing canonicalization, base-directory containment checks, and symlink handling
- Tests that verify absolute paths, parent-directory references, encoded separators, and symlinked locations are rejected
- Runtime policy enforcement that restricts file-copy operations to approved directories
- Audit logging and monitoring for unusual skill paths, unexpected source directories, or bulk workspace changes
Automated code review and security scanning tools may help identify these patterns during development.

