SlideShare a Scribd company logo
HTTP Parameter Pollution
Vulnerabilities in Web Applications

                 Marco `embyte’ Balduzzi
                   (C. Torrano, D.Balzarotti, E. Kirda)




Do you have the last version of this presentation?
http://www.iseclab.org/people/embyte/slides/BHEU2011/hpp-bhEU2011.pdf
Overview
•  Introduction
•  HTTP Parameter Pollution
•  Detection Approach
•  Tool
•  Experiments
•  Results
•  Demo
•  Conclusions
Who am I?
•    From Bergamo (IT) to the French
     Riviera
•    MSc in Computer Engineering
•    PhD student at EURECOM
•    8+ years experience in IT Security
•    Engineer and consultant for different
     international firms
•    Co-founder of BGLug, Applied Uni
     Lab, (ex) SPINE Group, Nast, etc…


•    http://www.iseclab.org/people/embyte
The Web as We Know It

•  Has evolved from being a collection of simple
  and static pages to fully dynamic applications
•  Applications are more complex than they
  used to be
•  Multi-tier architecture is the normal
•  Many complex systems have web interfaces
The Web before
Now
Increased Importance of Web Security

•  As a consequence:
   –  Web security has increased in importance
   –  OWASP, the Top Ten Project
   –  Attack against web apps constitute 60% of attacks on
     the Internet (SANS’s The Top Cyber Security Risks)
   –  Application   being   targeted   for   hosting   drive-by-
     download content or C&C servers
   –  Malware targeting browsers (e.g. key and network
     loggers)
Increased Importance of Web Security

•  A lot of work done to detect injection type flaws:
   –  SQL Injection
   –  Cross Site Scripting
   –  Command Injection
•  Injection vulnerabilities have been well-studied, and tools
  exist
   –  Sanitization routines in languages (e.g., PHP)
   –  Static code analysis (e.g., Pixy, OWASP Orizon)
   –  Dynamic techniques (e.g., Huang et al.)
   –  Web Application Firewalls (WAF)
HTTP Parameter Pollution
•  A new class of Injection Vulnerability called HTTP Parameter
   Pollution (HPP) is less known
    –  Has not received much attention
    –  First presented by S. di Paola and L. Carettoni at OWASP 2009

•  Attack consists of injecting encoded query string delimiters into
   existing HTTP parameters (e.g. GET/POST/Cookie)
    –  If application does not sanitize its inputs, HPP can be used to
      launch client-side or server-side attacks
    –  Attacker may be able to override existing parameter values, inject a
      new parameter or exploit variables out of a direct reach
Research Objectives
•  To create the first automated approach for detecting HPP
  flaws
   –  Blackbox approach, consists of a set of tests and heuristics
•  To find out how prevalent HPP problems were on the web
   –  Is the problem being exaggerated?
   –  Is this problem known by developers?
   –  Does this problem occur more in smaller sites than larger
     sites?
   –  What is the significance of the problem?
HTTP Parameter Handling
•  During interaction with web application, client provides
  parameters via GET/POST/Cookie
   –  http://www.site.com/login?login=alice
•  HTTP allows the same parameter to be provided twice
   –  E.g., in a form checkbox
     http://www.w3schools.com/html/tryit.asp?filename=tryhtml_form_checkbox

•  What happens when the same parameter is provided
  twice?
   –  http://www.site.com/login?login=alice&login=bob
Google example
Yahoo example
HTTP Parameter Handling
•  We manually tested common methods of 5 different
  languages
   Technology/Server               Tested Method Parameter Precedence
   ASP/IIS              Request.QueryString(“par”)    All (comma-delimited string)
   PHP/Apache                        $_GET(“par”)     Last
   JSP/Tomcat          Request.getParameter(“par”)    First
   Perl(CGI)/Apache                  Param(“par”)     First
   Python/Apache                    getvalue(“par”)   All (List)


•  There is nothing bad with it, if the developer is aware of
  this behavior
•  Languages provide secure functions (python’s getfirst())
HTTP Parameter Pollution
•  An HTTP Parameter Pollution (HPP)
  attack occurs
  –  When a malicious parameter Pinj, preceded by
    an encoded query string delimiter (e.g.     %26),   is
    injected into an existing parameter Phost

•  Typical scenario (client-side)
  –  Web application for election for two candidates
HTTP Parameter Pollution
 Url   : http://host/election.jsp?poll_id=4568

 Link1: <a href="vote.jsp?poll_id=4568&candidate=white”>
        Vote for Mr.White </a>
 Link2: <a href="vote.jsp?poll_id=4568&candidate=green”>
        Vote for Mrs.Green </a>


•  The two links are built from the URL
 ID = Request.getParameter(“pool_id”)
 href_link = “vote.jsp?poll_id=” + ID + ”&candidate=xyz”


•  No sanitization
HTTP Parameter Pollution
•  poll_id is vulnerable and Attacker creates URL:
   http://host/election.jsp?poll_id=4568%26candidate%3Dgreen

•  The resulting page now contains injected links:
 <a href=vote.jsp?pool_id=4568&candidate=green&candidate=white>
    Vote for Mr. White </a>
 <a href=vote.jsp?pool_id=4568&candidate=green&candidate=green>
    Vote for Mrs. Green </a>

•  If the developer expects to receive a single value
   –  Jsp’s Request.getParameter(“candidate”)returns the 1st value
   –  The parameter precedence is consistent…
•  Candidate Mrs. Green is always voted!
Consequence

•  Override existing (hardcoded) values
•  Inject a new parameter
•  Exploit a parameter out of a direct reach
•  Client-side (user) or server-side (web-
  application) attack
Parameter Pollution – More uses
•  Cross-channel pollution
   –  HPP attacks can also be used to override parameters
     between different input channels (GET/POST/Cookie)
   –  Good security practice: accept parameters only from where
     they are supposed to be supplied
•  HPP to bypass CSRF tokens
   –  E.g. Yahoo Mail client-side attack (di Paola & Carrettoni)
Bonus
      •  By concatenating the same parameter multiple time
      •  Bypass WAFs input validation checks
          –  Exploit    ASP     concatenation      behavior     and       inline
             comments
          –  Concatenate the attack payload after the WAF filtering

Standard: show_user.aspx?id=5;select+1,2,3+from+users+where+id=1–
Over HPP: show_user.aspx?id=5;select+1&id=2&id=3+from+users+where+id=1—

Standard: show_user.aspx?id=5+union+select+*+from+users—
Over HPP: show_user.aspx?id=5/*&id=*/union/*&id=*/select+*/*&id=*/from+users--
System for HPP Detection
•  Four main components: browser, crawler, two scanners
Main Components
  Instrumented browser fetches the web pages and renders their
    content
    –  Full support for client-side scripts (e.g. Javascript) and external
      resources (e.g. <embed>)
    –  Extracts all links and forms
     Crawler communicates with browser, determines URLs to visit
     and forms to submit. Passes the information to two scanners
     P-Scan: Determines page behavior when two parameters with
    the same name are injected
  V-Scan: Tests and attempts to verify that site is vulnerable to
    HPP
P-Scan: Analysis of the Parameter Precedence

–  Analyzes a page to determine the precedence of
 parameters, when multiple occurrences of the same
 parameter are submitted
–  Take parameter par1=val1, generate a similar value
 par1=new_val
   •  Page0 (original): app.php?par1=val1
   •  Page1 (test 1)   : app.php?par1=new_val
   •  Page2 (test 2)   : app.php?par1=val1&par1=new_val

–  How do we determine precedence? Naïve approach:
   •  Page0==Page2 -> precedence on first parameter
   •  Page1==Page2 -> precedence on second parameter
P-Scan: Problem with the naïve approach
•  In practice, naïve technique does not work well
   –  Applications are complex, much dynamic content
     (publicity banners, RSS feeds, ads, etc.)


   –  Hence, we perform pre-filtering to eliminate dynamic
     components (embedded content, applets, iframes,
     stylesheets, etc.)
   –  Remove all self-referencing URLs (as these change
     when parameters are inserted)
   –  We then perform different tests to determine similarity
P-Scan: Tests
•  Error test
   –  The application crashes, or return an “internal” error, when
      an identical parameter is injected multiple times
   –  Regexps from the sqlmap project
•  Identity test
   –  Is the tested parameter considered by the application
       •  Page0=Page1=Page2

•  Base test
   –  Test assumes that the pre-filtering works perfectly (seldom
      the case)
P-Scan: Tests
•  Join test
   –  Are the two values are somehow combined
     together (e.g. ASP)?
•  Fuzzy test
   –  It is designed to cope with pages whose dynamic
     components have not been perfectly sanitized
   –  Based on the Gestalt   Pattern Matching   algorithm
   –  Compute the similarity among the pages
V-Scan: Testing for HPP vulnerabilities

•  For every page, an innocuous URL-encoded parameter
  (nonce) is injected
   –  E.g., “%26foo%3Dbar”
   –  Then check if the “&foo=bar” string is included inside the
      URLs of links or forms in the answer page


•  V-Scan starts by extracting the list PURL=[PU1,PU2,…PUn] of
  the parameters that are present in the page URL, and the
  list Pbody=[PB1,PB2,…PUm] of the parameters that are
  present in links or forms contained in the page body
Where to inject the nonce

•  PA   =   PURL    ∩    PBody   : set of parameters that appear
   unmodified in the URL and in the page content (links,
   forms)
•  PB = p | p           PURL     p /   PBody   : URL parameters that do
   not appear in the page. Some of these parameters may
   appear in the page under a different name
•  PC = p | p /           PURL    p     PBody :   set of parameters that
   appear somewhere in the page, but that are not present in
   the URL
V-Scan: Special Cases
•  E.g., one of the URL parameters (or part of it) is used as the
   entire target of a link



•  Self-referencing links



•  Similar issues with printing, sharing functionalities
•  To reduce false positives, we use heuristics
    –  E.g., the injected parameter does not start with http://
    –  Injection without URL-encoding
Implementation – The PAPAS tool
•  PAPAS: Parameter Pollution Analysis System
•  The components communicate via TCP/IP sockets
   –  Crawler and Scanner are in Python
   –  The browser component has been implemented as a
     Firefox extension
   –  Advantage: We can see exactly how pages are
     rendered (cope with client-side scripts)
   –  Support for multiple sessions (parallelization)
Implementation – The PAPAS tool

•  PAPAS is fully customizable
  –  E.g., scanning depth, number of performed
    injections, page loading timeouts, etc.

•  Three modes are supported
  –  Fast mode, extensive mode, assisted mode
  –  In assisted mode, authenticated areas of a site
    can be scanned as well
Possible improvements
•  PAPAS does not support the crawling of links embedded
  in active content
   –  E.g., flash
•  Support additional encoding schemas (UTF-8, Double
  URL)
•  PAPAS currently only focuses on client-side exploits
  where user needs to click on a link
   –  HPP is also possible on the server side – but this is more
     difficult to detect
   –  Analogous to detecting stored XSS
Ethical Considerations
•  Only client-side attacks. The server-side have
  the potential to cause harm
•  We provided the applications with innocuous
  parameters (&foo=bar). No malicious code.
•  Limited scan time (15min) and activity
•  We immediately informed, when possible, the
  security engineers of the affected applications
   –  Thankful feedbacks
Two set of experiments
  We used PAPAS to scan a set of popular
 websites
–  About 5,000 sites collected by the first 500 of
  Alexa’s main categories
–  The aim: To quickly scan as many websites as
  possible and to see how common HPP flaws are
  We then analyzed some of the sites we
identified to be HPP-vulnerable in more detail
The 5,016 tested sites
 Categories     # of Tested         Categories     # of Tested
               Applications                       Applications
   Financial           110            Shopping            460
     Games             300    Social Networking           117
Government             132              Sports            256
     Health            235               Travel           175
    Internet           698           University            91
      News             599               Video            114
Organization           106              Others          1,401
    Science            222
Efficient assessment
•  In 13 days, we tested 5,016 sites and more than 149,000
  unique pages
•  To maximize the speed, the scanner
   –  Crawled pages up to a distance of 3 from the homepage
   –  Considered links with at least one parameter (except for the
     homepage)
   –  Considered at max 5 instances for page (same page,
     different query string)
   –  We disabled pop-ups, images, plug-ins for active content
     technologies
Evaluation – Parameter Precedence

•  Database Errors
  –  Web developers does not seem conscious of the
    possibility to duplicate GET/POST parameters
Evaluation – Parameter Precedence
•  Parameter Inconsistency
   –  Sites developed using a combination of heterogeneous
     technologies (e.g. PHP and Perl)
   –  This is perfectly safe if the developer is aware of the
     HPP threat… this is not always the case
Evaluation – HPP Vulnerabilities
•  PAPAS       discovered   that   about   1,500   (30%)
  websites contained at least one page vulnerable to
  HTTP Parameter Injection
   –  The tool was able to inject (and verify) an encoded
     parameter
•  Vulnerable != Exploitable
   –  Is the parameter precedence consistent?
   –  Can a possible attacker override existing parameter
     values?
Vulnerable or exploitable?
•  Injection on link:
   –  Parameter in the middle -> always overriding
   –  Parameter at the begin/end -> automated check
     via P-Scan
•  Injection on form:
   –  The injected value is automatically encoded by the
     browser
   –  Still, someone may be able to run a two-step
     attack (client-side) or a server-side attack
Vulnerable or exploitable?
•  702 applications are exploitable
  –  About 14%
  –  The injected parameter either overrides the
    value of an existing one or is accepted as
    “new parameter”
     •  E.g. A new action is injected
    Url: pool.pl?par1=val1%26action%3Dreset
    Link: target.pl?x=y&w=z&par1=val1&action=reset
Evaluation




•  More sensitive sites are equally (or
 even more) affected by the problem
False Positives
•  10 applications (1.12%) use the injected
 parameter as entire target for one link
•  Variation of the special case we saw in
 slide 18 (V-Scan: special cases)
  –  The application applied a transformation to the
    parameter before using it as a link’s URL
Some Case Studies
•  We investigated some of the websites in more detail
   –  Among   our   “victims”:   Facebook,   Google,   Symantec,
     Microsoft, PayPal, Flickr, FOX Video, VMWare, …
   –  We notified security officers and some of the problems were
     fixed
   –  Facebook: share component
   –  Several shopping cart applications could be manipulated to
     change the price of an item
   –  Some banks were vulnerable and we could play around with
     parameters
   –  Google: search engine results could be manipulated
HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)
Homepage injection WHO
HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)
Nasa.gov: coldfusion SQL Error
Misleading shopping users
Your (secured) home banking
And Google 
PAPAS Online Service
•  5K websites tested
   –  30% sites are vulnerable: injectable parameters
   –  14% exploitable: possible to override or introduce arbitrary
     parameters/values
•  What about mine?


•  PAPAS @ http://papas.iseclab.org
•  Free-to-use service
•  Ownership token verification
•  Configurable
PAPAS Online Service



       DEMO
HPP Prevention
•  Input validation
   –  Encoded query string delimiters
•  Use safe methods
   –  Parameter precedence (ref. slide 14)
   –  Channel (GET/POST/Cookie) validation (ref. slide 19)
•  Raise awareness
   –  The client can provide the same parameter twice (or
     more)
Acknowledgments, References
•  Co-joint work:
   –  M. Balduzzi, C. Torrano Gimenez, D. Balzarotti,
     and E. Kirda. Automated discovery of parameter
     pollution vulnerabilities in web applications. In
     NDSS’11, San Diego, CA.
•  http://papas.iseclab.org/cgi-bin/resources.py
•  Black Hat’s White Paper
Conclusion
  Presented the first technique and system to detect
 HPP vulnerabilities in web applications.
  •    We call it PAPAS, http://papas.iseclab.org
  Conducted a large-scale study of the Internet
  •    About 5,000 web sites
  Our results suggest that Parameter Pollution is a
 largely unknown, and wide-spread problem
We hope our work will help raise awareness about
                               HPP!
Questions?




             embyte@iseclab.org

More Related Content

PPTX
Attacking thru HTTP Host header
PDF
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
PDF
Building Advanced XSS Vectors
PDF
Hacking Adobe Experience Manager sites
PDF
Neat tricks to bypass CSRF-protection
PDF
Frans Rosén Keynote at BSides Ahmedabad
PPTX
A8 cross site request forgery (csrf) it 6873 presentation
PDF
How to steal and modify data using Business Logic flaws - Insecure Direct Obj...
Attacking thru HTTP Host header
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
Building Advanced XSS Vectors
Hacking Adobe Experience Manager sites
Neat tricks to bypass CSRF-protection
Frans Rosén Keynote at BSides Ahmedabad
A8 cross site request forgery (csrf) it 6873 presentation
How to steal and modify data using Business Logic flaws - Insecure Direct Obj...

What's hot (20)

PDF
Time based CAPTCHA protected SQL injection through SOAP-webservice
PPTX
Host Header injection - Slides
PPTX
Going Beyond Microsoft IIS Short File Name Disclosure - NahamCon 2023 Edition
PDF
OWASP API Security Top 10 - API World
PDF
AEM hacker - approaching Adobe Experience Manager webapps in bug bounty programs
PDF
Pentesting Rest API's by :- Gaurang Bhatnagar
PDF
HTTP Security Headers
PPTX
File upload vulnerabilities & mitigation
PDF
A story of the passive aggressive sysadmin of AEM
PDF
Hunting for security bugs in AEM webapps
PPTX
Rest API Security - A quick understanding of Rest API Security
PDF
PHP unserialization vulnerabilities: What are we missing?
PPTX
OWASP A4 XML External Entities (XXE)
PPTX
SSRF For Bug Bounties
PPTX
XSS - Do you know EVERYTHING?
PPTX
Cross site scripting
PPTX
Json Web Token - JWT
PDF
Polyglot payloads in practice by avlidienbrunn at HackPra
PDF
Cross site scripting
PDF
Secure Code Review 101
Time based CAPTCHA protected SQL injection through SOAP-webservice
Host Header injection - Slides
Going Beyond Microsoft IIS Short File Name Disclosure - NahamCon 2023 Edition
OWASP API Security Top 10 - API World
AEM hacker - approaching Adobe Experience Manager webapps in bug bounty programs
Pentesting Rest API's by :- Gaurang Bhatnagar
HTTP Security Headers
File upload vulnerabilities & mitigation
A story of the passive aggressive sysadmin of AEM
Hunting for security bugs in AEM webapps
Rest API Security - A quick understanding of Rest API Security
PHP unserialization vulnerabilities: What are we missing?
OWASP A4 XML External Entities (XXE)
SSRF For Bug Bounties
XSS - Do you know EVERYTHING?
Cross site scripting
Json Web Token - JWT
Polyglot payloads in practice by avlidienbrunn at HackPra
Cross site scripting
Secure Code Review 101
Ad

Viewers also liked (20)

PDF
Http Parameter Pollution, a new category of web attacks
PPTX
Backup-File Artifacts - OWASP Khartoum InfoSec Sessions 2016 - Mazin Ahmed
PPTX
Cctk support for setting hdd password
PPT
Softworx Enterprise Asset Management 101 - Presentation Template
PDF
Abusing Social Networks for Automated User Profiling
ODP
Personal informatic
PPTX
A New Form of Dos attack in Cloud
PPS
Pentru tine
PDF
HTTP(S)-Based Clustering for Assisted Cybercrime Investigations
PPT
Christmas
PPTX
Cloud computing security policy framework for mitigating denial of service at...
PDF
Cybercrime in the Deep Web (BHEU 2015)
PDF
HITB2012AMS - SatanCloud: A Journey Into the Privacy and Security Risks of Cl...
PPTX
чынгыз айтматов Small
PPT
Family tree
PPTX
600.412.Lecture02
PPTX
ОО" Шоола Кол" презентация Результаты поиска Санкт-Петербург 14 октября
PPTX
Presentation1
PPT
Possessive adjectives
PPTX
TUGAS PTI MOTHERBOARD DAN MODEM
Http Parameter Pollution, a new category of web attacks
Backup-File Artifacts - OWASP Khartoum InfoSec Sessions 2016 - Mazin Ahmed
Cctk support for setting hdd password
Softworx Enterprise Asset Management 101 - Presentation Template
Abusing Social Networks for Automated User Profiling
Personal informatic
A New Form of Dos attack in Cloud
Pentru tine
HTTP(S)-Based Clustering for Assisted Cybercrime Investigations
Christmas
Cloud computing security policy framework for mitigating denial of service at...
Cybercrime in the Deep Web (BHEU 2015)
HITB2012AMS - SatanCloud: A Journey Into the Privacy and Security Risks of Cl...
чынгыз айтматов Small
Family tree
600.412.Lecture02
ОО" Шоола Кол" презентация Результаты поиска Санкт-Петербург 14 октября
Presentation1
Possessive adjectives
TUGAS PTI MOTHERBOARD DAN MODEM
Ad

Similar to HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011) (20)

PPTX
Automated Detection of HPP Vulnerabilities in Web Applications Version 0.3, B...
PDF
HTTP Parameter Pollution (HPP) - SEaCURE.it edition
PDF
AppSec EU 2009 - HTTP Parameter Pollution by Luca Carettoni and Stefano di P...
PPT
Positive Hack Days. Goltsev. Web Vulnerabilities: Difficult Cases
PDF
Top Ten Web Hacking Techniques (2010)
PDF
Reliable and fast security audits - The modern and offensive way-Mohan Gandhi
PPT
Pentesting web applications
PDF
Beyond OWASP Top 10 - TASK October 2017
PDF
44641917 091011
PDF
Ch 10: Attacking Back-End Components
PDF
Ch 13: Attacking Other Users: Other Techniques (Part 1)
PPT
Intro to Web Application Security
PDF
CNIT 129S: Ch 3: Web Application Technologies
PPTX
Infosec girls training-hackcummins-college-jan-2020(v0.1)
PPT
Web application security
PPT
Web application security
PDF
20111204 web security_livshits_lecture01
PDF
CNIT 129S - Ch 3: Web Application Technologies
PDF
CNIT 129S: Ch 4: Mapping the Application
PPTX
6 - Web Application Security.pptx
Automated Detection of HPP Vulnerabilities in Web Applications Version 0.3, B...
HTTP Parameter Pollution (HPP) - SEaCURE.it edition
AppSec EU 2009 - HTTP Parameter Pollution by Luca Carettoni and Stefano di P...
Positive Hack Days. Goltsev. Web Vulnerabilities: Difficult Cases
Top Ten Web Hacking Techniques (2010)
Reliable and fast security audits - The modern and offensive way-Mohan Gandhi
Pentesting web applications
Beyond OWASP Top 10 - TASK October 2017
44641917 091011
Ch 10: Attacking Back-End Components
Ch 13: Attacking Other Users: Other Techniques (Part 1)
Intro to Web Application Security
CNIT 129S: Ch 3: Web Application Technologies
Infosec girls training-hackcummins-college-jan-2020(v0.1)
Web application security
Web application security
20111204 web security_livshits_lecture01
CNIT 129S - Ch 3: Web Application Technologies
CNIT 129S: Ch 4: Mapping the Application
6 - Web Application Security.pptx

More from Marco Balduzzi (14)

PDF
Lost in Translation: When Industrial Protocol Translation goes Wrong [CONFide...
PDF
CTS @ HWIO2020 Awards Cerimony
PPTX
SCSD 2020 - Security Risk Assessment of Radio-Enabled Technologies
PDF
Attacking Industrial Remote Controllers (HITB AMS 2019)
PDF
Using Machine-Learning to Investigate Web Campaigns at Large - HITB 2018
PDF
Behind the scene of malware operators. Insights and countermeasures. CONFiden...
PDF
Plead APT @ EECTF 2016
PDF
Detection of Malware Downloads via Graph Mining (AsiaCCS '16)
PDF
AIS Exposed. New vulnerabilities and attacks. (HITB AMS 2014)
PPTX
Attacking the Privacy of Social Network users (HITB 2011)
PDF
The (in)security of File Hosting Services
PDF
Stealthy, Resilient and Cost-Effective Botnet Using Skype
PDF
New Insights into Clickjacking
PDF
Paper: A Solution for the Automated Detection of Clickjacking Attacks
Lost in Translation: When Industrial Protocol Translation goes Wrong [CONFide...
CTS @ HWIO2020 Awards Cerimony
SCSD 2020 - Security Risk Assessment of Radio-Enabled Technologies
Attacking Industrial Remote Controllers (HITB AMS 2019)
Using Machine-Learning to Investigate Web Campaigns at Large - HITB 2018
Behind the scene of malware operators. Insights and countermeasures. CONFiden...
Plead APT @ EECTF 2016
Detection of Malware Downloads via Graph Mining (AsiaCCS '16)
AIS Exposed. New vulnerabilities and attacks. (HITB AMS 2014)
Attacking the Privacy of Social Network users (HITB 2011)
The (in)security of File Hosting Services
Stealthy, Resilient and Cost-Effective Botnet Using Skype
New Insights into Clickjacking
Paper: A Solution for the Automated Detection of Clickjacking Attacks

Recently uploaded (20)

PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Spectroscopy.pptx food analysis technology
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Getting Started with Data Integration: FME Form 101
PPTX
Machine Learning_overview_presentation.pptx
SOPHOS-XG Firewall Administrator PPT.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
NewMind AI Weekly Chronicles - August'25-Week II
Unlocking AI with Model Context Protocol (MCP)
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Dropbox Q2 2025 Financial Results & Investor Presentation
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Machine learning based COVID-19 study performance prediction
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Encapsulation_ Review paper, used for researhc scholars
Network Security Unit 5.pdf for BCA BBA.
MYSQL Presentation for SQL database connectivity
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Per capita expenditure prediction using model stacking based on satellite ima...
MIND Revenue Release Quarter 2 2025 Press Release
Spectroscopy.pptx food analysis technology
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Getting Started with Data Integration: FME Form 101
Machine Learning_overview_presentation.pptx

HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)

  • 1. HTTP Parameter Pollution Vulnerabilities in Web Applications Marco `embyte’ Balduzzi (C. Torrano, D.Balzarotti, E. Kirda) Do you have the last version of this presentation? http://www.iseclab.org/people/embyte/slides/BHEU2011/hpp-bhEU2011.pdf
  • 2. Overview •  Introduction •  HTTP Parameter Pollution •  Detection Approach •  Tool •  Experiments •  Results •  Demo •  Conclusions
  • 3. Who am I? •  From Bergamo (IT) to the French Riviera •  MSc in Computer Engineering •  PhD student at EURECOM •  8+ years experience in IT Security •  Engineer and consultant for different international firms •  Co-founder of BGLug, Applied Uni Lab, (ex) SPINE Group, Nast, etc… •  http://www.iseclab.org/people/embyte
  • 4. The Web as We Know It •  Has evolved from being a collection of simple and static pages to fully dynamic applications •  Applications are more complex than they used to be •  Multi-tier architecture is the normal •  Many complex systems have web interfaces
  • 6. Now
  • 7. Increased Importance of Web Security •  As a consequence: –  Web security has increased in importance –  OWASP, the Top Ten Project –  Attack against web apps constitute 60% of attacks on the Internet (SANS’s The Top Cyber Security Risks) –  Application being targeted for hosting drive-by- download content or C&C servers –  Malware targeting browsers (e.g. key and network loggers)
  • 8. Increased Importance of Web Security •  A lot of work done to detect injection type flaws: –  SQL Injection –  Cross Site Scripting –  Command Injection •  Injection vulnerabilities have been well-studied, and tools exist –  Sanitization routines in languages (e.g., PHP) –  Static code analysis (e.g., Pixy, OWASP Orizon) –  Dynamic techniques (e.g., Huang et al.) –  Web Application Firewalls (WAF)
  • 9. HTTP Parameter Pollution •  A new class of Injection Vulnerability called HTTP Parameter Pollution (HPP) is less known –  Has not received much attention –  First presented by S. di Paola and L. Carettoni at OWASP 2009 •  Attack consists of injecting encoded query string delimiters into existing HTTP parameters (e.g. GET/POST/Cookie) –  If application does not sanitize its inputs, HPP can be used to launch client-side or server-side attacks –  Attacker may be able to override existing parameter values, inject a new parameter or exploit variables out of a direct reach
  • 10. Research Objectives •  To create the first automated approach for detecting HPP flaws –  Blackbox approach, consists of a set of tests and heuristics •  To find out how prevalent HPP problems were on the web –  Is the problem being exaggerated? –  Is this problem known by developers? –  Does this problem occur more in smaller sites than larger sites? –  What is the significance of the problem?
  • 11. HTTP Parameter Handling •  During interaction with web application, client provides parameters via GET/POST/Cookie –  http://www.site.com/login?login=alice •  HTTP allows the same parameter to be provided twice –  E.g., in a form checkbox http://www.w3schools.com/html/tryit.asp?filename=tryhtml_form_checkbox •  What happens when the same parameter is provided twice? –  http://www.site.com/login?login=alice&login=bob
  • 14. HTTP Parameter Handling •  We manually tested common methods of 5 different languages Technology/Server Tested Method Parameter Precedence ASP/IIS Request.QueryString(“par”) All (comma-delimited string) PHP/Apache $_GET(“par”) Last JSP/Tomcat Request.getParameter(“par”) First Perl(CGI)/Apache Param(“par”) First Python/Apache getvalue(“par”) All (List) •  There is nothing bad with it, if the developer is aware of this behavior •  Languages provide secure functions (python’s getfirst())
  • 15. HTTP Parameter Pollution •  An HTTP Parameter Pollution (HPP) attack occurs –  When a malicious parameter Pinj, preceded by an encoded query string delimiter (e.g. %26), is injected into an existing parameter Phost •  Typical scenario (client-side) –  Web application for election for two candidates
  • 16. HTTP Parameter Pollution Url : http://host/election.jsp?poll_id=4568 Link1: <a href="vote.jsp?poll_id=4568&candidate=white”> Vote for Mr.White </a> Link2: <a href="vote.jsp?poll_id=4568&candidate=green”> Vote for Mrs.Green </a> •  The two links are built from the URL ID = Request.getParameter(“pool_id”) href_link = “vote.jsp?poll_id=” + ID + ”&candidate=xyz” •  No sanitization
  • 17. HTTP Parameter Pollution •  poll_id is vulnerable and Attacker creates URL: http://host/election.jsp?poll_id=4568%26candidate%3Dgreen •  The resulting page now contains injected links: <a href=vote.jsp?pool_id=4568&candidate=green&candidate=white> Vote for Mr. White </a> <a href=vote.jsp?pool_id=4568&candidate=green&candidate=green> Vote for Mrs. Green </a> •  If the developer expects to receive a single value –  Jsp’s Request.getParameter(“candidate”)returns the 1st value –  The parameter precedence is consistent… •  Candidate Mrs. Green is always voted!
  • 18. Consequence •  Override existing (hardcoded) values •  Inject a new parameter •  Exploit a parameter out of a direct reach •  Client-side (user) or server-side (web- application) attack
  • 19. Parameter Pollution – More uses •  Cross-channel pollution –  HPP attacks can also be used to override parameters between different input channels (GET/POST/Cookie) –  Good security practice: accept parameters only from where they are supposed to be supplied •  HPP to bypass CSRF tokens –  E.g. Yahoo Mail client-side attack (di Paola & Carrettoni)
  • 20. Bonus •  By concatenating the same parameter multiple time •  Bypass WAFs input validation checks –  Exploit ASP concatenation behavior and inline comments –  Concatenate the attack payload after the WAF filtering Standard: show_user.aspx?id=5;select+1,2,3+from+users+where+id=1– Over HPP: show_user.aspx?id=5;select+1&id=2&id=3+from+users+where+id=1— Standard: show_user.aspx?id=5+union+select+*+from+users— Over HPP: show_user.aspx?id=5/*&id=*/union/*&id=*/select+*/*&id=*/from+users--
  • 21. System for HPP Detection •  Four main components: browser, crawler, two scanners
  • 22. Main Components   Instrumented browser fetches the web pages and renders their content –  Full support for client-side scripts (e.g. Javascript) and external resources (e.g. <embed>) –  Extracts all links and forms   Crawler communicates with browser, determines URLs to visit and forms to submit. Passes the information to two scanners   P-Scan: Determines page behavior when two parameters with the same name are injected   V-Scan: Tests and attempts to verify that site is vulnerable to HPP
  • 23. P-Scan: Analysis of the Parameter Precedence –  Analyzes a page to determine the precedence of parameters, when multiple occurrences of the same parameter are submitted –  Take parameter par1=val1, generate a similar value par1=new_val •  Page0 (original): app.php?par1=val1 •  Page1 (test 1) : app.php?par1=new_val •  Page2 (test 2) : app.php?par1=val1&par1=new_val –  How do we determine precedence? Naïve approach: •  Page0==Page2 -> precedence on first parameter •  Page1==Page2 -> precedence on second parameter
  • 24. P-Scan: Problem with the naïve approach •  In practice, naïve technique does not work well –  Applications are complex, much dynamic content (publicity banners, RSS feeds, ads, etc.) –  Hence, we perform pre-filtering to eliminate dynamic components (embedded content, applets, iframes, stylesheets, etc.) –  Remove all self-referencing URLs (as these change when parameters are inserted) –  We then perform different tests to determine similarity
  • 25. P-Scan: Tests •  Error test –  The application crashes, or return an “internal” error, when an identical parameter is injected multiple times –  Regexps from the sqlmap project •  Identity test –  Is the tested parameter considered by the application •  Page0=Page1=Page2 •  Base test –  Test assumes that the pre-filtering works perfectly (seldom the case)
  • 26. P-Scan: Tests •  Join test –  Are the two values are somehow combined together (e.g. ASP)? •  Fuzzy test –  It is designed to cope with pages whose dynamic components have not been perfectly sanitized –  Based on the Gestalt Pattern Matching algorithm –  Compute the similarity among the pages
  • 27. V-Scan: Testing for HPP vulnerabilities •  For every page, an innocuous URL-encoded parameter (nonce) is injected –  E.g., “%26foo%3Dbar” –  Then check if the “&foo=bar” string is included inside the URLs of links or forms in the answer page •  V-Scan starts by extracting the list PURL=[PU1,PU2,…PUn] of the parameters that are present in the page URL, and the list Pbody=[PB1,PB2,…PUm] of the parameters that are present in links or forms contained in the page body
  • 28. Where to inject the nonce •  PA = PURL ∩ PBody : set of parameters that appear unmodified in the URL and in the page content (links, forms) •  PB = p | p PURL p / PBody : URL parameters that do not appear in the page. Some of these parameters may appear in the page under a different name •  PC = p | p / PURL p PBody : set of parameters that appear somewhere in the page, but that are not present in the URL
  • 29. V-Scan: Special Cases •  E.g., one of the URL parameters (or part of it) is used as the entire target of a link •  Self-referencing links •  Similar issues with printing, sharing functionalities •  To reduce false positives, we use heuristics –  E.g., the injected parameter does not start with http:// –  Injection without URL-encoding
  • 30. Implementation – The PAPAS tool •  PAPAS: Parameter Pollution Analysis System •  The components communicate via TCP/IP sockets –  Crawler and Scanner are in Python –  The browser component has been implemented as a Firefox extension –  Advantage: We can see exactly how pages are rendered (cope with client-side scripts) –  Support for multiple sessions (parallelization)
  • 31. Implementation – The PAPAS tool •  PAPAS is fully customizable –  E.g., scanning depth, number of performed injections, page loading timeouts, etc. •  Three modes are supported –  Fast mode, extensive mode, assisted mode –  In assisted mode, authenticated areas of a site can be scanned as well
  • 32. Possible improvements •  PAPAS does not support the crawling of links embedded in active content –  E.g., flash •  Support additional encoding schemas (UTF-8, Double URL) •  PAPAS currently only focuses on client-side exploits where user needs to click on a link –  HPP is also possible on the server side – but this is more difficult to detect –  Analogous to detecting stored XSS
  • 33. Ethical Considerations •  Only client-side attacks. The server-side have the potential to cause harm •  We provided the applications with innocuous parameters (&foo=bar). No malicious code. •  Limited scan time (15min) and activity •  We immediately informed, when possible, the security engineers of the affected applications –  Thankful feedbacks
  • 34. Two set of experiments   We used PAPAS to scan a set of popular websites –  About 5,000 sites collected by the first 500 of Alexa’s main categories –  The aim: To quickly scan as many websites as possible and to see how common HPP flaws are   We then analyzed some of the sites we identified to be HPP-vulnerable in more detail
  • 35. The 5,016 tested sites Categories # of Tested Categories # of Tested Applications Applications Financial 110 Shopping 460 Games 300 Social Networking 117 Government 132 Sports 256 Health 235 Travel 175 Internet 698 University 91 News 599 Video 114 Organization 106 Others 1,401 Science 222
  • 36. Efficient assessment •  In 13 days, we tested 5,016 sites and more than 149,000 unique pages •  To maximize the speed, the scanner –  Crawled pages up to a distance of 3 from the homepage –  Considered links with at least one parameter (except for the homepage) –  Considered at max 5 instances for page (same page, different query string) –  We disabled pop-ups, images, plug-ins for active content technologies
  • 37. Evaluation – Parameter Precedence •  Database Errors –  Web developers does not seem conscious of the possibility to duplicate GET/POST parameters
  • 38. Evaluation – Parameter Precedence •  Parameter Inconsistency –  Sites developed using a combination of heterogeneous technologies (e.g. PHP and Perl) –  This is perfectly safe if the developer is aware of the HPP threat… this is not always the case
  • 39. Evaluation – HPP Vulnerabilities •  PAPAS discovered that about 1,500 (30%) websites contained at least one page vulnerable to HTTP Parameter Injection –  The tool was able to inject (and verify) an encoded parameter •  Vulnerable != Exploitable –  Is the parameter precedence consistent? –  Can a possible attacker override existing parameter values?
  • 40. Vulnerable or exploitable? •  Injection on link: –  Parameter in the middle -> always overriding –  Parameter at the begin/end -> automated check via P-Scan •  Injection on form: –  The injected value is automatically encoded by the browser –  Still, someone may be able to run a two-step attack (client-side) or a server-side attack
  • 41. Vulnerable or exploitable? •  702 applications are exploitable –  About 14% –  The injected parameter either overrides the value of an existing one or is accepted as “new parameter” •  E.g. A new action is injected Url: pool.pl?par1=val1%26action%3Dreset Link: target.pl?x=y&w=z&par1=val1&action=reset
  • 42. Evaluation •  More sensitive sites are equally (or even more) affected by the problem
  • 43. False Positives •  10 applications (1.12%) use the injected parameter as entire target for one link •  Variation of the special case we saw in slide 18 (V-Scan: special cases) –  The application applied a transformation to the parameter before using it as a link’s URL
  • 44. Some Case Studies •  We investigated some of the websites in more detail –  Among our “victims”: Facebook, Google, Symantec, Microsoft, PayPal, Flickr, FOX Video, VMWare, … –  We notified security officers and some of the problems were fixed –  Facebook: share component –  Several shopping cart applications could be manipulated to change the price of an item –  Some banks were vulnerable and we could play around with parameters –  Google: search engine results could be manipulated
  • 52. PAPAS Online Service •  5K websites tested –  30% sites are vulnerable: injectable parameters –  14% exploitable: possible to override or introduce arbitrary parameters/values •  What about mine? •  PAPAS @ http://papas.iseclab.org •  Free-to-use service •  Ownership token verification •  Configurable
  • 54. HPP Prevention •  Input validation –  Encoded query string delimiters •  Use safe methods –  Parameter precedence (ref. slide 14) –  Channel (GET/POST/Cookie) validation (ref. slide 19) •  Raise awareness –  The client can provide the same parameter twice (or more)
  • 55. Acknowledgments, References •  Co-joint work: –  M. Balduzzi, C. Torrano Gimenez, D. Balzarotti, and E. Kirda. Automated discovery of parameter pollution vulnerabilities in web applications. In NDSS’11, San Diego, CA. •  http://papas.iseclab.org/cgi-bin/resources.py •  Black Hat’s White Paper
  • 56. Conclusion   Presented the first technique and system to detect HPP vulnerabilities in web applications. •  We call it PAPAS, http://papas.iseclab.org   Conducted a large-scale study of the Internet •  About 5,000 web sites   Our results suggest that Parameter Pollution is a largely unknown, and wide-spread problem We hope our work will help raise awareness about HPP!