KyZN: fix HIGH+MEDIUM+LOW findings (20260330-234929-20461c76)#3
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Analysis Fixes
Applied fixes for findings at severity LOW and above.
Run ID:
20260330-234929-20461c76Cost: $2.76
Batches: 3 applied (HIGH → MEDIUM → LOW), 0 failed, 0 skipped
Diff: 349 lines
Changes
What Was Fixed
HIGH: 129/129 tests pass. Here's a summary of all changes made:
SEC-001 —
gitshield/hook.py:35–41from pathlib import Pathto module-level importslower.endswith(pattern)withPath(filepath).name.lower() in ALLOWED_PATHS— only files literally named.env.exampleetc. match, preventing bypass via paths like/secrets/malicious.env.exampletest_handle_hook_blocks_allowlist_bypass_via_suffixintests/test_claude.pyBUG-001 —
gitshield/engine.py:300, 375–416config_threshold,extra_patterns,scan_testsparams to_scan_stagedscan_directoryto forward all three params to_scan_staged_scan_staged, now passesconfig_threshold/extra_patternstoscan_fileand skips test files whenscan_tests=FalsePERF-001 —
gitshield/patterns.py:590–598[A-Za-z0-9]{40}to require a contextual keyword prefix (cohere_api_key,COHERE_API_KEY, etc.) — eliminates false positives on git SHAs, UUIDs, and base64 chunksTEST-001 —
tests/test_monitor.py(new file, 10 tests)RepoInfovalidation: valid case, invalid owner, invalid name with spaces, owner with slashclone_and_scan: skips recently-scanned repos, doesn't check skip whenskip_recent=False, rejects non-GitHub URLs (evil.com, http://), returns empty on clone failurefetch_public_events: raisesGitHubErrorwhenrequestsisNoneMEDIUM: The background test run confirmed all 129 tests pass (exit code 0). Nothing more to do unless you have additional changes.
Approach
Findings were batched by severity tier (CRITICAL → HIGH → MEDIUM → LOW).
Each batch was verified and committed independently — if a batch broke tests,
self-repair was attempted. Failed batches were reverted to protect passing code.
Diff budget was tracked incrementally to prevent waste.
Generated by KyZN — autonomous code improvement