From b778445250cc22ab3e01a4cb2766706f810c90a8 Mon Sep 17 00:00:00 2001 From: TY <42710806+CTY-git@users.noreply.github.com> Date: Thu, 5 Dec 2024 16:19:39 +0800 Subject: [PATCH] Fix path resolution issue at code edit tools (#1054) * fix path resolution issue at code edit tools * bump version --- patchwork/common/tools/code_edit_tools.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/patchwork/common/tools/code_edit_tools.py b/patchwork/common/tools/code_edit_tools.py index 6f3b7658..fb44ea11 100644 --- a/patchwork/common/tools/code_edit_tools.py +++ b/patchwork/common/tools/code_edit_tools.py @@ -111,7 +111,7 @@ def tool_records(self): def __get_abs_path(self, path: str): abs_path = (self.repo_path / path.lstrip("/")).resolve() - if not abs_path.is_relative_to(self.repo_path): + if not abs_path.is_relative_to(self.repo_path.resolve()): raise ValueError(f"Path {path} contains illegal path traversal") return abs_path diff --git a/pyproject.toml b/pyproject.toml index 5728c0ae..32eebbbc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "patchwork-cli" -version = "0.0.79" +version = "0.0.80" description = "" authors = ["patched.codes"] license = "AGPL"