Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

security(weave): Fixing path traversal in send_local_file #1657

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

anandwandb
Copy link

This PR addresses a path traversal vulnerability in weave_server.py, discovered by a bug bounty researcher

abspath = "/" / pathlib.Path(path) constructs an absolute path by joining the root directory / with the provided path. It ensures that abspath always starts from the root directory, however - it doesn't protect against path traversal attacks. An attacker could give a path like ../../../../../../../etc/passwd and read sensitive files outside of the root directory of the webserver.

The patch proposed in this PR checks to ensure that the resolved requested_path starts with the local_artifact_path - otherwise throws a 403 Error.

@anandwandb anandwandb requested a review from a team as a code owner May 17, 2024 04:39
Copy link
Contributor

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request

@circle-job-mirror
Copy link

circle-job-mirror bot commented May 17, 2024

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.

None yet

1 participant