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

Crash in CCS injection plugin for services not sending data #257

Closed
happyc0ding opened this issue Nov 15, 2017 · 0 comments
Closed

Crash in CCS injection plugin for services not sending data #257

happyc0ding opened this issue Nov 15, 2017 · 0 comments
Labels

Comments

@happyc0ding
Copy link

Sslyze hangs/crashes for the CCS injection plugin in some cases. While debugging I found that it's trapped in the following loop in openssl_ccs_injection.py:

while True:
        try:
            tls_record, len_consumed = TlsRecordParser.parse_bytes(remaining_bytes)
            remaining_bytes = remaining_bytes[len_consumed::]
        except NotEnoughData:
            # Try to get more data
            try:
                raw_ssl_bytes = self._sock.recv(16381)
            except socket.error:
                # Server closed the connection after receiving the CCS payload
                raise NotVulnerableToCcsInjection()
[...]

It seems that some SSL services just stop sending data (unfortunately I have no sample for you and I don't know why they behave that way), therefore "raw_ssl_bytes = self._sock.recv(16381)" never collects enough data to proceed. Since timeouts don't affect this code, it just keeps looping. I've also found that in same rare cases the parent sslyze process returns, but the children are not terminated, however, I have not been able to reproduce that reliably.

Since other plugins work pretty much the same way, they may also be affected in such a scenario. Maybe you could add some timeout here?

@nabla-c0d3 nabla-c0d3 added this to the 1.2.0 milestone Nov 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants