test(security): add unit tests for network_guard and zip_safe modules#1395
Merged
qin-ctx merged 2 commits intovolcengine:mainfrom Apr 13, 2026
Merged
test(security): add unit tests for network_guard and zip_safe modules#1395qin-ctx merged 2 commits intovolcengine:mainfrom
qin-ctx merged 2 commits intovolcengine:mainfrom
Conversation
Add comprehensive test coverage for two security-critical modules that previously had zero tests: - network_guard: SSRF protection, internal IP blocking, DNS rebinding edge cases, protocol validation, malformed URL handling - zip_safe: Zip Slip traversal prevention, path normalization, special character handling These modules protect against OWASP Top 10 vulnerabilities (SSRF, path traversal) and should have regression tests to prevent accidental weakening of security boundaries.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
The test_repairs_cjk_filename_from_cp437_mojibake test was missing a final assertion to verify that normalize_zip_filenames() actually repaired the mojibake filename back to the original CJK name. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
qin-ctx
approved these changes
Apr 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add comprehensive unit tests for two security-critical modules with zero prior test coverage:
network_guard: SSRF protection — tests internal IP blocking, DNS rebinding edge cases, IPv6 mapped addresses, protocol validation, malformed URLszip_safe: Path traversal prevention — tests Zip Slip attacks, symlink handling, path normalization, special charactersMotivation
These modules protect against OWASP Top 10 vulnerabilities (SSRF, path traversal). Untested security code is a liability — regression tests ensure boundaries aren't accidentally weakened.
Test plan