Repository navigation
Network Cloud CLI 6.0.0b2 - path traversal fix. - #10549
Conversation
|
Thank you for your contribution idanielsteven! We will review the pull request and get back to you soon. |
There was a problem hiding this comment.
🟡 Changes recommended
Archive hard links can bypass the extraction budget and write beyond the 1 GiB limit, while truncated gzip downloads raise an unhandled EOFError instead of a handled retrieval error.
2 open issues
What changed in this PR
This PR hardens Network Cloud command-output downloads and archive extraction against path traversal, and prepares release 6.0.0b2.
Changes:
- Adds trusted-host validation, optional SHA-256 verification, and authenticated downloads without redirects.
- Uses the standard archive data filter where available, with legacy safeguards and size/member limits.
- Adds security regression tests and updates release metadata.
| File | Description |
|---|---|
src/networkcloud/setup.py |
Bumps the extension version to 6.0.0b2. |
src/networkcloud/HISTORY.rst |
Records the archive traversal fix. |
src/networkcloud/azext_networkcloud/tests/unit/test_run_command_options.py |
Tests trust arguments and the required storage host. |
src/networkcloud/azext_networkcloud/tests/unit/test_custom_properties.py |
Tests shared download routing and error handling. |
src/networkcloud/azext_networkcloud/tests/unit/test_archive_output.py |
Adds download validation, extraction safety, and limit tests. |
src/networkcloud/azext_networkcloud/operations/run_command_options.py |
Exposes trusted-host and optional checksum arguments. |
src/networkcloud/azext_networkcloud/operations/custom_properties.py |
Centralizes validated downloads and hardens archive extraction. |
Review effort: Balanced
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
Naga Nandyala (naga-nandyala)
left a comment
There was a problem hiding this comment.
Thanks. The hardening looks solid, and both earlier Copilot findings are fixed. A few things before approval:
- Compatibility and documentation:
--output-directorynow requires--expected-storage-host, so existing scripts will fail without modification. Please add a BREAKING CHANGE release note documenting this requirement and the optional--expected-sha256argument.6.0.0b2is fine under the preview versioning rules. - Usability: please document how users determine the trusted storage hostname and add an example. Could it be derived from trusted cluster configuration instead of requiring manual input?
- Error handling: corrupted DEFLATE content raises
zlib.error, which escapes both output handlers. Please normalize it totarfile.ReadError, as done forEOFError, and add a regression test. - Tests:
test_legacy_regular_filefails on Python 3.14: patchingtarfile.data_filter = Nonealso breaks the default extraction filter there. Please simulate the legacy runtime another way. - Archive compatibility: please confirm service-generated result archives never contain symlinks or hard links, since extraction now rejects them.
I had similar concerns about a chicken/egg scenario. I'm inclined to remove the explicit host checking and optional SHA and just stick with an "HTTPS" URL enforcement. This would remove the need for breaking changes because we wouldn't have new parameters. The analysis that drove this STORM bug in our backlog doesn't seem to have been created with usability in mind. |
no impact to ext system.
|
[Release] Update index.json for extension [ networkcloud-6.0.0b2 ] : https://dev.azure.com/msazure/One/_build/results?buildId=190749191&view=results |


🤖 PR Validation —⚠️ Review suggested
Root cause: The client treats a platform-populated pointer as proof that the referenced bytes are trusted. Its hand-written archive guard checks path prefixes but not link semantics, leaving a known gap that the standard extraction filter addresses.
This PR fixes this issue.
aaz: N/a
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install azdevrequired)For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.