An adversary adds duplicate HTTP GET/POST parameters by injecting query string delimiters. Via HPP it may be possible to override existing hardcoded HTTP parameters, modify the application behaviors, access and, potentially exploit, uncontrollable variables, and bypass input validation checkpoints and WAF rules.
Description
Attack Execution Flow
Step 1
Explore[Find User Input] The adversary finds anywhere in the web application that uses user-supplied input in a form or action. This can also be found by looking at parameters in the URL in the navigation bar of the browser
[Find User Input] L'avversario individua qualsiasi punto dell'applicazione web che utilizza input forniti dall'utente in un modulo o in un'azione. Questo può essere identificato anche analizzando i parametri nell'URL nella barra di navigazione del browser
Step 2
Experiment[Add Duplicate Parameter Values] Once the adversary has identified what user input is used as HTTP parameters, they will add duplicates to each parameter one by one to observe the results. If the response from the HTTP request shows the duplicate parameter value concatenated with the original parameter value in some way, or simply just the duplicate parameter value, then HPP is possible.
In the URL, add a duplicate parameter by using the '&' delimiter. For example 'par1=val1' becomes 'par1=val1&par1=val2'. Depending on the backend API, this could be treated as 'par1=val1, val2', which could lead to par1 being set to val2, ignoring val1.
If the request is created based on user input directly on the page, the adversary will test by adding an encoded delimiter to the input. For example, the adverary might supply '1000%26action=withdraw' and the backend might interpret a POST request with the paramters 'action=deposit&amount=1000&action=withdraw'
[Add Duplicate Parameter Values] Una volta che l’attaccante ha identificato quale input utente viene utilizzato come parametri HTTP, aggiungerà duplicati a ciascun parametro uno alla volta per osservare i risultati. Se la risposta alla richiesta HTTP mostra il valore del parametro duplicato concatenato con quello originale in qualche modo, o semplicemente il valore del parametro duplicato, allora è possibile il HPP.
Nell’URL, aggiungi un parametro duplicato utilizzando il delimitatore "&". Ad esempio "par1=val1" diventa "par1=val1&par1=val2". A seconda dell’API backend, questo potrebbe essere trattato come "par1=val1, val2", il che potrebbe portare a impostare par1 su val2, ignorando val1.
Se la richiesta viene creata in base all’input utente direttamente sulla pagina, l’attaccante testerà aggiungendo un delimitatore codificato all’interno dell’input. Per esempio, l’attaccante potrebbe fornire "1000%26action=withdraw" e il backend potrebbe interpretare una richiesta POST con i parametri "action=deposit&amount=1000&action=withdraw"
Attack Techniques
-
If the request is created based on user input directly on the page, the adversary will test by adding an encoded delimiter to the input. For example, the adverary might supply "1000%26action=withdraw" and the backend might interpret a POST request with the paramters "action=deposit&amount=1000&action=withdraw"
-
In the URL, add a duplicate parameter by using the "&" delimiter. For example "par1=val1" becomes "par1=val1&par1=val2". Depending on the backend API, this could be treated as "par1=val1, val2", which could lead to par1 being set to val2, ignoring val1.IT: Se la richiesta viene creata in base all'input dell'utente direttamente sulla pagina, l'attaccante testerà aggiungendo un delimitatore codificato all'interno dell'input. Ad esempio, l'attaccante potrebbe fornire "1000%26action=withdraw" e il backend potrebbe interpretare una richiesta POST con i parametri "action=deposit&amount=1000&action=withdraw"
Step 3
Exploit[Leverage HPP] Once the adversary has identified how the backend handles duplicate parameters, they will leverage this by polluting the paramters in a way that benefits them. In some cases, hardcoded parameters will be disregarded by the backend. In others, the adversary can bypass a WAF that might only check a parameter before it has been concatenated by the backend, resulting in malicious queries getting through.
[Leverage HPP] Una volta che l'attore malevolo ha identificato come il backend gestisce i parametri duplicati, sfrutterà questa vulnerabilità inquinando i parametri in modo da trarne vantaggio. In alcuni casi, i parametri hardcoded verranno ignorati dal backend. In altri, l'attaccante può bypassare un WAF che potrebbe controllare solo un parametro prima che venga concatenato dal backend, consentendo così il passaggio di query dannose.
Mitigations
Configuration: If Using A Web Application Firewall (Waf), Filters Should Be Carefully Configured To Detect Abnormal Http Requests
Design: Perform Url Encoding
Implementation: Beware Of Multiple Occurrences Of A Parameter In A Query String
Implementation: Use Strict Regular Expressions In Url Rewriting
Consequences
Consequence Information
{'impacts': [], 'impacts_translate': [], 'scopes': [], 'scopes_translate': []}