Skip to content

Fix relay session check and NoneType crash in do_relay() - #70

Open
dfirdeferred wants to merge 1 commit into
dirkjanm:masterfrom
dfirdeferred:fix/relay-bugs
Open

Fix relay session check and NoneType crash in do_relay()#70
dfirdeferred wants to merge 1 commit into
dirkjanm:masterfrom
dfirdeferred:fix/relay-bugs

Conversation

@dfirdeferred

Copy link
Copy Markdown

Summary

  • initConnection() return value bug: do_relay() in both
    smbrelayserver.py and
    httprelayserver.py checks if not client.initConnection(...). Since
    initConnection()
    has no explicit return statement, it returns None, and not None
    evaluates to True
    silently aborting every relay after a successful bind. Fixed by checking

    client.session.bound instead.

  • NoneType crash in httprelayserver: parsed_target.hostname can be
    None, causing
    AttributeError on .lower() during SPN hostname comparison. Added a
    None guard.

  • Debug logging: Added LOG.debug statements to
    ldap_kerberos_auth() for SASL GSSAPI
    bind tracing (only visible with -debug flag).

Files changed

  • lib/servers/smbrelayserver.py — initConnection fix
  • lib/servers/httprelayserver.py — initConnection fix + NoneType guard
  • lib/utils/kerberos.py — debug logging

- Fix initConnection() return value bug in do_relay(): initConnection()
  returns None (no explicit return), causing `if not None` to always
  evaluate True and abort the relay even after a successful bind. Now
  checks client.session.bound instead.

- Fix NoneType crash in httprelayserver do_relay(): parsed_target.hostname
  can be None, causing AttributeError on .lower(). Added None guard.

- Add LOG.debug statements to ldap_kerberos_auth() for SASL GSSAPI bind
  tracing (visible with -debug flag).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant