High severity8.8NVD Advisory· Published Jul 31, 2024· Updated Apr 15, 2026
CVE-2024-7340
CVE-2024-7340
Description
The Weave server API allows remote users to fetch files from a specific directory, but due to a lack of input validation, it is possible to traverse and leak arbitrary files remotely. In various common scenarios, this allows a low-privileged user to assume the role of the server admin.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
weavePyPI | < 0.50.8 | 0.50.8 |
Patches
1f43d5fb75e0dsecurity(weave): Fixing path traversal in send_local_file (#1657)
1 file changed · +17 −11
weave/weave_server.py+17 −11 modified@@ -396,19 +396,25 @@ def execute_v2(): @blueprint.route("/__weave/file/<path:path>") def send_local_file(path): - # path is given relative to the FS root. check to see that path is a subdirectory of the - # local artifacts path. if not, return 403. then if there is a cache scope function defined - # call it to make sure we have access to the path - abspath = ( - "/" / pathlib.Path(path) - ) # add preceding slash as werkzeug strips this by default and it is reappended below in send_from_directory try: - local_artifacts_path = pathlib.Path(filesystem.get_filesystem_dir()).absolute() - except errors.WeaveAccessDeniedError: - abort(403) - if local_artifacts_path not in list(abspath.parents): + # Retrieve and normalize the local artifacts path + local_artifacts_path = pathlib.Path(filesystem.get_filesystem_dir()).resolve( + strict=True + ) + + # Construct the full absolute path of the requested file + requested_path = (local_artifacts_path / path).resolve(strict=True) + + # Ensure the requested path is within the local artifacts directory + if not str(requested_path).startswith(str(local_artifacts_path)): + abort(403) + + # Send the file from the directory + return send_from_directory( + local_artifacts_path, str(requested_path.relative_to(local_artifacts_path)) + ) + except (errors.WeaveAccessDeniedError, FileNotFoundError): abort(403) - return send_from_directory("/", path) @blueprint.before_request
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
6- github.com/advisories/GHSA-r49h-6qxq-624fghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2024-7340ghsaADVISORY
- github.com/wandb/weave/commit/f43d5fb75e0d52933a52ecd9a0ce2f9b082e6c9fghsaWEB
- github.com/wandb/weave/pull/1657nvdWEB
- research.jfrog.com/vulnerabilities/wandb-weave-server-remote-arbitrary-file-leak-jfsa-2024-001039248ghsaWEB
- research.jfrog.com/vulnerabilities/wandb-weave-server-remote-arbitrary-file-leak-jfsa-2024-001039248/nvd
News mentions
0No linked articles in our index yet.