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

nsqd: malicious client can (easily) crash server #469

Merged
merged 1 commit into from Oct 6, 2014

Conversation

mreiferson
Copy link
Member

nsqd can be easily crashed. Steps to reproduce:

  • nsq and run nsqd (using the default settings)
  • Telnet to the port it is running on
  • Type ' V2IDENTIFY', press enter and then type 'ctrl-c'
  • The server will panic.
    panic: runtime error: makeslice: len out of range

I am running v0.2.27 on OS X if that make any difference.

@mreiferson mreiferson changed the title Malicious client can (easily) crash server nsqd: malicious client can (easily) crash server Oct 2, 2014
@mreiferson mreiferson added the bug label Oct 2, 2014
@mreiferson
Copy link
Member

I'll take a look at this, thanks for the report @prio!

@mreiferson
Copy link
Member

with the attached commit I now get:

$ ./nsqd
[nsqd] 2014/10/05 23:32:58.890088 nsqd v0.3.0-alpha (built w/go1.3.1)
[nsqd] 2014/10/05 23:32:58.891999 ID: 292
[nsqd] 2014/10/05 23:32:58.892030 NSQ: persisting topic/channel metadata to nsqd.292.dat
[nsqd] 2014/10/05 23:32:58.894088 TCP: listening on [::]:4150
[nsqd] 2014/10/05 23:32:58.894118 HTTP: listening on [::]:4151
[nsqd] 2014/10/05 23:33:01.902695 TCP: new client(127.0.0.1:63139)
[nsqd] 2014/10/05 23:33:05.892995 CLIENT(127.0.0.1:63139): desired protocol magic '  V2'
[nsqd] 2014/10/05 23:33:07.236588 ERROR: [127.0.0.1:63139] - E_BAD_BODY IDENTIFY invalid body size -720899

RFR @jehiah

jehiah added a commit that referenced this pull request Oct 6, 2014
nsqd: malicious client can (easily) crash server
@jehiah jehiah merged commit 7fbee0e into nsqio:master Oct 6, 2014
@mreiferson mreiferson deleted the proto_panic_469 branch October 7, 2014 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants