{"id":52066,"date":"2023-05-25T00:00:00","date_gmt":"2023-05-25T00:00:00","guid":{"rendered":"urn:uuid:d0b11015-74cf-cce8-80c2-49b43d406d72"},"modified":"2023-05-25T00:00:00","modified_gmt":"2023-05-25T00:00:00","slug":"understanding-xpath-injection-vulnerabilities","status":"publish","type":"post","link":"https:\/\/www.threatshub.org\/blog\/understanding-xpath-injection-vulnerabilities\/","title":{"rendered":"Understanding XPath Injection Vulnerabilities"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/www.trendmicro.com\/content\/dam\/trendmicro\/global\/en\/devops\/thumbnails\/23\/xpath-injection-vulnerabilities.jpg\"><\/p>\n<div><img decoding=\"async\" src=\"https:\/\/www.trendmicro.com\/content\/dam\/trendmicro\/global\/en\/devops\/thumbnails\/23\/xpath-injection-vulnerabilities.jpg\" class=\"ff-og-image-inserted\"><\/div>\n<p>When developers need to query an XML database, they use XML Path Language (XPath) to construct these queries. An XPath query searches the XML document to find nodes that match a specified pattern or have particular attributes. XML databases remain a common means of storing user data. When a user supplies their login ID and password, they trigger the preconfigured XPath query, which searches the database for the matching credentials and supplies access if the provided combination exists.<\/p>\n<p>However, the ability to trigger an XPath query via user-supplied information introduces the risk of XPath injection attacks. These attacks occur when specially constructed XPath queries gain access to the XML data structure. Malicious actors can take advantage of user input fields to inject arbitrary XPath code that can access or modify the XML document data. This means that, even if the attacker cannot retrieve passwords (if the database only contains password hash values), they can still use the discovered XML structure to cause additional harm.<\/p>\n<p>In this article, you\u2019ll view some example code to discover how XPath injection attacks work and learn some best practices for preventing and mitigating them.<\/p>\n<p><span class=\"body-subhead-title\">The risks of XPath injection<\/span><\/p>\n<p>XPath injection attacks are one of the most prevalent and dangerous web application vulnerabilities. A successful attack can have several potential consequences, including:<\/p>\n<ul>\n<li><span class=\"rte-red-bullet\">Access to and exfiltration of sensitive data or personally identifiable information (PII).<\/span><\/li>\n<li><span class=\"rte-red-bullet\">Deletion, modification, or corruption of crucial business data.<\/span><\/li>\n<li><span class=\"rte-red-bullet\">Gaining root access to a system and performing actions that compromise system integrity.<\/span><\/li>\n<li><span class=\"rte-red-bullet\">Distribution of malware or other malicious code to internal and external users.<\/span><\/li>\n<\/ul>\n<p>The consequences of such attacks can ruin the reputation of your application and your users. Therefore, you need to be conscious of the risks associated with XPath injection attacks and take the necessary measures to mitigate them. In the next section, you\u2019ll examine a sample XPath injection attack to learn how to best defend against them.<\/p>\n<p><span class=\"body-subhead-title\">How XPath injection works<\/span><\/p>\n<p>This section reviews how XPath queries work, provides a hands-on demonstration of an XPath injection attack, and how to mitigate or prevent these attacks.<\/p>\n<p><b>How XPath queries work<\/b><\/p>\n<p>Imagine an application that enables users to search for items in an XML file. To enable this function, the application uses the following expression:<\/p>\n<p><span class=\"rte-icon-component-text\">\/\/*[contains(text(), $search)]<\/span><\/p>\n<p>In this query, the user-supplied string replaces the <span class=\"rte-icon-component-text\">$search<\/span> variable. The query then searches the XML document for all text strings that match this input. When it executes, the application will work as expected.<\/p>\n<p>However, this type of query is vulnerable to attackers who can enter malicious XPath code that allows them to bypass the XML document hierarchy. Consequently, they may access or even modify the XML data in unforeseen and dangerous ways.<\/p>\n<p>For example, the knowledgeable attacker can use the user input form to inject the following XPath code into the query\u2019s <span class=\"rte-icon-component-text\">$search<\/span> variable:<\/p>\n<p><span class=\"rte-icon-component-text\">a&#8217; or true() or &#8216;<\/span><\/p>\n<p>As a result, the application constructs and executes the following XPath query:<\/p>\n<p><span class=\"rte-icon-component-text\">\/\/*[contains(text(), &#8216;a&#8217; or true() or &#8221;)]<\/span><\/p>\n<p>A query of this type would match all nodes in an XML document, and depending on the program, might allow the attacker to access and modify any data the document contains.<\/p>\n<p>Additionally, an attacker can ascertain an XML document\u2019s structure, which can potentially enable them to navigate among several layers of the contained data. When this type of access is the goal, malicious actors tend to use one of the following two XPath injection methods:<\/p>\n<ul>\n<li><span class=\"rte-red-bullet\"><span class=\"rte-red-text\">Booleanization<\/span>: Boolean queries will generate different behaviors depending on whether they resolve into <span class=\"rte-icon-component-text\">true<\/span> or <span class=\"rte-icon-component-text\">false<\/span> conditions. An attacker could inject a Boolean query that returns true if a login request is successful and <span class=\"rte-icon-component-text\">false<\/span> if the login fails. This allows the attacker to retrieve a single bit of information (success or failure) with each query. Repeating this process enables an attacker to gain insight into the contents of the XML document.<\/span><\/li>\n<li><span class=\"rte-red-bullet\"><span class=\"rte-red-text\">XML crawling<\/span>: Attackers can inject specially crafted queries that enable them to discover the structure of an XML document. These queries allow the attacker to \u201ccrawl\u201d through an XML document without knowing its structure beforehand. By repeatedly sending such queries to the XML document and examining the responses, the attacker can gradually discover the structure of the document and the elements it contains. Eventually, they can piece together the gathered information to reconstruct the entire document. This approach can be an effective means for discovering sensitive information or exploitable vulnerabilities in the document structure.<\/span><\/li>\n<\/ul>\n<p><b>Sample XPath injection vulnerabilities<\/b><\/p>\n<p>To see how XPath injections emerge and function, you\u2019ll create a demo application vulnerable to these attacks. You\u2019ll create a demo application that checks the user-supplied input to return data from an XML document.<\/p>\n<p>Say you\u2019re working with an e-commerce platform and that you maintain a list of your customers (users), each of which is identified using a username. To connect your orders with their purchasers, you use an application to search for the username to return the orders they are associated with, as listed on the order status page.<\/p>\n<p>Below is an XML data construct called <span class=\"rte-icon-component-text\">orders_data.xml<\/span>, which will represent this scenario.<\/p>\n<p><span class=\"rte-icon-component-text\">&lt;users&gt;<\/span><\/p>\n<p><span class=\"rte-icon-component-text\">&nbsp;&nbsp;&nbsp; &lt;orders&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;username&gt;johndoe&lt;\/username&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;order&gt;Custom Xbsg Item#3668&lt;\/order&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;timestamp&gt;1671301351&lt;\/timestamp&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;reference&gt;HS0282&lt;\/reference&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;code&gt;gwr23d2has3fa13gs24&lt;\/code&gt;<br \/>&nbsp;&nbsp;&nbsp; &lt;\/orders&gt;<\/span><\/p>\n<p><span class=\"rte-icon-component-text\">&nbsp;&nbsp;&nbsp; &lt;orders&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;username&gt;michael_read&lt;\/username&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;order&gt;Archep Cores Item#668&lt;\/order&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;timestamp&gt;1671301351&lt;\/timestamp&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;reference&gt;HS0282&lt;\/reference&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;code&gt;gwr23d2has3fa13gs24&lt;\/code&gt;<br \/>&nbsp;&nbsp;&nbsp; &lt;\/orders&gt;<\/span><\/p>\n<p><span class=\"rte-icon-component-text\">&nbsp;&nbsp;&nbsp; &lt;orders&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;username&gt;adammrray&lt;\/username&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;order&gt;Partial CoSum Item#92623&lt;\/order&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;timestamp&gt;1671301351&lt;\/timestamp&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;reference&gt;HS0282&lt;\/reference&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;code&gt;gwr23d2has3fa13gs24&lt;\/code&gt;<br \/>&nbsp;&nbsp;&nbsp; &lt;\/orders&gt;<\/span><\/p>\n<p><span class=\"rte-icon-component-text\">&lt;\/users&gt;<\/span><\/p>\n<p>You\u2019ll use JavaScript to execute the above data and create a basic application that allows users to query the data using inputs they supply.<\/p>\n<p>In the same directory, run the following command to initialize <a href=\"https:\/\/nodejs.org\/en\/\" target=\"_blank\" rel=\"noopener\">Node.js,<\/a> a JavaScript runtime:<\/p>\n<p><span class=\"rte-icon-component-text\">npm init \u2013y<\/span><\/p>\n<p>Then, you\u2019ll need to use need the following to execute XML. Note that they\u2019re both included in Node.js:<\/p>\n<p><a href=\"https:\/\/www.npmjs.com\/package\/xpath\" target=\"_blank\" rel=\"noopener\">XPath<\/a>\u2014For DOM implementation and helper for JavaScript that supports XPath query strings<br \/><a href=\"https:\/\/www.npmjs.com\/package\/xmldom\" target=\"_blank\" rel=\"noopener\">XMLDOM<\/a>\u2014For JavaScript implementation of DOM for Node.js that supports the XML Parser interface<\/p>\n<p>Open a terminal to your app directory and run the following command:<\/p>\n<p><span class=\"rte-icon-component-text\">npm i xpath xmldom<\/span><\/p>\n<p>In the same directory, create an <span class=\"rte-icon-component-text\">index.js<\/span> file and execute the XML data as follows:<\/p>\n<p>First, import the required dependencies:<\/p>\n<p><span class=\"rte-icon-component-text\">const fs = require(&#8216;fs&#8217;);<br \/>const xpath = require(&#8216;xpath&#8217;);<br \/>const dom = require(&#8216;xmldom&#8217;).DOMParser;<br \/>const util = require(&#8216;util&#8217;);<br \/>const readline = require(&#8216;readline&#8217;).createInterface({<br \/>&nbsp;&nbsp;&nbsp; input: process.stdin,<br \/>&nbsp;&nbsp;&nbsp; output: process.stdout<br \/>});<\/span><\/p>\n<p>Then, create a simple readline module to allow user-supplied inputs:<\/p>\n<p><span class=\"rte-icon-component-text\">async function enterOrder(){<br \/>&nbsp;&nbsp;&nbsp; let question = util.promisify(readline.question).bind(readline);<br \/>&nbsp;&nbsp;&nbsp; try{<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const order = await question(&#8220;Enter the username&#8221;);<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return order;<br \/>&nbsp;&nbsp;&nbsp; }catch(err){<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; err;<br \/>&nbsp;&nbsp;&nbsp; }<br \/>}<\/span><\/p>\n<p>Create a function to execute XML query and return data from the input using the code below:<\/p>\n<p><span class=\"rte-icon-component-text\">async function xpath_injection_example(){<\/span><\/p>\n<p>&nbsp;&nbsp;&nbsp; const xml = fs.readFileSync(&#8216;orders_data.xml&#8217;,&#8217;utf-8&#8242;);<br \/>&nbsp;&nbsp;&nbsp; const doc = new dom().parseFromString(xml);<br \/>&nbsp;<br \/>&nbsp;&nbsp;&nbsp; var order = await enterOrder();<br \/>&nbsp;&nbsp;&nbsp; if(order){<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const evaluator = xpath.parse(`\/users\/orders[username = &#8216;${order}&#8217;]\/order`);<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const character = evaluator.select1({<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; node: doc,<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; variables: {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; order<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; });<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(character){<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console.log(character.textContent);<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }else{<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console.log(&#8220;User does not exist&#8221;);<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br \/>&nbsp;&nbsp;&nbsp; }<br \/>}<\/p>\n<p>\/\/ execute this function<br \/>xpath_injection_example()<\/p>\n<p>In the above example, the query <span class=\"rte-icon-component-text\">\/users\/orders[username = &#8216;${order}&#8217;]\/order<\/span> will be executed. The order elements are children of orders with a username element, where the value is equal to the variable supplied in the user input.<\/p>\n<p><span class=\"rte-icon-component-text\">[username = &#8216;${order}&#8217;]<\/span> specifies a predicate condition that must be satisfied by the selected elements. In this case, the predicate specifies that the username element must have a value equal to the value of the order variable.<\/p>\n<p>This way, the order element is selected as a child of the orders element that satisfies the predicate. Now run the following command to execute this program:<\/p>\n<p><span class=\"rte-icon-component-text\">node index.js<\/span><\/p>\n<p>This will allow you to enter the username, just like a user would have used a search-supplied input.<\/p>\n<p>Enter a username in your <span class=\"rte-icon-component-text\">orders_data.xml<\/span> file, as shown below. This should display the associated order. Otherwise, a \u201cUser does not exist\u201d message will be displayed if the username doesn\u2019t exist.<\/p>\n<p><span class=\"rte-icon-component-text\">Enter the username michael_read<br \/>Archep Cores Item#668<\/span><\/p>\n<p><b>Exploring XPath injection vulnerabilities<\/b><\/p>\n<p>This application is working as it should. However, an attacker with malicious intentions can run arbitrary XPath queries using the supplied user input to get access without needing a valid username.<\/p>\n<p>The application is vulnerable to malicious code injection. The predicate <span class=\"rte-icon-component-text\">[username = &#8216;${order}&#8217;]<\/span> is the target for the attacker here. An attacker can construct a query that evaluates this expression to satisfy its condition. Using the injected code, the query will evaluate to true and allows the attacker to gain access without supplying the correct username.<\/p>\n<p>Here are some arbitrary queries that can allow attackers to maneuver around the data hierarchy using the user-supplied input:<\/p>\n<ul>\n<li><span class=\"rte-red-bullet\">&#8216;or&#8217;1&#8217;=&#8217;1<\/span><\/li>\n<li><span class=\"rte-red-bullet\">text&#8217; or &#8216;1&#8217; = &#8216;1<\/span><\/li>\n<li><span class=\"rte-red-bullet\">&#8216; or 1=1 or &#8216;a&#8217;=&#8217;a<\/span><\/li>\n<li><span class=\"rte-red-bullet\">&#8216; or &#8221;=&#8217;<\/span><\/li>\n<li><span class=\"rte-red-bullet\">a&#8217; or true() or &#8216;<\/span><\/li>\n<li>&nbsp;<\/li>\n<\/ul>\n<p>Here is how to execute all of the above arbitrary queries using <span class=\"rte-icon-component-text\">a&#8217; or true() or &#8216;<\/span> as the example:<\/p>\n<p><span class=\"rte-icon-component-text\">Enter the username a&#8217; or true() or &#8216;<br \/>Archep Cores Item#668<\/span><\/p>\n<p><b>Mitigating XPath injections<\/b><\/p>\n<p>As you can see in the example above, properly constructed injections mean that an attacker can too easily access restricted data. So, this section explores how you can patch common vulnerabilities and mitigate the risks associated with XPath injections.<\/p>\n<p>This attack takes advantage of a lack of proper variable parameter binding in the application\u2019s code. The application concatenates user-supplied input directly into an XPath query without adequately validating or sanitizing the input. This is where the attacker can insert malicious XPath statements into the query to access sensitive information from the XML database.<\/p>\n<p>To mitigate this, the best strategy is to use parameter binding to prevent injection. To accomplish this, you can use a regular expression that removes any characters that are not letters or numbers. This method prevents potential attackers from constructing arbitrary queries.<\/p>\n<p>To sanitize and prevent XPath injection vulnerabilities in this example, use the following code:<\/p>\n<p><span class=\"rte-icon-component-text\">async function&nbsp; enterOrder(){<br \/>&nbsp;&nbsp;&nbsp; let question = util.promisify(readline.question).bind(readline);<br \/>&nbsp;&nbsp;&nbsp; const regex = \/[^a-z0-9]\/g;<br \/>&nbsp;&nbsp;&nbsp; try{<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const order = await question(&#8220;Enter the username &#8220;);<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(regex.exec(order)){<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console.log(&#8220;Invalid characters not allowed&#8221;);<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else{<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return order;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><\/p>\n<p>&nbsp;&nbsp;&nbsp; }catch(err){<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; err;<br \/>&nbsp;&nbsp;&nbsp; }<br \/>}<\/p>\n<p>async function xpath_injection_example(){<\/p>\n<p>&nbsp;&nbsp;&nbsp; const xml = fs.readFileSync(&#8216;orders_data.xml&#8217;,&#8217;utf-8&#8242;);<br \/>&nbsp;&nbsp;&nbsp; const doc = new dom().parseFromString(xml);<br \/>&nbsp;<br \/>&nbsp;&nbsp;&nbsp; var order = await enterOrder();<br \/>&nbsp;&nbsp;&nbsp; if(order){<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const evaluator = xpath.parse(`\/users\/orders[username = &#8216;${order}&#8217;]\/order`);<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const character = evaluator.select1({<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; node: doc,<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;variables: {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; order<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; });<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(character){<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console.log(character.textContent);<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }else{<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console.log(&#8220;Order number does not exist&#8221;);<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br \/>&nbsp;&nbsp;&nbsp; }<br \/>}<\/p>\n<p>\/\/ execute this function<br \/>xpath_injection_example()<\/p>\n<p>The above code uses regex to detect and filter non-alphanumeric characters. If the supplied input has such characters, the application will stop any further execution and provide the message, \u201cInvalid characters not allowed.\u201d However, if the input passes this test, the application will proceed and execute the query with the supplied input. You can test the code with the arbitrary queries discussed in the section above.<\/p>\n<p>Although you can sanitize user inputs, an attacker could still use other techniques to bypass this filter.<\/p>\n<p>It\u2019s virtually impossible to escape all potentially exploitable characters using regex expressions. In cases like user authentication, the application requires users to provide passwords that may contain such characters. This means that sanitizing user inputs is not wholly reliable.<\/p>\n<p>Another alternative is to use parameterized XPath queries, as shown below:<\/p>\n<p><span class=\"rte-icon-component-text\">const evaluator = xpath.parse(`\/users\/orders[username = $order]\/order`);<\/span><\/p>\n<p>const character = evaluator.select1({<\/p>\n<p><span class=\"rte-icon-component-text\">&nbsp; node: doc,<br \/>&nbsp; variables: {<br \/>&nbsp;&nbsp;&nbsp; order: order<br \/>&nbsp; }<br \/>});<\/span><\/p>\n<p>However, this approach contains a dynamic XPath expression constructed using string interpolation, which can also be constructed from user-supplied data. Therefore, this method may not be sufficient to fully protect against XPath injection.<\/p>\n<p><b>Using precompiled XPath queries<\/b><\/p>\n<p>You can use a precompiled XPath query to avoid dynamic XPath expression. This is achieved by defining the XPath expression as a separate variable and then passing it when it is needed.<\/p>\n<p>The precompiled XPath query uses a variable to represent the user-provided input. This ensures they aren&#8217;t constructed from user-supplied data. Thus, an attacker cannot run any arbitrary code to gain access. Here is an example of how to use a precompiled XPath query:<\/p>\n<p><span class=\"rte-icon-component-text\">async function xpath_injection_example() {<br \/>&nbsp;&nbsp;&nbsp; const xml = fs.readFileSync(&#8216;orders_data.xml&#8217;, &#8216;utf-8&#8217;);<br \/>&nbsp;&nbsp;&nbsp; const doc = new dom().parseFromString(xml);<br \/>&nbsp;<br \/>&nbsp;&nbsp;&nbsp; \/\/ Define the precompiled XPath query<br \/>&nbsp;&nbsp;&nbsp; const xpathQuery = `\/users\/orders[username = $order]\/order`;<br \/>&nbsp;<br \/>&nbsp;&nbsp;&nbsp; const order = await enterOrder();<br \/>&nbsp;&nbsp;&nbsp; if (order) {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/ Use the precompiled XPath query<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const evaluator = xpath.parse(xpathQuery);<br \/>&nbsp;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const character = evaluator.select1({<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; node: doc,<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; variables: {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; order: order<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; });<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (character) {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console.log(character.textContent);<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console.log(&#8220;Order number does not exist&#8221;);<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br \/>&nbsp;&nbsp;&nbsp; }<br \/>}<br \/>&nbsp;<br \/>\/\/ Execute the function<br \/>xpath_injection_example();<\/span><\/p>\n<p>This helps ensure that user-supplied input is treated as separate from the XPath query rather than as part of the query itself.<\/p>\n<p><span class=\"body-subhead-title\">Conclusion<\/span><\/p>\n<p>You have now learned some common strategies for executing XPath injection attacks and gained insight into their potential consequences. Fortunately, you also discovered some ways to mitigate the risks.<\/p>\n<p>However, your application may still be vulnerable to XPath injection even after implementing the security measures you explored. To maximize application security, turning to tools like Web Application Firewalls (WAFs) or Web Application and API Protection (WAAP) can fill in the gaps that coding best practices may not address. Visit Trend Micro today to begin assessing your app\u2019s security posture.<\/p>\n<p> Read More <a href=\"https:\/\/www.trendmicro.com\/en_us\/devops\/23\/e\/xpath-injection-vulnerabilities.html\">HERE<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The ability to trigger XPath queries with user-supplied information introduces the risk of XPath injection attacks. Read on to explore how these attacks work and discover how to keep your XPath queries secure. Read More HERE&#8230;<\/p>\n","protected":false},"author":2,"featured_media":52067,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_layout":"default_layout","footnotes":""},"categories":[61],"tags":[9503,9505,9502,9501,9542,9571],"class_list":["post-52066","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-trendmicro","tag-trend-micro-devops-article","tag-trend-micro-devops-aws","tag-trend-micro-devops-azure","tag-trend-micro-devops-cloud-native","tag-trend-micro-devops-google-cloud-platform","tag-trend-micro-devops-how-to"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Understanding XPath Injection Vulnerabilities 2026 | ThreatsHub Cybersecurity News<\/title>\n<meta name=\"description\" content=\"ThreatsHub Cybersecurity News | ThreatsHub.org | Cloud Security &amp; Cyber Threats Analysis Hub. 100% Free OSINT Threat Intelligent and Cybersecurity News.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.threatshub.org\/blog\/understanding-xpath-injection-vulnerabilities\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Understanding XPath Injection Vulnerabilities 2026 | ThreatsHub Cybersecurity News\" \/>\n<meta property=\"og:description\" content=\"ThreatsHub Cybersecurity News | ThreatsHub.org | Cloud Security &amp; Cyber Threats Analysis Hub. 100% Free OSINT Threat Intelligent and Cybersecurity News.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.threatshub.org\/blog\/understanding-xpath-injection-vulnerabilities\/\" \/>\n<meta property=\"og:site_name\" content=\"ThreatsHub Cybersecurity News\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-25T00:00:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.trendmicro.com\/content\/dam\/trendmicro\/global\/en\/devops\/thumbnails\/23\/xpath-injection-vulnerabilities.jpg\" \/>\n<meta name=\"author\" content=\"TH Author\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@threatshub\" \/>\n<meta name=\"twitter:site\" content=\"@threatshub\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TH Author\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"15 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/understanding-xpath-injection-vulnerabilities\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/understanding-xpath-injection-vulnerabilities\\\/\"},\"author\":{\"name\":\"TH Author\",\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/#\\\/schema\\\/person\\\/12e0a8671ff89a863584f193e7062476\"},\"headline\":\"Understanding XPath Injection Vulnerabilities\",\"datePublished\":\"2023-05-25T00:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/understanding-xpath-injection-vulnerabilities\\\/\"},\"wordCount\":2914,\"publisher\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/understanding-xpath-injection-vulnerabilities\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/understanding-xpath-injection-vulnerabilities.jpg\",\"keywords\":[\"Trend Micro DevOps : Article\",\"Trend Micro DevOps : AWS\",\"Trend Micro DevOps : Azure\",\"Trend Micro DevOps : Cloud Native\",\"Trend Micro DevOps : Google Cloud Platform\",\"Trend Micro DevOps : How To\"],\"articleSection\":[\"TrendMicro\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/understanding-xpath-injection-vulnerabilities\\\/\",\"url\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/understanding-xpath-injection-vulnerabilities\\\/\",\"name\":\"Understanding XPath Injection Vulnerabilities 2026 | ThreatsHub Cybersecurity News\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/understanding-xpath-injection-vulnerabilities\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/understanding-xpath-injection-vulnerabilities\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/understanding-xpath-injection-vulnerabilities.jpg\",\"datePublished\":\"2023-05-25T00:00:00+00:00\",\"description\":\"ThreatsHub Cybersecurity News | ThreatsHub.org | Cloud Security & Cyber Threats Analysis Hub. 100% Free OSINT Threat Intelligent and Cybersecurity News.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/understanding-xpath-injection-vulnerabilities\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/understanding-xpath-injection-vulnerabilities\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/understanding-xpath-injection-vulnerabilities\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/understanding-xpath-injection-vulnerabilities.jpg\",\"contentUrl\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/05\\\/understanding-xpath-injection-vulnerabilities.jpg\",\"width\":1282,\"height\":700},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/understanding-xpath-injection-vulnerabilities\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Trend Micro DevOps : Article\",\"item\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/tag\\\/trend-micro-devops-article\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Understanding XPath Injection Vulnerabilities\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/\",\"name\":\"ThreatsHub Cybersecurity News\",\"description\":\"%%focuskw%% Threat Intel \u2013 Threat Intel Services \u2013 CyberIntelligence \u2013 Cyber Threat Intelligence - Threat Intelligence Feeds - Threat Intelligence Reports - CyberSecurity Report \u2013 Cyber Security PDF \u2013 Cybersecurity Trends - Cloud Sandbox \u2013- Threat IntelligencePortal \u2013 Incident Response \u2013 Threat Hunting \u2013 IOC - Yara - Security Operations Center \u2013 SecurityOperation Center \u2013 Security SOC \u2013 SOC Services - Advanced Threat - Threat Detection - TargetedAttack \u2013 APT \u2013 Anti-APT \u2013 Advanced Protection \u2013 Cyber Security Services \u2013 Cybersecurity Services -Threat Intelligence Platform\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/#organization\"},\"alternateName\":\"Threatshub.org\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/#organization\",\"name\":\"ThreatsHub.org\",\"alternateName\":\"Threatshub.org\",\"url\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/Threatshub_Favicon1.jpg\",\"contentUrl\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/Threatshub_Favicon1.jpg\",\"width\":432,\"height\":435,\"caption\":\"ThreatsHub.org\"},\"image\":{\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/threatshub\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.threatshub.org\\\/blog\\\/#\\\/schema\\\/person\\\/12e0a8671ff89a863584f193e7062476\",\"name\":\"TH Author\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/066276f086d5155df79c850206a779ad368418a844da0182ce43f9cd5b506c3d?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/066276f086d5155df79c850206a779ad368418a844da0182ce43f9cd5b506c3d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/066276f086d5155df79c850206a779ad368418a844da0182ce43f9cd5b506c3d?s=96&d=mm&r=g\",\"caption\":\"TH Author\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Understanding XPath Injection Vulnerabilities 2026 | ThreatsHub Cybersecurity News","description":"ThreatsHub Cybersecurity News | ThreatsHub.org | Cloud Security & Cyber Threats Analysis Hub. 100% Free OSINT Threat Intelligent and Cybersecurity News.","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:\/\/www.threatshub.org\/blog\/understanding-xpath-injection-vulnerabilities\/","og_locale":"en_US","og_type":"article","og_title":"Understanding XPath Injection Vulnerabilities 2026 | ThreatsHub Cybersecurity News","og_description":"ThreatsHub Cybersecurity News | ThreatsHub.org | Cloud Security & Cyber Threats Analysis Hub. 100% Free OSINT Threat Intelligent and Cybersecurity News.","og_url":"https:\/\/www.threatshub.org\/blog\/understanding-xpath-injection-vulnerabilities\/","og_site_name":"ThreatsHub Cybersecurity News","article_published_time":"2023-05-25T00:00:00+00:00","og_image":[{"url":"https:\/\/www.trendmicro.com\/content\/dam\/trendmicro\/global\/en\/devops\/thumbnails\/23\/xpath-injection-vulnerabilities.jpg","type":"","width":"","height":""}],"author":"TH Author","twitter_card":"summary_large_image","twitter_creator":"@threatshub","twitter_site":"@threatshub","twitter_misc":{"Written by":"TH Author","Est. reading time":"15 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.threatshub.org\/blog\/understanding-xpath-injection-vulnerabilities\/#article","isPartOf":{"@id":"https:\/\/www.threatshub.org\/blog\/understanding-xpath-injection-vulnerabilities\/"},"author":{"name":"TH Author","@id":"https:\/\/www.threatshub.org\/blog\/#\/schema\/person\/12e0a8671ff89a863584f193e7062476"},"headline":"Understanding XPath Injection Vulnerabilities","datePublished":"2023-05-25T00:00:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.threatshub.org\/blog\/understanding-xpath-injection-vulnerabilities\/"},"wordCount":2914,"publisher":{"@id":"https:\/\/www.threatshub.org\/blog\/#organization"},"image":{"@id":"https:\/\/www.threatshub.org\/blog\/understanding-xpath-injection-vulnerabilities\/#primaryimage"},"thumbnailUrl":"https:\/\/www.threatshub.org\/blog\/coredata\/uploads\/2023\/05\/understanding-xpath-injection-vulnerabilities.jpg","keywords":["Trend Micro DevOps : Article","Trend Micro DevOps : AWS","Trend Micro DevOps : Azure","Trend Micro DevOps : Cloud Native","Trend Micro DevOps : Google Cloud Platform","Trend Micro DevOps : How To"],"articleSection":["TrendMicro"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.threatshub.org\/blog\/understanding-xpath-injection-vulnerabilities\/","url":"https:\/\/www.threatshub.org\/blog\/understanding-xpath-injection-vulnerabilities\/","name":"Understanding XPath Injection Vulnerabilities 2026 | ThreatsHub Cybersecurity News","isPartOf":{"@id":"https:\/\/www.threatshub.org\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.threatshub.org\/blog\/understanding-xpath-injection-vulnerabilities\/#primaryimage"},"image":{"@id":"https:\/\/www.threatshub.org\/blog\/understanding-xpath-injection-vulnerabilities\/#primaryimage"},"thumbnailUrl":"https:\/\/www.threatshub.org\/blog\/coredata\/uploads\/2023\/05\/understanding-xpath-injection-vulnerabilities.jpg","datePublished":"2023-05-25T00:00:00+00:00","description":"ThreatsHub Cybersecurity News | ThreatsHub.org | Cloud Security & Cyber Threats Analysis Hub. 100% Free OSINT Threat Intelligent and Cybersecurity News.","breadcrumb":{"@id":"https:\/\/www.threatshub.org\/blog\/understanding-xpath-injection-vulnerabilities\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.threatshub.org\/blog\/understanding-xpath-injection-vulnerabilities\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.threatshub.org\/blog\/understanding-xpath-injection-vulnerabilities\/#primaryimage","url":"https:\/\/www.threatshub.org\/blog\/coredata\/uploads\/2023\/05\/understanding-xpath-injection-vulnerabilities.jpg","contentUrl":"https:\/\/www.threatshub.org\/blog\/coredata\/uploads\/2023\/05\/understanding-xpath-injection-vulnerabilities.jpg","width":1282,"height":700},{"@type":"BreadcrumbList","@id":"https:\/\/www.threatshub.org\/blog\/understanding-xpath-injection-vulnerabilities\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.threatshub.org\/blog\/"},{"@type":"ListItem","position":2,"name":"Trend Micro DevOps : Article","item":"https:\/\/www.threatshub.org\/blog\/tag\/trend-micro-devops-article\/"},{"@type":"ListItem","position":3,"name":"Understanding XPath Injection Vulnerabilities"}]},{"@type":"WebSite","@id":"https:\/\/www.threatshub.org\/blog\/#website","url":"https:\/\/www.threatshub.org\/blog\/","name":"ThreatsHub Cybersecurity News","description":"%%focuskw%% Threat Intel \u2013 Threat Intel Services \u2013 CyberIntelligence \u2013 Cyber Threat Intelligence - Threat Intelligence Feeds - Threat Intelligence Reports - CyberSecurity Report \u2013 Cyber Security PDF \u2013 Cybersecurity Trends - Cloud Sandbox \u2013- Threat IntelligencePortal \u2013 Incident Response \u2013 Threat Hunting \u2013 IOC - Yara - Security Operations Center \u2013 SecurityOperation Center \u2013 Security SOC \u2013 SOC Services - Advanced Threat - Threat Detection - TargetedAttack \u2013 APT \u2013 Anti-APT \u2013 Advanced Protection \u2013 Cyber Security Services \u2013 Cybersecurity Services -Threat Intelligence Platform","publisher":{"@id":"https:\/\/www.threatshub.org\/blog\/#organization"},"alternateName":"Threatshub.org","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.threatshub.org\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.threatshub.org\/blog\/#organization","name":"ThreatsHub.org","alternateName":"Threatshub.org","url":"https:\/\/www.threatshub.org\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.threatshub.org\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.threatshub.org\/blog\/coredata\/uploads\/2025\/05\/Threatshub_Favicon1.jpg","contentUrl":"https:\/\/www.threatshub.org\/blog\/coredata\/uploads\/2025\/05\/Threatshub_Favicon1.jpg","width":432,"height":435,"caption":"ThreatsHub.org"},"image":{"@id":"https:\/\/www.threatshub.org\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/threatshub"]},{"@type":"Person","@id":"https:\/\/www.threatshub.org\/blog\/#\/schema\/person\/12e0a8671ff89a863584f193e7062476","name":"TH Author","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/066276f086d5155df79c850206a779ad368418a844da0182ce43f9cd5b506c3d?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/066276f086d5155df79c850206a779ad368418a844da0182ce43f9cd5b506c3d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/066276f086d5155df79c850206a779ad368418a844da0182ce43f9cd5b506c3d?s=96&d=mm&r=g","caption":"TH Author"}}]}},"_links":{"self":[{"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/posts\/52066","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/comments?post=52066"}],"version-history":[{"count":0,"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/posts\/52066\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/media\/52067"}],"wp:attachment":[{"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/media?parent=52066"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/categories?post=52066"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.threatshub.org\/blog\/wp-json\/wp\/v2\/tags?post=52066"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}