[PR #34] [MERGED] fix(connectors/filesystem): prevent path traversal in read_file #88

Closed
opened 2026-10-18 21:14:16 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/oikb/pull/34
Author: @mhajder
Created: 6/6/2026
Status: ✅ Merged
Merged: 7/17/2026
Merged by: @tjbck

Base: main ← Head: fix/connectors/filesystem


📝 Commits (1)

  • 61f3bd0 fix(connectors/filesystem): prevent path traversal in read_file

📊 Changes

1 file changed (+8 additions, -1 deletions)

View changed files

📝 src/oikb/connectors/filesystem.py (+8 -1)

📄 Description

This pull request adds a security enhancement to the read_file method in filesystem.py to prevent directory traversal attacks. Now, before reading a file, the code checks that the resolved file path is within the allowed root directory.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/oikb/pull/34 **Author:** [@mhajder](https://github.com/mhajder) **Created:** 6/6/2026 **Status:** ✅ Merged **Merged:** 7/17/2026 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `main` ← **Head:** `fix/connectors/filesystem` --- ### 📝 Commits (1) - [`61f3bd0`](https://github.com/open-webui/oikb/commit/61f3bd0ffe177d73ccc970269bfe81a6048be8f9) fix(connectors/filesystem): prevent path traversal in read_file ### 📊 Changes **1 file changed** (+8 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/oikb/connectors/filesystem.py` (+8 -1) </details> ### 📄 Description This pull request adds a security enhancement to the `read_file` method in `filesystem.py` to prevent directory traversal attacks. Now, before reading a file, the code checks that the resolved file path is within the allowed root directory. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-18 21:14:16 +00:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/oikb#88
No description provided.