An attacker can craft special user-controllable input consisting of XPath expressions to inject the XML database and bypass authentication or glean information that they normally would not be able to. XPath Injection enables an attacker to talk directly to the XML database, thus bypassing the application completely. XPath Injection results from the failure of an application to properly sanitize input used as part of dynamic XPath expressions used to query an XML database.
Description
Attack Execution Flow
Step 1
Explore[Survey the target] Using a browser or an automated tool, an adversary records all instances of user-controllable input used to contruct XPath queries.
Use an automated tool to record all instances of user-controllable input used to contruct XPath queries.
Use a browser to manually explore the website and analyze how the application processes inputs.
[Indaga sul target] Utilizzando un browser o uno strumento automatizzato, un adversary registra tutte le istanze di input controllabili dall'utente utilizzati per costruire query XPath.
Utilizza uno strumento automatizzato per registrare tutte le istanze di input controllabili dall'utente utilizzati per costruire query XPath.
Utilizza un browser per esplorare manualmente il sito web e analizzare come l'applicazione elabora gli input.
Attack Techniques
-
Use an automated tool to record all instances of user-controllable input used to contruct XPath queries.
-
Use a browser to manually explore the website and analyze how the application processes inputs.IT: Utilizza uno strumento automatizzato per registrare tutte le istanze di input controllabile dall'utente utilizzate per costruire query XPath.
Step 2
Explore[Determine the tructure of queries] Using manual or automated means, test inputs found for XPath weaknesses.
Use an automated tool automatically probe the inputs for XPath weaknesses.
Manually probe the inputs using characters such as single quote (') that can cause XPath-releated errors, thus indicating an XPath weakness.
[Determina la struttura delle query] Utilizza metodi manuali o automatizzati per testare gli input trovati alla ricerca di vulnerabilità XPath.
Utilizza uno strumento automatizzato per sondare automaticamente gli input alla ricerca di vulnerabilità XPath.
Sonda manualmente gli input usando caratteri come l'apostrofo (') che possono causare errori correlati a XPath, indicando così una vulnerabilità XPath.
Attack Techniques
-
Use an automated tool automatically probe the inputs for XPath weaknesses.
-
Manually probe the inputs using characters such as single quote (') that can cause XPath-releated errors, thus indicating an XPath weakness.IT: Utilizza uno strumento automatizzato per sondare automaticamente gli input alla ricerca di vulnerabilità XPath.
Step 3
Exploit[Inject content into XPath query] Craft malicious content containing XPath expressions that is not validated by the application and is executed as part of the XPath queries.
Use the crafted input to execute unexpected queries that can disclose sensitive database information to the attacker.
Use a combination of single quote (') and boolean expressions such as 'or 1=1' to manipulate XPath logic.
Use XPath functions in the malicious content such as 'string-length', 'substring', or 'count' to gain information about the XML document structure being used.
[Iniettare contenuto nella query XPath] Creare contenuto dannoso contenente espressioni XPath che non vengono convalidate dall'applicazione e vengono eseguite come parte delle query XPath.
Utilizzare l'input manipolato per eseguire query inaspettate che possono divulgare informazioni sensibili del database all'attaccante.
Usare una combinazione di apice singolo (') ed espressioni booleane come "or 1=1" per manipolare la logica XPath.
Utilizzare funzioni XPath nel contenuto dannoso come "string-length", "substring" o "count" per ottenere informazioni sulla struttura del documento XML in uso.
Attack Techniques
-
Use the crafted input to execute unexpected queries that can disclose sensitive database information to the attacker.
-
Use a combination of single quote (') and boolean expressions such as "or 1=1" to manipulate XPath logic.IT: Utilizza l'input manipolato per eseguire query inaspettate che possano divulgare informazioni sensibili del database all'attaccante.
-
Use XPath functions in the malicious content such as "string-length", "substring", or "count" to gain information about the XML document structure being used.IT: Utilizza l'input manipolato per eseguire query inaspettate che possano divulgare informazioni sensibili del database all'attaccante.