Fix remaining bugs: network collector, list comparison, dead code, command validation - #10
Open
star7js wants to merge 2 commits into
Open
Fix remaining bugs: network collector, list comparison, dead code, command validation#10star7js wants to merge 2 commits into
star7js wants to merge 2 commits into
Conversation
- Use os.path.realpath() in sanitize_path to resolve symlinks, preventing symlink-based path traversal attacks - Fix TOCTOU race in safe_write_file by using os.open() with permissions set atomically at file creation, and create parent dirs with 0o700 - Reject tampered fingerprints: integrity check failure now returns None instead of silently continuing with corrupted data, using constant-time hmac.compare_digest to prevent timing attacks - Add split_lines() helper to filter empty strings from command output, eliminating phantom empty entries in collector data - Fix hash_fingerprint to use SHA3-256, consistent with the project's stated quantum-resistance approach (was incorrectly using SHA-256) - Fix progress_callback type annotation from Optional[object] to Optional[Callable] - Sort keys in compare_dicts for deterministic comparison output - Fix misleading validate_json_safe comment about nesting depth https://claude.ai/code/session_01DT6wq9cpxpu6pErsYv3jx4
…mmand validation - Fix NetworkConfigCollector to parse device names (e.g. en0) from -listnetworkserviceorder output instead of passing service names (e.g. Wi-Fi) to ipconfig getifaddr, which expects interface names - Fix compare_lists crash on unhashable items (dicts) by converting them to canonical JSON strings for Counter keys, then restoring originals in the result - Remove dead default_registry module-level instance that was never used by create_fingerprint (which always creates a fresh registry); make register_all_collectors require an explicit registry parameter - Tighten osascript validation: only exempt the argument following -e from shell metacharacter checks, rather than blanket-allowing all arguments https://claude.ai/code/session_01DT6wq9cpxpu6pErsYv3jx4
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.
Description
Type of Change
How Has This Been Tested?
Checklist
Screenshots (if applicable)
Additional Notes