Harden standalone skill archive validation - #31
Conversation
Self-reviewReviewed the exact remote head Result: no remaining P0–P2 findings. What I checked
Side-effect review
Local verification
PR CI remains the final Python 3.8/Linux verification gate. |
There was a problem hiding this comment.
Code Review
This pull request significantly hardens the skill package validation and creation process by introducing strict canonical ZIP layout checks, size limits, permission checks, and path safety validation. It adds robust preflight checks, local and central header consistency checks, and payload integrity verification, along with comprehensive unit tests to cover these security boundaries. A review comment points out that the encrypted variable defined in validate_package is unused and should be removed.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| validate_physical_layout(archive, archive_infos, data_offsets) | ||
| ) | ||
|
|
||
| encrypted = [info.filename for info in archive_infos if info.flag_bits & 0x1] |
There was a problem hiding this comment.
The variable encrypted is defined via a list comprehension but is never used anywhere in the function. Since the loop below already checks info.flag_bits & 0x1 individually and appends the appropriate error, this list comprehension is redundant and can be safely removed to clean up the code.
References
- Unused variables should be removed to maintain clean and readable code, adhering to PEP 8 guidelines. (link)
Summary
Compatibility
522365039a6bacbc45c0fb9d4a3115a8dcf1bb743f072216c115a3add943a39aVerification
python -m unittest discover -s evals -p 'test_*.py'— 205 passed, 1 local Windows symlink-privilege skip (the platform-independent mocked regression passes)