Skip to content

Security Patch - Resolving path manipulation vulnerability#1361

Merged
mail4umar merged 1 commit intovertica:masterfrom
mail4umar:security_patch
Feb 3, 2026
Merged

Security Patch - Resolving path manipulation vulnerability#1361
mail4umar merged 1 commit intovertica:masterfrom
mail4umar:security_patch

Conversation

@mail4umar
Copy link
Copy Markdown
Collaborator

Ensuring the path from the user is checked.

  • resolving path to absolute
  • ensuring path exists
  • checking if its an actual file

Ensuring the path from the user is checked.

- resolving path to absolute
- ensuring path exists
- checking if its an actual file
@mail4umar mail4umar requested a review from roypaulin January 30, 2026 16:28
@mail4umar mail4umar self-assigned this Jan 30, 2026
@mail4umar mail4umar added the Security Security fixes label Jan 30, 2026
Comment on lines +185 to +192
if not path:
raise ValueError("path must be provided when method='copy'")
# Validate path to prevent path traversal attacks
file_path = Path(path).resolve()
# Ensure the resolved path exists and is a file
if not file_path.is_file():
raise ValueError(f"File not found or is not a regular file: {path}")
with open(file_path, "r", encoding="utf-8") as f:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the file be in an allowed base directory? If we you should add a check for that.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the file can be anywhere. its the user's own system. no need to restrict the user.

@mail4umar mail4umar merged commit 9b9b1cc into vertica:master Feb 3, 2026
1 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Security Security fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants