{"id":775,"date":"2021-07-23T12:37:51","date_gmt":"2021-07-23T12:37:51","guid":{"rendered":"https:\/\/ssdsunucum.com\/blog\/cve-2019-7524-buffer-overflow-when-reading-extension-header-from-dovecot-index-files\/"},"modified":"2021-07-23T12:37:51","modified_gmt":"2021-07-23T12:37:51","slug":"cve-2019-7524-buffer-overflow-when-reading-extension-header-from-dovecot-index-files","status":"publish","type":"post","link":"https:\/\/ssdsunucum.com\/blog\/cve-2019-7524-buffer-overflow-when-reading-extension-header-from-dovecot-index-files\/","title":{"rendered":"CVE 2019 7524 Buffer overflow when reading extension header from Dovecot index files"},"content":{"rendered":"<\/p>\n<div class=\"col-md-9\">\n<div class=\"flex-column flex-md-row article-header\"><\/div>\n<hr>\n<h2 id=\"background-information\">Background Information<\/h2>\n<p>We were made aware of a CVE in Dovecot Versions 2.0.14 &#8211; 2.3.5 that involves using Solr on Thursday, March 28th 2019.<\/p>\n<h2 id=\"releases\">Releases<\/h2>\n<ul>\n<li>\n<p>70 \u2014 70.0.68<\/p>\n<\/li>\n<li>\n<p>76 \u2014 EOL<\/p>\n<\/li>\n<li>\n<p>78 \u2014 78.0.20<\/p>\n<\/li>\n<li>\n<p>CURRENT \u2014 78.0.20<\/p>\n<\/li>\n<li>\n<p>RELEASE \u2014 78.0.20<\/p>\n<\/li>\n<li>\n<p>STABLE \u2014 78.0.20<\/p>\n<\/li>\n<\/ul>\n<h2 id=\"impact\">Impact<\/h2>\n<p>According to the vendor, the risk involves a local <code>root<\/code> privilege escalation or executing arbitrary code in Dovecot process context.<\/p>\n<p>The following lines in <code>dovecot.conf<\/code> are affected: <\/p>\n<div class=\"highlight\">\n<div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;\">\n<tr>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-go\" data-lang=\"go\"><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">1\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">2\n<\/span><\/code><\/pre>\n<\/td>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-go\" data-lang=\"go\"><span style=\"color:#a6e22e\">dovecot<\/span>.<span style=\"color:#a6e22e\">conf<\/span>: <span style=\"color:#a6e22e\">mail_plugins<\/span> = <span style=\"color:#a6e22e\">quota<\/span> <span style=\"color:#a6e22e\">quota_clone<\/span> <span style=\"color:#a6e22e\">zlib<\/span> <span style=\"color:#a6e22e\">fts<\/span> <span style=\"color:#a6e22e\">fts_solr<\/span>\n<span style=\"color:#a6e22e\">dovecot<\/span>.<span style=\"color:#a6e22e\">conf<\/span>: <span style=\"color:#a6e22e\">mail_plugins<\/span> = <span style=\"color:#960050;background-color:#1e0010\">$<\/span><span style=\"color:#a6e22e\">mail_plugins<\/span> <span style=\"color:#a6e22e\">zlib<\/span> <span style=\"color:#a6e22e\">imap_zlib<\/span> <span style=\"color:#a6e22e\">quota_clone<\/span> <span style=\"color:#a6e22e\">virtual<\/span>  <span style=\"color:#a6e22e\">fts<\/span> <span style=\"color:#a6e22e\">fts_solr<\/span><\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div>\n<h2 id=\"how-to-determine-if-your-server-is-up-to-date\">How to determine if your server is up to date<\/h2>\n<p>The updated RPMs provided by cPanel will contain a changelog entry with the CVE number. You can check for this changelog entry with the following command: <\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-perl\" data-lang=\"perl\">rpm <span style=\"color:#f92672\">-<\/span><span style=\"color:#e6db74\">q --changelog <\/span>dovecot <span style=\"color:#f92672\">|<\/span> grep CVE<span style=\"color:#f92672\">-<\/span><span style=\"color:#ae81ff\">2019<\/span><span style=\"color:#f92672\">-<\/span><span style=\"color:#ae81ff\">7524<\/span><\/code><\/pre>\n<\/div>\n<p>This should give you output resembling the following: <\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-perl\" data-lang=\"perl\"><span style=\"color:#f92672\">-<\/span> Patch <span style=\"color:#66d9ef\">for<\/span> CVE<span style=\"color:#f92672\">-<\/span><span style=\"color:#ae81ff\">2019<\/span><span style=\"color:#f92672\">-<\/span><span style=\"color:#ae81ff\">7524<\/span><\/code><\/pre>\n<\/div>\n<h2 id=\"mitigation\">Mitigation<\/h2>\n<p>Dovecot Solr is an opt-in option that can be installed from the Mange Plugins interface of WHM.<\/p>\n<p>If you have previously installed this plugin, we recommend uninstalling it from your cPanel &#038; WHM until we have released patched versions.<\/p>\n<p>In WHM, navigate to the WHM Plugins interface (<em>WHM &gt;&gt; Home \u00bb cPanel \u00bb Manage Plugins<\/em>) and uninstall Solr.<\/p>\n<figure>\n    <img src=\"https:\/\/ssdsunucum.com\/blog\/wp-content\/uploads\/2021\/07\/cve-2019-7524.png\" title=\"cve-2019-7524\"><br \/>\n<\/figure>\n<h2 id=\"official-upstream-security-report\">Official Upstream Security Report<\/h2>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-perl\" data-lang=\"perl\">https:<span style=\"color:#e6db74\">\/\/<\/span>www<span style=\"color:#f92672\">.<\/span>dovecot<span style=\"color:#f92672\">.<\/span>org<span style=\"color:#e6db74\">\/pipermail\/<\/span>dovecot<span style=\"color:#f92672\">-<\/span>news<span style=\"color:#e6db74\">\/2019-March\/<\/span><span style=\"color:#ae81ff\">000403<\/span><span style=\"color:#f92672\">.<\/span>html\nProduct: Dovecot\nVendor: OX Software GmbH\nInternal reference: DOV<span style=\"color:#f92672\">-<\/span><span style=\"color:#ae81ff\">2964<\/span> (Bug ID)\nVulnerability type: CWE<span style=\"color:#f92672\">-<\/span><span style=\"color:#ae81ff\">120<\/span>\nVulnerable version: <span style=\"color:#ae81ff\">2.0.14<\/span> <span style=\"color:#f92672\">-<\/span> <span style=\"color:#ae81ff\">2.3.5<\/span>\nVulnerable component: fts, pop3<span style=\"color:#f92672\">-<\/span>uidl<span style=\"color:#f92672\">-<\/span>plugin\nReport confidence: Confirmed\nResearcher credits: Found in internal testing\nSolution status: Fixed by Vendor\nFixed version: <span style=\"color:#ae81ff\">2.3.5.1<\/span>, <span style=\"color:#ae81ff\">2.2.36.3<\/span>\nVendor notification: <span style=\"color:#ae81ff\">2019<\/span><span style=\"color:#f92672\">-<\/span><span style=\"color:#ae81ff\">02<\/span><span style=\"color:#f92672\">-<\/span><span style=\"color:#ae81ff\">05<\/span>\nSolution date: <span style=\"color:#ae81ff\">2019<\/span><span style=\"color:#f92672\">-<\/span><span style=\"color:#ae81ff\">03<\/span><span style=\"color:#f92672\">-<\/span><span style=\"color:#ae81ff\">21<\/span>\nPublic disclosure: <span style=\"color:#ae81ff\">2019<\/span><span style=\"color:#f92672\">-<\/span><span style=\"color:#ae81ff\">03<\/span><span style=\"color:#f92672\">-<\/span><span style=\"color:#ae81ff\">28<\/span>\nCVE reference: CVE<span style=\"color:#f92672\">-<\/span><span style=\"color:#ae81ff\">2019<\/span><span style=\"color:#f92672\">-<\/span><span style=\"color:#ae81ff\">7524<\/span>\nCVSS: <span style=\"color:#ae81ff\">3.0<\/span><span style=\"color:#e6db74\">\/AV:L\/<\/span>AC:L<span style=\"color:#e6db74\">\/PR:L\/<\/span>UI:N<span style=\"color:#e6db74\">\/S:C\/<\/span>C:H<span style=\"color:#e6db74\">\/I:H\/<\/span>A:H<span style=\"color:#e6db74\">\/E:P\/<\/span>RL:O<span style=\"color:#f92672\">\/<\/span>RC:C (<span style=\"color:#ae81ff\">8.8<\/span>)\n\nVulnerability Details:\nWhen reading FTS <span style=\"color:#f92672\">or<\/span> POP3<span style=\"color:#f92672\">-<\/span>UIDL header from dovecot index, the input\nbuffer size is <span style=\"color:#f92672\">not<\/span> bound, <span style=\"color:#f92672\">and<\/span> data is copied to target structure causing\nstack overflow<span style=\"color:#f92672\">.<\/span>\n\nRisk:\nThis can be used <span style=\"color:#66d9ef\">for<\/span> local root privilege escalation <span style=\"color:#f92672\">or<\/span> executing\narbitrary code in dovecot process context<span style=\"color:#f92672\">.<\/span> This requires ability to\ndirectly modify dovecot indexes<span style=\"color:#f92672\">.<\/span>\nSteps to reproduce:\nProduce dovecot<span style=\"color:#f92672\">.<\/span>index<span style=\"color:#f92672\">.<\/span>log entry that creates an FTS header which has\nmore than <span style=\"color:#ae81ff\">12<\/span> bytes of data<span style=\"color:#f92672\">.<\/span>\nTrigger dovecot indexer<span style=\"color:#f92672\">-<\/span>worker <span style=\"color:#f92672\">or<\/span> run doveadm index<span style=\"color:#f92672\">.<\/span>\nDovecot will crash<span style=\"color:#f92672\">.<\/span>\n\nMitigations:\nSince <span style=\"color:#ae81ff\">2.3.0<\/span> dovecot has been compiled with stack smash protection, ASLR,\nread<span style=\"color:#f92672\">-<\/span>only GOT tables <span style=\"color:#f92672\">and<\/span> other techniques that make exploiting this bug\nmuch harder<span style=\"color:#f92672\">.<\/span>\n\nSolution:\nOperators should update to the latest Patch Release<span style=\"color:#f92672\">.<\/span> The only workaround\nis to disable FTS <span style=\"color:#f92672\">and<\/span> pop3<span style=\"color:#f92672\">-<\/span>uidl plugin<span style=\"color:#f92672\">.<\/span><\/code><\/pre>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Background Information We were made aware of a CVE in Dovecot Versions 2.0.14 &#8211; 2.3.5 that involves using Solr on Thursday, March 28th 2019. Releases 70 \u2014 70.0.68 76 \u2014 EOL 78 \u2014 78.0.20 CURRENT \u2014 78.0.20 RELEASE \u2014 78.0.20 STABLE \u2014 78.0.20 Impact According to the vendor, the risk involves a local root privilege &hellip;<\/p>\n","protected":false},"author":1,"featured_media":776,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/775"}],"collection":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/comments?post=775"}],"version-history":[{"count":0,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/775\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media\/776"}],"wp:attachment":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media?parent=775"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/categories?post=775"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/tags?post=775"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}