Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: fix path traversal detection for windows#1014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletionssemantic_release/cli/config.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -568,15 +568,25 @@ def from_raw_config( # noqa: C901
)

# changelog_file
changelog_file = Path(raw.changelog.changelog_file).expanduser().resolve()
# Must use absolute after resolve because windows does not resolve if the path does not exist
# which means it returns a relative path. So we force absolute to ensure path is complete
# for the next check of path matching
changelog_file = (
Path(raw.changelog.changelog_file).expanduser().resolve().absolute()
)

# Prevent path traversal attacks
if raw.repo_dir not in changelog_file.parents:
raise InvalidConfiguration(
"Changelog file destination must be inside of the repository directory."
)

template_dir = Path(raw.changelog.template_dir).expanduser().resolve()
# Must use absolute after resolve because windows does not resolve if the path does not exist
# which means it returns a relative path. So we force absolute to ensure path is complete
# for the next check of path matching
template_dir = (
Path(raw.changelog.template_dir).expanduser().resolve().absolute()
)

# Prevent path traversal attacks
if raw.repo_dir not in template_dir.parents:
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp