{"id":82266,"date":"2020-05-20T19:42:07","date_gmt":"2020-05-20T17:42:07","guid":{"rendered":"https:\/\/prohoster.info\/blog\/novosti-interneta\/udalyonno-ekspluatiruemaya-uyazvimost-v-pochtovom-servere-qmail"},"modified":"2020-05-20T19:42:07","modified_gmt":"2020-05-20T17:42:07","slug":"udalyonno-ekspluatiruemaya-uyazvimost-v-pochtovom-servere-qmail","status":"publish","type":"post","link":"https:\/\/prohoster.info\/en\/blog\/news\/udalyonno-ekspluatiruemaya-uyazvimost-v-pochtovom-servere-qmail","title":{"rendered":"Remotely exploitable vulnerability in the qmail mail server","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>Security researchers from Qualys <noindex><a rel=\"nofollow\" href=\"https:\/\/www.openwall.com\/lists\/oss-security\/2020\/05\/19\/8\">have shown<\/a><\/noindex> of <noindex><a rel=\"nofollow\" href=\"https:\/\/www.qualys.com\/2020\/05\/19\/cve-2005-1513\/remote-code-execution-qmail.txt\">exploitation<\/a><\/noindex> vulnerabilities in the qmail mail server, <noindex><a rel=\"nofollow\" href=\"https:\/\/www.opennet.ru\/opennews\/art.shtml?num=5442\">famous<\/a><\/noindex> existing since 2005 (CVE-2005-1513), but remaining unpatched, as the author of qmail claimed that it was unrealistic to create a working exploit that could be used to attack systems with default configurations. Qualys managed to prepare an exploit that disproves this assumption and allows for remote code execution on the server by sending a specially crafted message.<\/p>\n<p>The issue is caused by an integer overflow in the stralloc_readyplus() function, which can occur when processing a very large message. A 64-bit system with more than 4GB of virtual memory was required for exploitation. When initially analyzing the vulnerability in 2005, Daniel J. Bernstein argued that the assumption present in the code that the size of the allocated array would always fit within a 32-bit value was based on the fact that nobody allocates gigabytes of memory to each process. Over the past 15 years, 64-bit systems have replaced 32-bit systems on servers, dramatically increasing the amounts of memory provided and network bandwidth. <\/p>\n<p>The accompanying packages with qmail took Bernstein's remark into account and limited the available memory when the qmail-smtpd process was started (for example, in Debian 10, there is a 7MB limit). However, engineers from Qualys discovered that this was insufficient and, in addition to qmail-smtpd, a remote attack could also be conducted on the qmail-local process, which remained unrestricted in all checked packages. As proof, a prototype exploit was prepared, suitable for attacking the Debian-supplied qmail package in its default configuration.<br \/>\nTo organize remote code execution during the attack, 4GB of free disk space and 8GB of RAM are required on the server.<br \/>\nThe exploit allows executing any shell commands with the privileges of any user in the system, except for root and system users who do not have their own subdirectory in the \"\/home\" directory (the qmail-local process runs with the rights of the local user to whom the delivery is made).<\/p>\n<p>The attack is carried out<br \/>\nby sending a very large email message, including several lines in the header, around 4GB and 576MB in size. Processing such a line in qmail-local results in an integer overflow when trying to deliver the message to a local user. The integer overflow subsequently leads to a buffer overflow when copying data and the potential for rewriting memory pages with libc code. By manipulating the layout of the transmitted data, it is possible to overwrite the address of the function \"open()\" with the address of the \"system()\" function. <\/p>\n<p>Next, during the call to qmesearch() in qmail-local, the file \".qmail-extension\" is opened via the open() function, which effectively launches the function<br \/>\nsystem(\".qmail-extension\"). But since part of the file \"extension\" is generated based on the recipient's address (for example, \"localuser-extension@localdomain\"), attackers can arrange for the command to be sent for execution by specifying the user \"localuser-;command;@localdomain\" as the recipient of the message. <\/p>\n<p>As part of the code analysis, two vulnerabilities were also identified in the additional patch qmail-verify, which is included in the Debian package. The first vulnerability (<noindex><a rel=\"nofollow\" href=\"https:\/\/security-tracker.debian.org\/tracker\/CVE-2020-3811\">CVE-2020-3811<\/a><\/noindex>) allows bypassing the email address verification, while the second (<noindex><a rel=\"nofollow\" href=\"https:\/\/security-tracker.debian.org\/tracker\/CVE-2020-3812\">CVE-2020-3812<\/a><\/noindex>) leads to the leakage of local information. In particular, the first vulnerability allows bypassing the validity check of the address used in the exploit to send the command (the check does not activate for addresses without a domain, such as \"localuser-;command;\"). The second vulnerability can be used to check for the existence of files and directories in the system, including those accessible only to root (qmail-verify runs with root privileges), through direct access to the local handler.<\/p>\n<p>To bypass the issue, Bernstein recommended running qmail processes while setting a global memory limit (\"softlimit -m12345678\"). This way, the problem is blocked. An alternative protection method mentioned is limiting the maximum size of the processed message via the file \"control\/databytes\" (by default, it's not created, leaving qmail vulnerable with default settings). Additionally, the \"control\/databytes\" does not protect against local attacks from system users, as the limitation is only considered in qmail-smtpd.<\/p>\n<p>The issue affects the package <noindex><a rel=\"nofollow\" href=\"https:\/\/security-tracker.debian.org\/tracker\/source-package\/netqmail\">netqmail<\/a><\/noindex>, included in the Debian repositories. A set of patches has been prepared for this package to address both old vulnerabilities from 2005 (by adding strict memory limits through the alloc() function) and new issues in qmail-verify. Separately <noindex><a rel=\"nofollow\" href=\"https:\/\/free.acrconsulting.co.uk\/email\/qmail-verify.html\">prepared<\/a><\/noindex> the updated version of the qmail-verify patch. The developers <noindex><a rel=\"nofollow\" href=\"https:\/\/www.opennet.ru\/opennews\/art.shtml?num=51326\">branch<\/a><\/noindex> <noindex><a rel=\"nofollow\" href=\"https:\/\/notqmail.org\/\">notqmail<\/a><\/noindex> have prepared their patches to block old problems and have also initiated work to eliminate any potential integer overflows in the code.<\/p>\n<p><noindex><a rel=\"nofollow\" name=\"link\"><\/a><\/noindex><\/p>\n<p>Source: <a \ncontent=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/www.opennet.ru\/opennews\/art.shtml?num=52991\">opennet.ru<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u0418\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0438\u0437 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Qualys \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u043f\u043e\u0447\u0442\u043e\u0432\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 qmail, \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0439 \u0435\u0449\u0451 \u0441 2005 \u0433\u043e\u0434\u0430 (CVE-2005-1513), \u043d\u043e \u043e\u0441\u0442\u0430\u0432\u0430\u0432\u0448\u0435\u0439\u0441\u044f \u043d\u0435\u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439, \u0442\u0430\u043a \u043a\u0430\u043a \u0430\u0432\u0442\u043e\u0440 qmail \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u043b \u043e \u043d\u0435\u0440\u0435\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u0433\u043e \u044d\u043a\u0441\u043f\u043b\u043e\u0438\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0433 \u0431\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0430\u0442\u0430\u043a\u0438 \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u0412 Qualys \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u044d\u043a\u0441\u043f\u043b\u043e\u0438\u0442 \u043e\u043f\u0440\u043e\u0432\u0435\u0440\u0433\u0430\u044e\u0449\u0438\u0439 \u0434\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0438\u043d\u0438\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u0442\u044c [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[702],"tags":[],"class_list":["post-82266","post","type-post","status-publish","format-standard","hentry","category-news"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.2 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u0418\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0438\u0437 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Qualys \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/en\/blog\/news\/udalyonno-ekspluatiruemaya-uyazvimost-v-pochtovom-servere-qmail\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.2\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u0423\u0434\u0430\u043b\u0451\u043d\u043d\u043e \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0438\u0440\u0443\u0435\u043c\u0430\u044f \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u043f\u043e\u0447\u0442\u043e\u0432\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 qmail | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u0418\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0438\u0437 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Qualys \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/en\/blog\/news\/udalyonno-ekspluatiruemaya-uyazvimost-v-pochtovom-servere-qmail\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2020-05-20T17:42:07+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-05-20T17:42:07+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Remotely exploitable vulnerability in the qmail mail server | ProHoster","description":"Security researchers from Qualys demonstrated the possibility of","canonical_url":"https:\/\/prohoster.info\/en\/blog\/news\/udalyonno-ekspluatiruemaya-uyazvimost-v-pochtovom-servere-qmail","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u0423\u0434\u0430\u043b\u0451\u043d\u043d\u043e \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0438\u0440\u0443\u0435\u043c\u0430\u044f \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u043f\u043e\u0447\u0442\u043e\u0432\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 qmail | ProHoster","og:description":"\u0418\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0438\u0437 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Qualys \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c","og:url":"https:\/\/prohoster.info\/en\/blog\/news\/udalyonno-ekspluatiruemaya-uyazvimost-v-pochtovom-servere-qmail","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2020-05-20T17:42:07+00:00","article:modified_time":"2020-05-20T17:42:07+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"82266","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":null,"breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-02-28 15:41:28","updated":"2022-09-27 18:41:59","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/82266","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/comments?post=82266"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/82266\/revisions"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media?parent=82266"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/categories?post=82266"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/tags?post=82266"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}