{"id":53418,"date":"2014-08-04T12:28:52","date_gmt":"2014-08-04T12:28:52","guid":{"rendered":"https:\/\/www.checkmarx.com\/?post_type=glossary&#038;p=8883"},"modified":"2024-06-21T14:05:29","modified_gmt":"2024-06-21T14:05:29","slug":"directory-traversal-vulnerability","status":"publish","type":"glossary","link":"https:\/\/checkmarx.com\/glossary\/directory-traversal-vulnerability\/","title":{"rendered":"Directory Traversal Vulnerability"},"content":{"rendered":"<p><b>Directory Traversal Defined<\/b><br>\nDirectory Traversal (DT) is a HTTP exploit that malicious hackers use in order to gain access to account directories and the data contained within. A successful exploit can result in the entire web server being compromised, including access to directories that are used to control access to restricted areas. For example, the Root Directory is the top-level directory on the server&#8217;s file system. Directory Traversal can be used to gain unauthorized access to this sensitive directory. However, Access Control Lists (ACLs) can be used to control and manage user access for viewing, modifying and executing files.<br>\n<span style=\"color: #333333;\"><!--more--><\/span><br>\nThis vulnerability occurs when browser input is not properly validated, thus allowing malicious attackers to gain access to privileged areas. The Directory Traversal vulnerability can be found in multiple coding languages including Perl, PHP, Apache, Python, ColdFusion and others.<\/p>\n<p><b>How the DT exploit works<\/b><br>\nThere are two main types of DT vulnerabilities &#8211; web server vulnerabilities and application code vulnerabilities.<\/p>\n<ul>\n<li><b>Web server<\/b>: This type of attack typically targets the execution of files. A customized URL containing the name of the target file is sent to the web server along with specific escape codes and other malicious commands. These escape codes allow the attacker to bypass filtering software which results in unauthorized execution of the target file.<\/li>\n<li><b>Application code<\/b>: This exploit is performed when an attacker sends a customized URL to the web server that commands the server to return specific files to the application. But first, the attacker must discover the correct URL that commands the application to retrieve the file from the web server. Once the URL has been discovered, it is modified with the name of the target file for the purpose of maliciously executing it.<\/li>\n<\/ul>\n<p><b>How to prevent DT exploits<\/b><br>\nProper methods of input validation should be implemented to defend against DT vulnerabilities. Once all input commands are validated, malicious attackers have no way to access the aforementioned Root Directory, nor can they execute any restricted files. Filters can also be used to further restrict commands and user input. These filters typically block escape codes and other malicious commands that are typically used by attackers to bypass filters and other restrictions. All software should be kept up-to-date by installing patches and security updates on time.<br>\n<strong>See Directory Traversal Cheat Sheet, Attack Examples &amp; Protection at <a href=\"\/glossary\/path-traversal\/\">Vulnerability Knowledge Base<\/a>.<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Directory Traversal Defined Directory Traversal (DT) is a HTTP exploit that malicious hackers use in order to gain access to account directories and the data contained within. A successful exploit can result in the entire web server being compromised, including access to directories that are used to control access to restricted areas. For example, the [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"template":"","glossary-tags":[],"class_list":["post-53418","glossary","type-glossary","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Directory Traversal Vulnerability - Checkmarx<\/title>\n<meta name=\"description\" content=\"What is Directory Traversal Vulnerability? How the DT exploit works? and How to prevent DT exploits?\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/checkmarx.com\/glossary\/directory-traversal-vulnerability\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Directory Traversal Vulnerability - Checkmarx\" \/>\n<meta property=\"og:description\" content=\"What is Directory Traversal Vulnerability? How the DT exploit works? and How to prevent DT exploits?\" \/>\n<meta property=\"og:url\" content=\"https:\/\/checkmarx.com\/glossary\/directory-traversal-vulnerability\/\" \/>\n<meta property=\"og:site_name\" content=\"Checkmarx\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Checkmarx.Source.Code.Analysis\" \/>\n<meta property=\"article:modified_time\" content=\"2024-06-21T14:05:29+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@checkmarx\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/checkmarx.com\/glossary\/directory-traversal-vulnerability\/\",\"url\":\"https:\/\/checkmarx.com\/glossary\/directory-traversal-vulnerability\/\",\"name\":\"Directory Traversal Vulnerability - Checkmarx\",\"isPartOf\":{\"@id\":\"https:\/\/checkmarx.com\/#website\"},\"datePublished\":\"2014-08-04T12:28:52+00:00\",\"dateModified\":\"2024-06-21T14:05:29+00:00\",\"description\":\"What is Directory Traversal Vulnerability? How the DT exploit works? and How to prevent DT exploits?\",\"breadcrumb\":{\"@id\":\"https:\/\/checkmarx.com\/glossary\/directory-traversal-vulnerability\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/checkmarx.com\/glossary\/directory-traversal-vulnerability\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/checkmarx.com\/glossary\/directory-traversal-vulnerability\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Glossary\",\"item\":\"https:\/\/checkmarx.com\/glossary\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Directory Traversal Vulnerability\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/checkmarx.com\/#website\",\"url\":\"https:\/\/checkmarx.com\/\",\"name\":\"Checkmarx\",\"description\":\"The world runs on code. We secure it.\",\"publisher\":{\"@id\":\"https:\/\/checkmarx.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/checkmarx.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/checkmarx.com\/#organization\",\"name\":\"Checkmarx\",\"url\":\"https:\/\/checkmarx.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/checkmarx.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/checkmarx.com\/wp-content\/uploads\/2024\/02\/logo-dark.svg\",\"contentUrl\":\"https:\/\/checkmarx.com\/wp-content\/uploads\/2024\/02\/logo-dark.svg\",\"width\":1,\"height\":1,\"caption\":\"Checkmarx\"},\"image\":{\"@id\":\"https:\/\/checkmarx.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/Checkmarx.Source.Code.Analysis\",\"https:\/\/x.com\/checkmarx\",\"https:\/\/www.youtube.com\/user\/CheckmarxResearchLab\",\"https:\/\/www.linkedin.com\/company\/checkmarx\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Directory Traversal Vulnerability - Checkmarx","description":"What is Directory Traversal Vulnerability? How the DT exploit works? and How to prevent DT exploits?","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/checkmarx.com\/glossary\/directory-traversal-vulnerability\/","og_locale":"en_US","og_type":"article","og_title":"Directory Traversal Vulnerability - Checkmarx","og_description":"What is Directory Traversal Vulnerability? How the DT exploit works? and How to prevent DT exploits?","og_url":"https:\/\/checkmarx.com\/glossary\/directory-traversal-vulnerability\/","og_site_name":"Checkmarx","article_publisher":"https:\/\/www.facebook.com\/Checkmarx.Source.Code.Analysis","article_modified_time":"2024-06-21T14:05:29+00:00","twitter_card":"summary_large_image","twitter_site":"@checkmarx","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/checkmarx.com\/glossary\/directory-traversal-vulnerability\/","url":"https:\/\/checkmarx.com\/glossary\/directory-traversal-vulnerability\/","name":"Directory Traversal Vulnerability - Checkmarx","isPartOf":{"@id":"https:\/\/checkmarx.com\/#website"},"datePublished":"2014-08-04T12:28:52+00:00","dateModified":"2024-06-21T14:05:29+00:00","description":"What is Directory Traversal Vulnerability? How the DT exploit works? and How to prevent DT exploits?","breadcrumb":{"@id":"https:\/\/checkmarx.com\/glossary\/directory-traversal-vulnerability\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/checkmarx.com\/glossary\/directory-traversal-vulnerability\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/checkmarx.com\/glossary\/directory-traversal-vulnerability\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Glossary","item":"https:\/\/checkmarx.com\/glossary\/"},{"@type":"ListItem","position":2,"name":"Directory Traversal Vulnerability"}]},{"@type":"WebSite","@id":"https:\/\/checkmarx.com\/#website","url":"https:\/\/checkmarx.com\/","name":"Checkmarx","description":"The world runs on code. We secure it.","publisher":{"@id":"https:\/\/checkmarx.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/checkmarx.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/checkmarx.com\/#organization","name":"Checkmarx","url":"https:\/\/checkmarx.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/checkmarx.com\/#\/schema\/logo\/image\/","url":"https:\/\/checkmarx.com\/wp-content\/uploads\/2024\/02\/logo-dark.svg","contentUrl":"https:\/\/checkmarx.com\/wp-content\/uploads\/2024\/02\/logo-dark.svg","width":1,"height":1,"caption":"Checkmarx"},"image":{"@id":"https:\/\/checkmarx.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Checkmarx.Source.Code.Analysis","https:\/\/x.com\/checkmarx","https:\/\/www.youtube.com\/user\/CheckmarxResearchLab","https:\/\/www.linkedin.com\/company\/checkmarx"]}]}},"_links":{"self":[{"href":"https:\/\/checkmarx.com\/wp-json\/wp\/v2\/glossary\/53418","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/checkmarx.com\/wp-json\/wp\/v2\/glossary"}],"about":[{"href":"https:\/\/checkmarx.com\/wp-json\/wp\/v2\/types\/glossary"}],"author":[{"embeddable":true,"href":"https:\/\/checkmarx.com\/wp-json\/wp\/v2\/users\/11"}],"version-history":[{"count":0,"href":"https:\/\/checkmarx.com\/wp-json\/wp\/v2\/glossary\/53418\/revisions"}],"wp:attachment":[{"href":"https:\/\/checkmarx.com\/wp-json\/wp\/v2\/media?parent=53418"}],"wp:term":[{"taxonomy":"glossary-tags","embeddable":true,"href":"https:\/\/checkmarx.com\/wp-json\/wp\/v2\/glossary-tags?post=53418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}