fix: fail closed on oversized Skops entries#1018
Conversation
Performance BenchmarksCompared
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a3691091ab
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| f"Skipped oversized ZIP entry {file_info.filename} " | ||
| f"({file_info.file_size} bytes > {self.max_zip_entry_read_size} byte read limit)" | ||
| ), | ||
| severity=IssueSeverity.WARNING, |
There was a problem hiding this comment.
Classify oversized-entry failure as informational
Set Skops Oversized ZIP Entry to WARNING causes inconclusive scans to be treated as real security findings. core_results.results_have_security_findings() counts WARNING issues, so results_should_be_unsuccessful() no longer treats these as inconclusive-only and determine_exit_code() returns 1 instead of 2. This mislabels bounded-read incompleteness as a confirmed vuln in automation.
Useful? React with 👍 / 👎.
1b88633 to
559d52a
Compare
Summary
Fail closed when Skops content analysis has to skip oversized ZIP members because they exceed the bounded read limit.
Security impact
Previously,
_read_zip_entry_safely()returnedNonefor oversized members and each CVE detector quietly continued. That meant a large malicious README, card, or payload file could evade content-based checks while the overall scan still finished successfully. This change records a single explicit oversized-entry warning, marks the scan outcome inconclusive, and preserves the bounded-read limit.Validation
uv run ruff format modelaudit/scanners/skops_scanner.py tests/scanners/test_skops_scanner.pyPROMPTFOO_DISABLE_TELEMETRY=1 uv run pytest tests/scanners/test_skops_scanner.py -quv run mypy modelaudit/scanners/skops_scanner.py tests/scanners/test_skops_scanner.py