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

Potential panic caused by illegal incoming packet #57

Closed
hMihaiDavid opened this issue Apr 29, 2020 · 0 comments
Closed

Potential panic caused by illegal incoming packet #57

hMihaiDavid opened this issue Apr 29, 2020 · 0 comments

Comments

@hMihaiDavid
Copy link

At the begining of krpc.go:handleRequest(), several unchecked type assertions are made to the values of the parsed bencoded udp packet.

(line 428) t := response["t"].(string)
(line 445) id := a["id"].(string)
... and others ...

An illegal packet that contains a bencode integer instead of a string in the id field would trigger a panic because the type assertion is not checked and recover() is not used. Therefore a malicious packet can crash the process.

I don't know how much of a problem this is though.

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