<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
<title>
GitLab
</title>


<style>img {
max-width: 100%; height: auto;
}
</style>
</head>
<body>
<div class="content">

<p class="details" style="font-style: italic; color: #666;">
<a href="https://gitlab.com/wwang37">Weiqi Wang</a> created an issue: <a href="https://gitlab.com/gnutls/gnutls/-/issues/1224">#1224</a>
</p>
<div></div>
<h2 dir="auto">
<a id="user-content-description-of-problem" class="anchor" href="#description-of-problem" aria-hidden="true"></a>Description of problem:</h2>
<p dir="auto">GnuTLS sends record_overflow alert for a malformed client message. However, the client message <code>\xe8\x03\x00\x00\x02\x02\x50</code> has a valid length. From my understanding:</p>
<ul dir="auto">
<li>
<p>\xe8 is type</p>
</li>
<li>
<p>\x03\x00 is version</p>
</li>
<li>
<p>\x00\x02 is length (2 bytes)</p>
</li>
<li>
<p>\x02\x50 has a length of 2 bytes which corresponds with the length field</p>
</li>
</ul>
<p dir="auto">Since the type is invalid, I think an unexpected_message alert is more appropriate in this case. As per <a href="https://tools.ietf.org/html/rfc5246" rel="nofollow noreferrer noopener" target="_blank">RFC 5246</a></p>
<blockquote dir="auto">
<p>record_overflow</p>
<p>A TLSCiphertext record was received that had a length more than
2^14+2048 bytes, or a record decrypted to a TLSCompressed record
with more than 2^14+1024 bytes.</p>
</blockquote>
<blockquote dir="auto">
<p>unexpected_message</p>
<p>An inappropriate message was received.  This alert is always fatal
and should never be observed in communication between proper
implementations.</p>
</blockquote>
<h2 dir="auto">
<a id="user-content-version-of-gnutls-used" class="anchor" href="#version-of-gnutls-used" aria-hidden="true"></a>Version of gnutls used:</h2>
<p dir="auto">GnuTLS 3.7.0 commit <a href="https://gitlab.com/gnutls/gnutls/-/commit/7e44152fd4076afb0b64ed311fd092669e71fa1e" data-original="7e44152fd4076afb0b64ed311fd092669e71fa1e" data-link="false" data-link-reference="false" data-project="179611" data-commit="7e44152fd4076afb0b64ed311fd092669e71fa1e" data-reference-type="commit" data-container="body" data-placement="top" title="Merge branch 'wip/dueno/typo-fixes' into 'master'" class="gfm gfm-commit has-tooltip">7e44152f</a></p>
<h2 dir="auto">
<a id="user-content-distributor-of-gnutls-eg-ubuntu-fedora-rhel" class="anchor" href="#distributor-of-gnutls-eg-ubuntu-fedora-rhel" aria-hidden="true"></a>Distributor of gnutls (e.g., Ubuntu, Fedora, RHEL)</h2>
<p dir="auto">Ubuntu 18.04</p>
<h2 dir="auto">
<a id="user-content-how-reproducible" class="anchor" href="#how-reproducible" aria-hidden="true"></a>How reproducible:</h2>
<p dir="auto">Steps to Reproduce:</p>
<p dir="auto"><code>gnutls-serv --priority NORMAL:-VERS-ALL:+VERS-TLS1.2:-COMP-ALL:+COMP-NONE --x509keyfile /path/to/key.pem --x509certfile /path/to/cert.pem -p 44331 --noticket -a --http</code></p>
<p dir="auto"><code>echo -n -e "\xe8\x03\x00\x00\x02\x02\x50" | nc 127.0.0.1 44331</code></p>
<h2 dir="auto">
<a id="user-content-actual-results" class="anchor" href="#actual-results" aria-hidden="true"></a>Actual results:</h2>
<p dir="auto">Gnutls sends record_overflow alert. The capture file is attached.</p>
<h2 dir="auto">
<a id="user-content-expected-results" class="anchor" href="#expected-results" aria-hidden="true"></a>Expected results:</h2>
<p dir="auto">Send unexpected_message alert.</p>
<h2 dir="auto">
<a id="user-content-attachments" class="anchor" href="#attachments" aria-hidden="true"></a>Attachments:</h2>
<p dir="auto"><a href="https://gitlab.com/gnutls/gnutls/uploads/9dc498a6f7924b71ead448fc9ad4cfef/gnutls_capture.pcap" data-link="true" class="gfm">gnutls_capture.pcap</a></p>

</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #666;">

<br>
Reply to this email directly or <a href="https://gitlab.com/gnutls/gnutls/-/issues/1224">view it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can
<a href="https://gitlab.com/-/sent_notifications/e25abf6b119e76dad8fd0a3e8eac322d/unsubscribe">unsubscribe</a>
from this thread or
adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Issue","url":"https://gitlab.com/gnutls/gnutls/-/issues/1224"}}</script>


</p>
</div>
</body>
</html>