Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[severe] Failure to complete whois query #111

Closed
theunkn0wn1 opened this issue Jan 14, 2019 · 1 comment
Closed

[severe] Failure to complete whois query #111

theunkn0wn1 opened this issue Jan 14, 2019 · 1 comment
Assignees

Comments

@theunkn0wn1
Copy link
Collaborator

There appears to be a severe bug in Client.whois that causes the pydle bot to lock up when .whois is awaited.

** Severity ** Breaking. This bug can be used to induce denial of service events on any pydle implementations that utilize a whois.

Minimum test case

Pydle Client setup

import pydle

class MyOwnBot(pydle.Client):
    async def on_connect(self):
        await self.join('#unkn0wndev')
        await super().on_connect()

    async def on_message(self, source, target, message):
        print(f"[{source}] <{target}>: {message}")

        if message == "whoami":
            subject = await self.whois(source)
            await self.message(source, f"{subject}")


if __name__ == "__main__":
    print("making a bot instance...")
    # create an instance of our bot
    client = MyOwnBot('Pydlebot-unknown', realname='Pydle on python 3.7')

    client.run(hostname='localhost', port=6667, tls=False, tls_verify=False)

Test run (irc invocation)

whoami

Client logs (verbose)

[#unkn0wndev] <unknown>: whoami
<2019-01-13 16:10:12,488 MyOwnBot:localhost> [DEBUG] << :unknown!unknown@FAD02BA2.6E5BC772.BF52DB44.IP PRIVMSG #unkn0wndev :whoami
<2019-01-13 16:10:12,488 MyOwnBot:localhost> [DEBUG] >> WHOIS #unkn0wndev

I did a wireshark capture on the conversation and the Server is correctly responding with a whois reply.
Investigation is required to determine where Pydle is blocking.

@theunkn0wn1 theunkn0wn1 self-assigned this Jan 14, 2019
@theunkn0wn1
Copy link
Collaborator Author

Root cause is a deadlock, working on a fix now...

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

No branches or pull requests

1 participant