Repository navigation
Keep inherited port on ClosestHostEvent and restore port from JSON - #3462
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #3462 +/- ##
=====================================
- Coverage 91% 91% -0%
=====================================
Files 460 460
Lines 48998 49014 +16
=====================================
+ Hits 44132 44142 +10
- Misses 4866 4872 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
📊 Performance Benchmark Report
📈 Detailed Results (All Benchmarks)
🎯 Performance Summary✅ No significant performance changes detected (all changes <10%) 🐍 Python Version 3.11.16 |
en0f
approved these changes
Oct 5, 2026
This was referenced Oct 6, 2026
Tsybon
added a commit
to Tsybon/bbot
that referenced
this pull request
Oct 13, 2026
ClosestHostEvent takes host and port from the closest parent only when the finding has no host of its own. The module set "host", so even with blacklanternsecurity#3462 event.port stayed None. Without it, a finding parented to the banner's OPEN_TCP_PORT / OPEN_UDP_PORT carries that port, and output/nmap_xml.py records it. The service stays in description: port is not part of the event id, so the same CVE on two ports still needs it to survive dedup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Draft
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.
Closes #3445.
A FINDING (or any
ClosestHostEvent) with no host of its own inherits host, url, path and port from its closest parent. The port never stuck: it was assigned just beforeself.data = self.data, and thedatasetter resets_port. So a FINDING whose parent isOPEN_TCP_PORT("8.8.8.8:53")ended up withport=None.ClosestHostEvent: set_portafter the hash refresh instead of before.event_from_json(): restore the top-levelportthatjson()already writes. Without this, the inherited port was lost again when an event was rebuilt from JSON. Port isn't part of the event's data or id, so this doesn't change any event ids, and event types that compute their port from their data come back with the same value as before.Findings that differ only by port still dedupe into one event, as they always have, since the port isn't part of the id.