{"id":17185,"date":"2021-06-22T14:07:00","date_gmt":"2021-06-22T12:07:00","guid":{"rendered":"https:\/\/usd.formwandler.rocks\/?p=17185"},"modified":"2021-08-04T14:11:22","modified_gmt":"2021-08-04T12:11:22","slug":"news-top-vulnerabilities-2020-sql-injection","status":"publish","type":"post","link":"https:\/\/www.usd.de\/en\/news-top-vulnerabilities-2020-sql-injection\/","title":{"rendered":"usd HeroLab Top 5 Vulnerabilities 2020: SQL Injection"},"content":{"rendered":"\n<p>During&nbsp;<a href=\"https:\/\/www.usd.de\/en\/security-analysis-pentests\/pentest\/\">penetration tests<\/a>&nbsp;our&nbsp;<a href=\"https:\/\/herolab.usd.de\/en\/our-experts\/\" target=\"_blank\" rel=\"noopener\">security analysts<\/a>&nbsp;repeatedly uncover gateways in IT systems and applications that pose significant risks to corporate security. They increasingly identify the same vulnerabilities in different IT assets, some of which have been known for years. In our mini-series, we present our top 5 most notable vulnerabilities from 2020. Part 3: SQL Injection<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Vulnerability Background<\/h3>\n\n\n\n<p>SQL injection vulnerabilities allow an attacker to inject own database commands into legitimate database queries. This can be used for various types of attacks. Usually, a successful attack allows full access to the application-relevant parts of the database. In many cases, it is then possible to escalate permissions within the database or to access the server\u2018s file system. In the worst case, an SQL injection vulnerability allows the execution of arbitrary operating system commands on the underlying server.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Exemplary hacker attack and its consequences<\/h3>\n\n\n\n<p>The following example demonstrates an SQL injection vulnerability that ultimately allows the attacker to access password hashes of registered users. The initial entry point is located inside a search function for forum posts.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.usd.de\/wp-content\/uploads\/01-sql-example-search.png\" alt=\"\" class=\"wp-image-17169\" width=\"820\" height=\"551\" \/><figcaption>Figure 1: Application with a search for forum posts<\/figcaption><\/figure><\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>The screenshot above shows the vulnerable search function, that can be used to search forum posts by title. Inserting special characters within the search query can provoke a database error, as demonstrated in the following screenshot:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.usd.de\/wp-content\/uploads\/02-sql-error.png\" alt=\"\" class=\"wp-image-17171\" width=\"572\" height=\"73\" \/><figcaption>Figure 2: Database error caused by special characters<\/figcaption><\/figure><\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Based on the obtained database error, an attacker can now refine the attack. The following screenshot shows how the vulnerability can be exploited to extract password hashes from the database:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.usd.de\/wp-content\/uploads\/03-sqli-hash.png\" alt=\"\" class=\"wp-image-17173\" width=\"821\" height=\"538\" \/><figcaption>Figure 3: Password hashes are extracted from the database<\/figcaption><\/figure>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Recommended measures<\/h3>\n\n\n\n<p>User-controlled input should always be considered potentially dangerous and should never be used within database queries without sufficient filtering and encoding. Appropriate functions for filtering input are available in all common programming languages. Furthermore, it is recommended to use&nbsp;<em>prepared statements<\/em>. With this technique, the structure of a database query is sent to the database server in advance, before the data actually used for the query is inserted. The database server thus knows the structure of the query and subsequent modification by an attacker is no longer possible.<\/p>\n\n\n\n<p>Please note that this is a very general recommendation for security measures. We are happy to support you with individual solutions.&nbsp;<a href=\"https:\/\/www.usd.de\/en\/contact-form-analysis-pentests\/\">Feel free to contact us<\/a>.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<hr class=\"wp-block-separator is-style-default\" \/>\n\n\n\n<br>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:25%\">\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.usd.de\/wp-content\/uploads\/icon-dokument-orange-040.png\" alt=\"\" class=\"wp-image-64\" width=\"77\" height=\"100\" \/><\/figure><\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-vertically-aligned-top is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:50%\">\n<p>Read more about our top 5 most notable vulnerabilities and other exciting topics in our\u00a0<a href=\"https:\/\/www.usd.de\/wp-content\/uploads\/usd-HeroLab-Annual-Report-2020.pdf\">2020 Annual Report<\/a>.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:25%\"><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>During&nbsp;penetration tests&nbsp;our&nbsp;security analysts&nbsp;repeatedly uncover gateways in IT systems and applications that pose significant risks to corporate security. They increasingly identify the same vulnerabilities in different IT assets, some of which have been known for years. In our mini-series, we present our top 5 most notable vulnerabilities from 2020. Part 3: SQL Injection Vulnerability Background SQL [&hellip;]<\/p>\n","protected":false},"author":96,"featured_media":15972,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","inline_featured_image":false,"footnotes":""},"categories":[373,374],"tags":[1448,377,378,1449],"class_list":["post-17185","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news-en","category-pentests-security-analyses-en","tag-application-security","tag-penetrationstest-en","tag-pentest-en","tag-sql-injection-2"],"_links":{"self":[{"href":"https:\/\/www.usd.de\/en\/wp-json\/wp\/v2\/posts\/17185","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.usd.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.usd.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.usd.de\/en\/wp-json\/wp\/v2\/users\/96"}],"replies":[{"embeddable":true,"href":"https:\/\/www.usd.de\/en\/wp-json\/wp\/v2\/comments?post=17185"}],"version-history":[{"count":0,"href":"https:\/\/www.usd.de\/en\/wp-json\/wp\/v2\/posts\/17185\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.usd.de\/en\/wp-json\/wp\/v2\/media\/15972"}],"wp:attachment":[{"href":"https:\/\/www.usd.de\/en\/wp-json\/wp\/v2\/media?parent=17185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.usd.de\/en\/wp-json\/wp\/v2\/categories?post=17185"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.usd.de\/en\/wp-json\/wp\/v2\/tags?post=17185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}