RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1327656 - gnutls-serv: closing connection without sending an Alert message
Summary: gnutls-serv: closing connection without sending an Alert message
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: gnutls
Version: 6.8
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Nikos Mavrogiannopoulos
QA Contact: Alicja Kario
URL:
Whiteboard:
Depends On:
Blocks: 1339222 1343211 1444127
TreeView+ depends on / blocked
 
Reported: 2016-04-15 14:51 UTC by Alicja Kario
Modified: 2017-04-20 15:40 UTC (History)
2 users (show)

Fixed In Version: gnutls-2.12.23-5.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1444127 (view as bug list)
Environment:
Last Closed: 2017-03-21 09:03:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
capture of tls connections (13.27 KB, application/octet-stream)
2016-08-09 11:45 UTC, Nikos Mavrogiannopoulos
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2017:0574 0 normal SHIPPED_LIVE Moderate: gnutls security, bug fix, and enhancement update 2017-03-21 12:23:04 UTC

Description Alicja Kario 2016-04-15 14:51:26 UTC
Description of problem:
Malformed Client Key Exchange messages sent during DHE key exchange are not rejected by server using an Alert message

Version-Release number of selected component (if applicable):
gnutls-2.8.5-19.el6_7.x86_64

How reproducible:
Always

Steps to Reproduce:
git clone https://github.com/tomato42/tlsfuzzer.git
pushd tlsfuzzer
git checkout bad-dhe # won't be necessary in future
git clone https://github.com/warner/python-ecdsa .python-ecdsa
ln -s .python-ecdsa/ecdsa ecdsa
git clone https://github.com/tomato42/tlslite-ng.git .tlslite-ng
pushd .tlslite-ng
git checkout buffered-socket # won't be necessary in future
popd
ln -s .tlslite-ng/tlslite tlslite
popd
openssl req -x509 -newkey rsa -keyout localhost.key -out localhost.crt -nodes -batch -subj /CN=localhost
gnutls-serv --http -p 4433 --priority NORMAL:+VERS-TLS1.2 --x509keyfile localhost.key --x509certfile localhost.crt --disable-client-cert
# in separate terminal
PYTHONPATH=tlsfuzzer python tlsfuzzer/scripts/test-dhe-rsa-key-exchange-with-bad-messages.py

Actual results:
"padded Client Key Exchange" and "invalid dh_Yc value - 8192b" test cases fail with server closing connection without sending an Alert message

Expected results:
padded Client Key Exchange ...
OK

invalid dh_Yc value - 8192b ...
OK

sanity check DHE_RSA_AES_128 ...
OK

truncated dh_Yc value ...
OK

Test end
successful: 4
failed: 0

Additional info:

Comment 1 Nikos Mavrogiannopoulos 2016-05-26 07:43:04 UTC
Not enough information to triage the bug. Is the bug on gnutls-serv not sending an alert message, or is the bug on some malformed DHE client key exchange message being accepted?

Comment 2 Alicja Kario 2016-05-26 10:17:54 UTC
> test cases fail with server [gnutls-serv] closing connection without sending an Alert message

Comment 4 Nikos Mavrogiannopoulos 2016-08-09 11:45:04 UTC
Created attachment 1189225 [details]
capture of tls connections

I'm unable to use the reproducer in a useful way. The reproducer runs 4 tests, and it is unclear which ones should succeed. In any case, making the server return an alert on all situations does not make the reproducer any happier. All I get is unexpected closure from peer, without any details on what is wrong.

padded Client Key Exchange ...
Error encountered while processing node <tlsfuzzer.expect.ExpectAlert object at 0x2467810> (child: <tlsfuzzer.expect.ExpectClose object at 0x2467850>) with last message being: None
Error while processing
Traceback (most recent call last):
  File "tlsfuzzer/scripts/test-dhe-rsa-key-exchange-with-bad-messages.py", line 137, in main
    runner.run()
  File "/root/tlsfuzzer/tlsfuzzer/runner.py", line 152, in run
    raise AssertionError("Unexpected closure from peer")
AssertionError: Unexpected closure from peer


invalid dh_Yc value - 8192b ...
Error encountered while processing node <tlsfuzzer.expect.ExpectAlert object at 0x24673d0> (child: <tlsfuzzer.expect.ExpectClose object at 0x2467410>) with last message being: None
Error while processing
Traceback (most recent call last):
  File "tlsfuzzer/scripts/test-dhe-rsa-key-exchange-with-bad-messages.py", line 137, in main
    runner.run()
  File "/root/tlsfuzzer/tlsfuzzer/runner.py", line 152, in run
    raise AssertionError("Unexpected closure from peer")
AssertionError: Unexpected closure from peer

Comment 5 Alicja Kario 2016-08-22 14:06:59 UTC
(In reply to Nikos Mavrogiannopoulos from comment #4)
> Created attachment 1189225 [details]
> capture of tls connections
> 
> I'm unable to use the reproducer in a useful way. The reproducer runs 4
> tests, and it is unclear which ones should succeed.

all of them

"fail" means "server failed to meet test expected behaviour"

> In any case, making the
> server return an alert on all situations does not make the reproducer any
> happier. All I get is unexpected closure from peer, without any details on
> what is wrong.

it's expecting an alert message while the connection is closed during reading.

from packet capture, it looks like the alert is sent after few seconds, not immediately
 
> padded Client Key Exchange ...
> Error encountered while processing node <tlsfuzzer.expect.ExpectAlert object
> at 0x2467810> (child: <tlsfuzzer.expect.ExpectClose object at 0x2467850>)
> with last message being: None
> Error while processing
> Traceback (most recent call last):
>   File "tlsfuzzer/scripts/test-dhe-rsa-key-exchange-with-bad-messages.py",
> line 137, in main
>     runner.run()
>   File "/root/tlsfuzzer/tlsfuzzer/runner.py", line 152, in run
>     raise AssertionError("Unexpected closure from peer")
> AssertionError: Unexpected closure from peer
> 
> 
> invalid dh_Yc value - 8192b ...
> Error encountered while processing node <tlsfuzzer.expect.ExpectAlert object
> at 0x24673d0> (child: <tlsfuzzer.expect.ExpectClose object at 0x2467410>)
> with last message being: None
> Error while processing
> Traceback (most recent call last):
>   File "tlsfuzzer/scripts/test-dhe-rsa-key-exchange-with-bad-messages.py",
> line 137, in main
>     runner.run()
>   File "/root/tlsfuzzer/tlsfuzzer/runner.py", line 152, in run
>     raise AssertionError("Unexpected closure from peer")
> AssertionError: Unexpected closure from peer

Comment 6 Nikos Mavrogiannopoulos 2016-08-23 07:51:59 UTC
(In reply to Hubert Kario from comment #5)
> (In reply to Nikos Mavrogiannopoulos from comment #4)
> > Created attachment 1189225 [details]
> > capture of tls connections
> > 
> > I'm unable to use the reproducer in a useful way. The reproducer runs 4
> > tests, and it is unclear which ones should succeed.
> 
> all of them

How can I run only one test?

Comment 8 Alicja Kario 2016-08-23 17:32:28 UTC
for now, you can comment out the line that adds the specific test (conversation) to the array of tests to run (conversations), for this test those are lines 53, 79, 103, 125

Comment 9 Alicja Kario 2016-10-12 16:26:22 UTC
I've updated the test case in the client-hello-fuzzing branch, you can run a single test from it by just specifying its name, like so:

  PYTHONPATH=tlsfuzzer python tlsfuzzer/scripts/test-dhe-rsa-key-exchange-with-bad-messages.py 'padded Client Key Exchange'

there's also ability to change the host using -h and the port using -p, like so:

  PYTHONPATH=tlsfuzzer python tlsfuzzer/scripts/test-dhe-rsa-key-exchange-with-bad-messages.py -h 192.168.0.1 -p 443

Comment 14 errata-xmlrpc 2017-03-21 09:03:39 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2017-0574.html


Note You need to log in before you can comment on or make changes to this bug.