Skip to content

Fix remaining bugs: network collector, list comparison, dead code, command validation - #10

Open
star7js wants to merge 2 commits into
mainfrom
claude/code-review-1aT5l
Open

Fix remaining bugs: network collector, list comparison, dead code, command validation#10
star7js wants to merge 2 commits into
mainfrom
claude/code-review-1aT5l

Conversation

@star7js

@star7js star7js commented Feb 11, 2026

Copy link
Copy Markdown
Owner

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring
  • CI/CD changes
  • Dependency updates

How Has This Been Tested?

  • Test A
  • Test B

Checklist

  • My code follows the style guidelines of this project (black, ruff)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Screenshots (if applicable)

Additional Notes

- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants