Skip to content

Fixes smb_login crash #20370

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

msutovsky-r7
Copy link
Contributor

This PR fixes #20183. The problematic code was present in lib/rex/proto/smb/simple_client.rb file, where SMB version negotiation is present:

[snipped]
        dlog("SMB version(s) to negotiate: #{self.versions}")
        ok = self.client.negotiate
        dlog("Negotiated SMB version: SMB#{negotiated_smb_version}")
  
        if self.client.is_a?(RubySMB::Client)
          self.server_max_buffer_size = self.client.server_max_buffer_size
        else
          self.server_max_buffer_size = ok['Payload'].v['MaxBuff']
        end
[snipped]

The ok variable is not checked in any way and so it the negotiation fails for some reason and ok is nil, then ok['Payload'] will fail and crash the module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

fuzzers/smb/smb_create_pipe_corrupt crashes on start
1 participant