| عنوان | mosaxiv clawlet 0.2.10 Improper Link Resolution Before File Access (CWE-59) |
|---|
| الوصف | # Technical Details
An improper link resolution vulnerability exists in the workspace path enforcement used by file tools in `tools/fs_ops.go`, reached through `tools.Registry.Execute` in `tools/registry.go`, of clawlet.
The application fails to detect hardlink aliases that point to files outside the configured workspace. The workspace guard resolves symlinks and checks that the final path appears under the workspace, but it does not verify whether the file inode is also reachable from outside the workspace through a hardlink.
# Vulnerable Code
File: `tools/fs_ops.go`, `tools/registry.go`
Method: `(*Registry).resolvePath`, `(*Registry).readFile`, `(*Registry).writeFile`, `(*Registry).editFile`, `(*Registry).Execute`
Why: `resolvePath` uses `filepath.EvalSymlinks` and path-prefix checks, which catch symlink escapes but not hardlinks. Once a workspace-looking path is accepted, the file tools call `os.ReadFile` or write operations on the resolved path without checking inode aliasing.
# Reproduction
1. On a Unix-like filesystem supporting hardlinks, create an out-of-workspace file such as `outside-secret.txt`.
2. Create `workspace/linked.txt` as a hardlink to that outside file, then trigger the real file-tool APIs through `tools.Registry.Execute` using the in-workspace path `linked.txt`.
3. Confirm that `read_file`, `write_file`, or `edit_file` operate on the outside file even though `tools.restrictToWorkspace=true` is enabled.
# Impact
- Files outside the intended workspace can be read or modified through in-workspace aliases.
- Configuration files, credentials, scripts, or task definitions outside the workspace can be poisoned.
- The workspace boundary relied on by operators is bypassed on same-filesystem targets. |
|---|
| المصدر | ⚠️ https://github.com/mosaxiv/clawlet/issues/15 |
|---|
| المستخدم | Eric-b (UID 96354) |
|---|
| ارسال | 11/06/2026 09:05 AM (1 شهر منذ) |
|---|
| الاعتدال | 13/07/2026 06:57 PM (1 month later) |
|---|
| الحالة | تمت الموافقة |
|---|
| إدخال VulDB | 378124 [mosaxiv clawlet حتى 0.2.10 File Tools tools/fs_ops.go read_file/write_file/edit_file تجاوز الصلاحيات] |
|---|
| النقاط | 20 |
|---|