-
Notifications
You must be signed in to change notification settings - Fork 852
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
CVE-2017-11108 - DoS in print-stp.c #616
Comments
During STP processing, we have a special handler for `SPB` (Shortest Path Bridging) which parses a part of the packet for that specific protocol. To find the length of that part of the packet (`spb_len`), it uses the `mstp_len` variable to find where that value is stored. Since `mstp_len` is unpacked from the packet earlier, it is a user-controlled value and so, the pointer to `sbp_len` can also be user-controlled. We therefore need to check that we can extract it safely, using the `ND_TCHECK_16BITS` macro, as per *Code style and generic remarks* in the `CONTRIBUTING` document. The pointer taken to extract `mstp_len` itself *is* checked, but, oddly, even though the comments say `sbp_len` is validated as well, the macro call is missing. This fixes the symptoms described by CVE-2017-11108 in my tests, but someone with e deeper knowledge of the code should review this to confirm it is the correct solution. Closes: the-tcpdump-group#616
|
When you created this issue, did the issue form display any boilerplate text regarding security? |
|
it did. as I mentioned in the issue, the security team seems to have been contacted by the original author, so I thought this issue was ignored. Considering the issue has been public, with a proof of concept, for more than two weeks, I figured it was fair enough to publish a patch for the issue. I did not, as far as I know, publish additional details regarding the security issue that make it more practical to exploit. |
|
I should also mentioned this is tracked in the Debian BTS (Bug Tracking System): https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=867718 |
|
Thank you for the heads up, this issue is already in the pipeline, we will update shortly how exactly it will be resolved. |
|
anarcat <notifications@github.com> wrote:
I can confirm I have reproduced the issue in tcpdump 4.9.0 in Debian
(stretch
and wheezy), but cannot confirm how easily exploitable it could be. The
An attacker would have to be on the same L2 link, and have permission by the
switching fabric to send STP packets.
I would not expect that to be possible in well configured datacenters as the
hosts (or VMs) ought to be on access ports rather than trunk ports.
That would seem to limit it to networks in homes, small offices, etc.
Not that this diminishes the seriously of it.
thank you following up on this.
|
|
tcpdump release 4.9.1 resolves this specific problem, which was originally discovered by Kamil Frankowicz in February 2017. Thank you very much for the report, please send any future security reports to security@tcpdump.org. |
As part of the Debian LTS audit process, we are investigating the vulnerability in tcpdump identified with CVE-2017-11108:
There was a discussion surrounding the issue in the RedHat bugtrackers, but it is unclear if the original submitter (in CC) was able to reach out to you:
https://bugzilla.redhat.com/show_bug.cgi?id=1468504
I am taking, however, what was said there at face value, however, and therefore opening a discussion surrounding this issue on this bugtracker to ensure followup.
I can confirm I have reproduced the issue in tcpdump 4.9.0 in Debian (stretch and wheezy), but cannot confirm how easily exploitable it could be. The symptoms are easily triggered by running tcpdump against the proof of concept available in the RedHat bugtrackers, under valgrind or when compiling tcpdump with ASAN.
I'm trying to figure out exactly how to fix this, at this stage. It
doesn't look like upstream responded just yet, but I can already say the
following.
tcpdump does try to derefence a pointer with an address value that
is user-controlled (mstp_len) in print-stp.c:478
even when tcpdump doesn't crash, it fails to render the packet
properly. with -vvv, i get this:
notice the trailing comma there: after the
v3lenfield, therewould normally be other things there, but some overflow detection
kicks in stp_print_mstp_bpdu(), which, in turns, calls the magic
ND_TCHECK macro which detects the overflow and bails out properly
therefore, -vvv doesn't trigger the bug
conclusion: it may be simply a matter of calling the proper
ND_TCHECK macro before dereferencing the pointer.
I think that covers most of it. Let me know if you need more information.
The text was updated successfully, but these errors were encountered: