Skip to content

security: validate download paths to prevent path traversal#87

Open
manearobert3 wants to merge 1 commit into
Alban1911:mainfrom
manearobert3:fix/path-traversal-downloaders
Open

security: validate download paths to prevent path traversal#87
manearobert3 wants to merge 1 commit into
Alban1911:mainfrom
manearobert3:fix/path-traversal-downloaders

Conversation

@manearobert3
Copy link
Copy Markdown

Filenames received from the GitHub API were used to construct local file paths without checking that the resolved path stays inside the intended directory. A compromised upstream repository could supply a filename like '../../evil.exe' to write arbitrary files on the user's machine.

Apply the existing is_safe_path() helper (already used in safe_extract.py) in both skin_downloader.py and repo_downloader.py before any file is written.

Filenames received from the GitHub API were used to construct local file
paths without checking that the resolved path stays inside the intended
directory. A compromised upstream repository could supply a filename like
'../../evil.exe' to write arbitrary files on the user's machine.

Apply the existing is_safe_path() helper (already used in safe_extract.py)
in both skin_downloader.py and repo_downloader.py before any file is written.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant