Skip to content

ClosestHostEvent assigns the inherited port, then discards it #3445

Closed

Description

@Tsybon

bbot/core/event/base.py, ClosestHostEvent.__init__:

if parent.host:
    self.data["host"] = str(parent.host)
    self._port = parent.port
    # we do this to refresh the hash
    self.data = self.data      # re-derives everything from data; _port is lost
    break

The data setter re-parses the event from data, which holds no port, so the
assignment on the line above never survives.

Reproduction: a FINDING whose parent is OPEN_TCP_PORT("8.8.8.8:53").
parent.port is 53; the resulting finding.port is None.

Swapping the two lines — refresh the hash first, then assign _port — looks
like the fix. Worth noting in the docstring either way that the inheritance only
runs for events that declare no host of their own.

Activity

  1. self-assigned this
    on Sep 23, 2026
  2. added theissue type on Oct 3, 2026
  3. added a commit that references this issue on Oct 5, 2026
    5cccd2c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions