SlideShare a Scribd company logo
The science behind
RASP & IAST
Jitendra Chauhan
Cigital Inc.
Instrumentation & Taint Analysis
Agenda
Web Security Evolution
Marketing view of RASP and
IAST
Science Behind RASP and IAST
Way Forward
Q/A
Evolution
Developers
SDK + Libraries
Application
Web Containers
JRE + JVM
OS
Network
2001 2010 2012 2015 Beyond
DAST
SAST
EASPI
WAF
Training
Prevention
Protection
DAST vs. SAST
4
+ SQL Injection
+ Cross Site Scripting (XSS)
+ OS Commanding
+ HTTP Response Splitting
+ LDAP Injection
+ XPATH Injection
+ Path Traversal
+ Buffer Overflows
+ Format String Issues
+ Null Pointer Dereference
+ Threading Issues
+ Code Quality Issues
+ Insecure Crypto Issues
+ Issues in Non Web application
Code
- Higher number of FP
- Run time Code generation
- Dynamic Languages (Ruby +
Python)
Vulnerability Coverage
+ Runtime Privilege Issues
+ Authentication Issues
+ Session Management Issues
+ Insecure 3rd Party Libraries
+ Business Logic
Vulnerabilities
+ Protocol Parser Issues
- Web2.0, JSON, Flash,
HTML 5.0,
- Integrity and Availability
violations
- Long Execution Times
WAF vs. DAST
WAF
Positive
Quick Turnaround Time (Virtual Patching)
Drawbacks
Signature based (False Negatives, Bypass)
Manage Rules (Configure  QA  Deploy)
False Positives (Business disruption)
No Protection against Business Logic Vulnerabilities
Evolution
Developers
SDK + Libraries
Application
Web Containers
JRE + JVM
OS
Network
2001 2010 2012 2015 Beyond
DAST
SAST
EASPI
SAST +
DAST
WAF
Training
DAST+
WAF
Hybrid
RASP
IAST
Prevention
Protection
RASP
Protection
configured
inside the
application
IAST
Place
instrumentation
inside the app
to confirm
vulnerabilities
Evolution
Developers
SDK + Libraries
Application
Web Containers
JRE + JVM
OS
Network
2001 2010 2012 2015 Beyond
DAST
SAST
EASPI
SAST +
DAST
WAF
Training
DAST+
WAF
Hybrid
Security
JVM
Containers
RASP
IAST
Security
Coding
IDE
Botwall
Intrusion
Deception
Prevention
Protection
SQL Injection
Example
Firewall
Hardened OS
Web Server
App Server
Firewall
Databases
LegacySystems
WebServices
Directories
HumanResrcs
Billing
Custom Code
APPLICATION
ATTACK
NetworkLayerApplicationLayer
Accounts
Finance
Administration
Transactions
Communication
KnowledgeMgmt
E-Commerce
Bus.Functions
HTTP
request

SQL
query

DB Table


HTTP
response


"SELECT * FROM
accounts WHERE
acct=‘’ OR 1=1--
’"
1. Application presents a form to the
attacker
2. Attacker sends an attack in the form
data
3. Application forwards attack to the
database in a SQL query
Account Summary
Acct:5424-6066-2134-4334
Acct:4128-7574-3921-0192
Acct:5424-9383-2039-4029
Acct:4128-0004-1234-0293
4. Database runs query containing
attack and sends encrypted results
back to application
5. Application decrypts data as normal
and sends results to the user
Account:
SKU:
Account:
SKU:
10
How RASP Works?
SQL Injection
Firewall
Hardened OS
Web Server
App Server
Firewall
Databases
LegacySystems
WebServices
Directories
HumanResrcs
Billing
Custom Code
APPLICATION
ATTACK
NetworkLayerApplicationLayer
Accounts
Finance
Administration
Transactions
Communication
KnowledgeMgmt
E-Commerce
Bus.Functions
HTTP
request

SQL
query

HTTP
response


"SELECT * FROM
accounts WHERE
acct=‘’ OR 1=1--
’"
1. Application presents a form to the
attacker
2. Attacker sends an attack in the form
data. Agent taint the getParameter
variable
3. Application create SQL Query
based on getParameter.
Exception: Invalid SQL
Query
4. Agent intercept malicious query at
instrumented executeSQL method in
JDBC
5. Agent respond back SQL Exception.
Application will return back error to
the attacker
Account:
SKU:
Account:
SKU:
11
Exception


How IAST Works?
SQL Injection
Firewall
Hardened OS
Web Server
App Server
Firewall
Databases
LegacySystems
WebServices
Directories
HumanResrcs
Billing
Custom Code
APPLICATION
ATTACK
NetworkLayerApplicationLayer
Accounts
Finance
Administration
Transactions
Communication
KnowledgeMgmt
E-Commerce
Bus.Functions
SQL
query

"SELECT * FROM
accounts WHERE
acct=‘’ OR 1=1--
’"
1. Application presents a form to the
attacker
2. DAST Engine sends an attack in the
form data. Agent taint the
getParameter variable
3. Application create SQL Query
based on getParameter.
Some Data.
4. Agent stores the malicious query at
instrumented executeSQL method in
JDBC
5. DB execute query containing attack
and sends results back to application.
Account:
SKU:
Account:
SKU:
12
DAST
Engine
Correlation
Engine
HTTP
request

DB Table


6. Application decrypts data as normal
and sends results to the user
HTTP
response


Confirmed
Vulnerability!!
Let us talk about some Science!!!
Components of RASP
App Containers (Tomcat/Jboss)
• javax.servlet.ServletOutputStream
• org.apache.catalina.connector.CoyoteWriter
• org.apache.coyote.tomcat5.CoyoteWriter
• javax.servlet.jsp.JspWriter
DB (JDBC / Hibernate)
• org/hibernate/impl/SessionImpl
• com/mysql/.*
• com/ibm/db2/.*
• org/postgresql/.*
Frameworks (Spring /Struts)
• org/springframework/web/HttpRequestHandler
• org/apache/struts/action/Action
• org/apache/struts/actions/DispatchAction
Instrumentation Dynamic Taint
Analysis
Taint
Source
Taint
Propagat
ion
Taint
Sink
Taint Policy
Exploit Analyzer
Configuration
Components of IAST
App Containers (Tomcat/Jboss)
• javax.servlet.ServletOutputStream
• org.apache.catalina.connector.CoyoteWriter
• org.apache.coyote.tomcat5.CoyoteWriter
• javax.servlet.jsp.JspWriter
DB (JDBC / Hibernate)
• org/hibernate/impl/SessionImpl
• com/mysql/.*
• com/ibm/db2/.*
• org/postgresql/.*
Frameworks (Spring /Struts)
• org/springframework/web/HttpRequestHandler
• org/apache/struts/action/Action
• org/apache/struts/actions/DispatchAction
Instrumentation Dynamic Taint
Analysis
Taint
Source
Taint
Propagat
ion
Taint
Sink
Taint Policy
Exploit Analyzer
CorrelationEngine
How Instrumentation Works?
a.class
Web Application
JVM
Transformation
Module
a.classa.class
Instrumentation
Byte Code
Instrumentation
Agent
Runtime Data Areas
Method Area
Thread
Stacks
Heap
Constant
Pool
Set of Class
Loaders
Apache Tomcat
b.class
How Instrumentation Works?
a.class
Web Application
JVM
Transformation
Module
a.classa.class
Instrumentation
Byte Code
Instrumentation
Agent
Runtime Data Areas
Method Area
Thread
Stacks
Heap
Constant
Pool
Set of Class
Loaders
b.class
Apache Tomcat
How Instrumentation Works?
java -java agent:/path/to/agent.jar com/example/mains/QueryDBTransactions
JVM
Agent
Agent.class:
void premain(String agentArgs, Instrumentation inst)
MyTransformer.class:
byte[] transform( . . . , byte[] queryTransBytes)
1. call Agent premain in manifest
2. JVM registers my transformer
3. Give QueryDBTransaction bytes to
MyTransformer
4. MyTransformer performs byte code
manipulation
QueryDBTransaction.class:
void main(String[] args)
5. QueryDBTransactionloaded and
main runs
Byte Code Manipulation
(Class File format)
Byte Code Manipulation
Class Parser
Class Adapter
Class Generator
b.class
Loaded into JVM
Visit
VisitMethod*
VisitEnd
Visit
VisitMethod*
VisitEnd
New Classes
New Methods
New Fields
Dynamic Taint Analysis
(Quick & Dirty)
21
x = Request.getQueryParam(“username”)
…
y = copyString(x)
…
r = executeSQL(y)
Dynamic Taint Analysis
(Quick & Dirty)
22
x = Request.getQueryParam(“username”)
…
y = copyString(x)
…
r = executeSQL(y)
Input is
tainted
Dynamic Taint Analysis
(Quick & Dirty)
23
x = Request.getQueryParam(“username”)
…
y = copyString(x)
…
r = executeSQL(y)
Input is
tainted
Tainted Untainted
Taint Propagtion
24
x = Request.getQueryParam(“username”)
…
y = copyString(x)
…
r = executeSQL(y)
Tainted Untainted
Data derived
from user
input is
tainted
Taint Sink
25
x = Request.getQueryParam(“username”)
…
y = copyString(x)
…
r = executeSQL(y)
Tainted Untainted
Policy
violation
detected
Example
Taint Propagation Rules
26
Challenges in Taint Analysis
Under Tainting
False Negatives
Over Tainting
False Positives
Taint Sanitization
False Positives
Challenges
RASP
Performance overhead of Instrumentation and Taint Analysis.
Are you ready for it?
Taint Analysis Challenges
False Positives
False Negatives
No protection from logical vulnerabilities
IAST
Time to discover vs. time to fix
Instrumentation of the production code
Has all the limitation of DAST
QA

More Related Content

PPTX
From the Frontline of RASP Adoption
PDF
Workshop : Application Security
PDF
Technical Architecture of RASP Technology
PPTX
Continuous Application Security at Scale with IAST and RASP -- Transforming D...
PPTX
[OPD 2019] AST Platform and the importance of multi-layered application secu...
PPTX
20160211 OWASP Charlotte RASP
PPTX
Static Analysis Security Testing for Dummies... and You
PDF
we45 - Web Application Security Testing Case Study
From the Frontline of RASP Adoption
Workshop : Application Security
Technical Architecture of RASP Technology
Continuous Application Security at Scale with IAST and RASP -- Transforming D...
[OPD 2019] AST Platform and the importance of multi-layered application secu...
20160211 OWASP Charlotte RASP
Static Analysis Security Testing for Dummies... and You
we45 - Web Application Security Testing Case Study

What's hot (20)

PPTX
Evaluating Web App, Mobile App, and API Security - Matt Cohen
PPTX
[OPD 2019] Inter-application vulnerabilities
PPTX
AppSec EU 2016: Automated Mobile Application Security Assessment with MobSF
PDF
[OPD 2019] Life after pentest
PDF
Checkmarx meetup API Security - API Security top 10 - Erez Yalon
PDF
Testing Web Application Security
PPT
香港六合彩
PDF
React commonest security flaws and remedial measures!
PPTX
DAST, SAST, Hybrid, Hybrid 2.0 & IAST - Methodology & Limitations
PPTX
Secure coding guidelines
PPTX
Hack through Injections
PDF
[OPD 2019] Web Apps vs Blockchain dApps
PDF
Pactera - App Security Assessment - Mobile, Web App, IoT - v2
PDF
Scalable threat modelling with risk patterns
PPTX
Security hole #5 application security science or quality assurance
PDF
WEBINAR: Positive Security for APIs: What it is and why you need it!
PPTX
Secure coding practices
PDF
Top API Security Issues Found During POCs
PDF
OWASP Secure Coding Practices - Quick Reference Guide
PDF
Finacle - Secure Coding Practices
Evaluating Web App, Mobile App, and API Security - Matt Cohen
[OPD 2019] Inter-application vulnerabilities
AppSec EU 2016: Automated Mobile Application Security Assessment with MobSF
[OPD 2019] Life after pentest
Checkmarx meetup API Security - API Security top 10 - Erez Yalon
Testing Web Application Security
香港六合彩
React commonest security flaws and remedial measures!
DAST, SAST, Hybrid, Hybrid 2.0 & IAST - Methodology & Limitations
Secure coding guidelines
Hack through Injections
[OPD 2019] Web Apps vs Blockchain dApps
Pactera - App Security Assessment - Mobile, Web App, IoT - v2
Scalable threat modelling with risk patterns
Security hole #5 application security science or quality assurance
WEBINAR: Positive Security for APIs: What it is and why you need it!
Secure coding practices
Top API Security Issues Found During POCs
OWASP Secure Coding Practices - Quick Reference Guide
Finacle - Secure Coding Practices
Ad

Viewers also liked (6)

PPTX
What Good is this Tool? A Guide to Choosing the Right Application Security Te...
KEY
Security Code Review: Magic or Art?
PDF
Security Code Reviews. Does Your Code Need an Open Heart Surgery and The 6 Po...
PDF
SAST vs. DAST: What’s the Best Method For Application Security Testing?
PDF
SAP NetWeaver Application Server Add-On for Code Vulnerability Analysis Overview
PDF
Simplified Security Code Review Process
What Good is this Tool? A Guide to Choosing the Right Application Security Te...
Security Code Review: Magic or Art?
Security Code Reviews. Does Your Code Need an Open Heart Surgery and The 6 Po...
SAST vs. DAST: What’s the Best Method For Application Security Testing?
SAP NetWeaver Application Server Add-On for Code Vulnerability Analysis Overview
Simplified Security Code Review Process
Ad

Similar to Application Security Workshop (20)

PDF
Shreeraj - Hacking Web 2 0 - ClubHack2007
PPTX
Architecting For The Windows Azure Platform
PPTX
StrongLoop Overview
PDF
RAHUL_Updated( (2)
PDF
Polysource-IT Profile
PDF
Polysource-IT Profile
PPTX
Web 2.0 Development with IBM DB2
PPTX
Observability in real time at scale
PDF
Mike Taulty MIX10 Silverlight 4 Patterns Frameworks
PPT
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
DOCX
Nitesh_Sr._Java_developer_Lead
DOCX
Rajeev_Resume
PDF
Polysource It Profile
PDF
Poly Source It Profile
PDF
CTU June 2011 - Things that Every ASP.NET Developer Should Know
PPTX
Power of ONE Automation through Web Services
PPTX
aip-developer-intro_pag2015
PDF
Shreeraj-Hacking_Web_2
DOC
KASSAHUNSolomonResume
PPT
gofortution
Shreeraj - Hacking Web 2 0 - ClubHack2007
Architecting For The Windows Azure Platform
StrongLoop Overview
RAHUL_Updated( (2)
Polysource-IT Profile
Polysource-IT Profile
Web 2.0 Development with IBM DB2
Observability in real time at scale
Mike Taulty MIX10 Silverlight 4 Patterns Frameworks
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
Nitesh_Sr._Java_developer_Lead
Rajeev_Resume
Polysource It Profile
Poly Source It Profile
CTU June 2011 - Things that Every ASP.NET Developer Should Know
Power of ONE Automation through Web Services
aip-developer-intro_pag2015
Shreeraj-Hacking_Web_2
KASSAHUNSolomonResume
gofortution

More from Priyanka Aash (20)

PPTX
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
PDF
From Chatbot to Destroyer of Endpoints - Can ChatGPT Automate EDR Bypasses (1...
PDF
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
PDF
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
PDF
Lessons Learned from Developing Secure AI Workflows.pdf
PDF
Cyber Defense Matrix Workshop - RSA Conference
PDF
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
PDF
Securing AI - There Is No Try, Only Do!.pdf
PDF
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
PDF
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
PDF
10 Key Challenges for AI within the EU Data Protection Framework.pdf
PDF
Techniques for Automatic Device Identification and Network Assignment.pdf
PDF
Keynote : Presentation on SASE Technology
PDF
Keynote : AI & Future Of Offensive Security
PDF
Redefining Cybersecurity with AI Capabilities
PDF
Demystifying Neural Networks And Building Cybersecurity Applications
PDF
Finetuning GenAI For Hacking and Defending
PDF
(CISOPlatform Summit & SACON 2024) Kids Cyber Security .pdf
PDF
(CISOPlatform Summit & SACON 2024) Regulation & Response In Banks.pdf
PDF
(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
From Chatbot to Destroyer of Endpoints - Can ChatGPT Automate EDR Bypasses (1...
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Lessons Learned from Developing Secure AI Workflows.pdf
Cyber Defense Matrix Workshop - RSA Conference
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Securing AI - There Is No Try, Only Do!.pdf
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Techniques for Automatic Device Identification and Network Assignment.pdf
Keynote : Presentation on SASE Technology
Keynote : AI & Future Of Offensive Security
Redefining Cybersecurity with AI Capabilities
Demystifying Neural Networks And Building Cybersecurity Applications
Finetuning GenAI For Hacking and Defending
(CISOPlatform Summit & SACON 2024) Kids Cyber Security .pdf
(CISOPlatform Summit & SACON 2024) Regulation & Response In Banks.pdf
(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf

Recently uploaded (20)

PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Modernizing your data center with Dell and AMD
PDF
Empathic Computing: Creating Shared Understanding
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Encapsulation theory and applications.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPT
Teaching material agriculture food technology
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
A Presentation on Artificial Intelligence
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
Reach Out and Touch Someone: Haptics and Empathic Computing
Modernizing your data center with Dell and AMD
Empathic Computing: Creating Shared Understanding
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
NewMind AI Monthly Chronicles - July 2025
Digital-Transformation-Roadmap-for-Companies.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Encapsulation theory and applications.pdf
Network Security Unit 5.pdf for BCA BBA.
Understanding_Digital_Forensics_Presentation.pptx
Teaching material agriculture food technology
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
cuic standard and advanced reporting.pdf
NewMind AI Weekly Chronicles - August'25 Week I
CIFDAQ's Market Insight: SEC Turns Pro Crypto
A Presentation on Artificial Intelligence
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Unlocking AI with Model Context Protocol (MCP)

Application Security Workshop

  • 1. The science behind RASP & IAST Jitendra Chauhan Cigital Inc. Instrumentation & Taint Analysis
  • 2. Agenda Web Security Evolution Marketing view of RASP and IAST Science Behind RASP and IAST Way Forward Q/A
  • 3. Evolution Developers SDK + Libraries Application Web Containers JRE + JVM OS Network 2001 2010 2012 2015 Beyond DAST SAST EASPI WAF Training Prevention Protection
  • 4. DAST vs. SAST 4 + SQL Injection + Cross Site Scripting (XSS) + OS Commanding + HTTP Response Splitting + LDAP Injection + XPATH Injection + Path Traversal + Buffer Overflows + Format String Issues + Null Pointer Dereference + Threading Issues + Code Quality Issues + Insecure Crypto Issues + Issues in Non Web application Code - Higher number of FP - Run time Code generation - Dynamic Languages (Ruby + Python) Vulnerability Coverage + Runtime Privilege Issues + Authentication Issues + Session Management Issues + Insecure 3rd Party Libraries + Business Logic Vulnerabilities + Protocol Parser Issues - Web2.0, JSON, Flash, HTML 5.0, - Integrity and Availability violations - Long Execution Times
  • 5. WAF vs. DAST WAF Positive Quick Turnaround Time (Virtual Patching) Drawbacks Signature based (False Negatives, Bypass) Manage Rules (Configure  QA  Deploy) False Positives (Business disruption) No Protection against Business Logic Vulnerabilities
  • 6. Evolution Developers SDK + Libraries Application Web Containers JRE + JVM OS Network 2001 2010 2012 2015 Beyond DAST SAST EASPI SAST + DAST WAF Training DAST+ WAF Hybrid RASP IAST Prevention Protection
  • 9. Evolution Developers SDK + Libraries Application Web Containers JRE + JVM OS Network 2001 2010 2012 2015 Beyond DAST SAST EASPI SAST + DAST WAF Training DAST+ WAF Hybrid Security JVM Containers RASP IAST Security Coding IDE Botwall Intrusion Deception Prevention Protection
  • 10. SQL Injection Example Firewall Hardened OS Web Server App Server Firewall Databases LegacySystems WebServices Directories HumanResrcs Billing Custom Code APPLICATION ATTACK NetworkLayerApplicationLayer Accounts Finance Administration Transactions Communication KnowledgeMgmt E-Commerce Bus.Functions HTTP request  SQL query  DB Table   HTTP response   "SELECT * FROM accounts WHERE acct=‘’ OR 1=1-- ’" 1. Application presents a form to the attacker 2. Attacker sends an attack in the form data 3. Application forwards attack to the database in a SQL query Account Summary Acct:5424-6066-2134-4334 Acct:4128-7574-3921-0192 Acct:5424-9383-2039-4029 Acct:4128-0004-1234-0293 4. Database runs query containing attack and sends encrypted results back to application 5. Application decrypts data as normal and sends results to the user Account: SKU: Account: SKU: 10
  • 11. How RASP Works? SQL Injection Firewall Hardened OS Web Server App Server Firewall Databases LegacySystems WebServices Directories HumanResrcs Billing Custom Code APPLICATION ATTACK NetworkLayerApplicationLayer Accounts Finance Administration Transactions Communication KnowledgeMgmt E-Commerce Bus.Functions HTTP request  SQL query  HTTP response   "SELECT * FROM accounts WHERE acct=‘’ OR 1=1-- ’" 1. Application presents a form to the attacker 2. Attacker sends an attack in the form data. Agent taint the getParameter variable 3. Application create SQL Query based on getParameter. Exception: Invalid SQL Query 4. Agent intercept malicious query at instrumented executeSQL method in JDBC 5. Agent respond back SQL Exception. Application will return back error to the attacker Account: SKU: Account: SKU: 11 Exception  
  • 12. How IAST Works? SQL Injection Firewall Hardened OS Web Server App Server Firewall Databases LegacySystems WebServices Directories HumanResrcs Billing Custom Code APPLICATION ATTACK NetworkLayerApplicationLayer Accounts Finance Administration Transactions Communication KnowledgeMgmt E-Commerce Bus.Functions SQL query  "SELECT * FROM accounts WHERE acct=‘’ OR 1=1-- ’" 1. Application presents a form to the attacker 2. DAST Engine sends an attack in the form data. Agent taint the getParameter variable 3. Application create SQL Query based on getParameter. Some Data. 4. Agent stores the malicious query at instrumented executeSQL method in JDBC 5. DB execute query containing attack and sends results back to application. Account: SKU: Account: SKU: 12 DAST Engine Correlation Engine HTTP request  DB Table   6. Application decrypts data as normal and sends results to the user HTTP response   Confirmed Vulnerability!!
  • 13. Let us talk about some Science!!!
  • 14. Components of RASP App Containers (Tomcat/Jboss) • javax.servlet.ServletOutputStream • org.apache.catalina.connector.CoyoteWriter • org.apache.coyote.tomcat5.CoyoteWriter • javax.servlet.jsp.JspWriter DB (JDBC / Hibernate) • org/hibernate/impl/SessionImpl • com/mysql/.* • com/ibm/db2/.* • org/postgresql/.* Frameworks (Spring /Struts) • org/springframework/web/HttpRequestHandler • org/apache/struts/action/Action • org/apache/struts/actions/DispatchAction Instrumentation Dynamic Taint Analysis Taint Source Taint Propagat ion Taint Sink Taint Policy Exploit Analyzer Configuration
  • 15. Components of IAST App Containers (Tomcat/Jboss) • javax.servlet.ServletOutputStream • org.apache.catalina.connector.CoyoteWriter • org.apache.coyote.tomcat5.CoyoteWriter • javax.servlet.jsp.JspWriter DB (JDBC / Hibernate) • org/hibernate/impl/SessionImpl • com/mysql/.* • com/ibm/db2/.* • org/postgresql/.* Frameworks (Spring /Struts) • org/springframework/web/HttpRequestHandler • org/apache/struts/action/Action • org/apache/struts/actions/DispatchAction Instrumentation Dynamic Taint Analysis Taint Source Taint Propagat ion Taint Sink Taint Policy Exploit Analyzer CorrelationEngine
  • 16. How Instrumentation Works? a.class Web Application JVM Transformation Module a.classa.class Instrumentation Byte Code Instrumentation Agent Runtime Data Areas Method Area Thread Stacks Heap Constant Pool Set of Class Loaders Apache Tomcat b.class
  • 17. How Instrumentation Works? a.class Web Application JVM Transformation Module a.classa.class Instrumentation Byte Code Instrumentation Agent Runtime Data Areas Method Area Thread Stacks Heap Constant Pool Set of Class Loaders b.class Apache Tomcat
  • 18. How Instrumentation Works? java -java agent:/path/to/agent.jar com/example/mains/QueryDBTransactions JVM Agent Agent.class: void premain(String agentArgs, Instrumentation inst) MyTransformer.class: byte[] transform( . . . , byte[] queryTransBytes) 1. call Agent premain in manifest 2. JVM registers my transformer 3. Give QueryDBTransaction bytes to MyTransformer 4. MyTransformer performs byte code manipulation QueryDBTransaction.class: void main(String[] args) 5. QueryDBTransactionloaded and main runs
  • 20. Byte Code Manipulation Class Parser Class Adapter Class Generator b.class Loaded into JVM Visit VisitMethod* VisitEnd Visit VisitMethod* VisitEnd New Classes New Methods New Fields
  • 21. Dynamic Taint Analysis (Quick & Dirty) 21 x = Request.getQueryParam(“username”) … y = copyString(x) … r = executeSQL(y)
  • 22. Dynamic Taint Analysis (Quick & Dirty) 22 x = Request.getQueryParam(“username”) … y = copyString(x) … r = executeSQL(y) Input is tainted
  • 23. Dynamic Taint Analysis (Quick & Dirty) 23 x = Request.getQueryParam(“username”) … y = copyString(x) … r = executeSQL(y) Input is tainted Tainted Untainted
  • 24. Taint Propagtion 24 x = Request.getQueryParam(“username”) … y = copyString(x) … r = executeSQL(y) Tainted Untainted Data derived from user input is tainted
  • 25. Taint Sink 25 x = Request.getQueryParam(“username”) … y = copyString(x) … r = executeSQL(y) Tainted Untainted Policy violation detected
  • 27. Challenges in Taint Analysis Under Tainting False Negatives Over Tainting False Positives Taint Sanitization False Positives
  • 28. Challenges RASP Performance overhead of Instrumentation and Taint Analysis. Are you ready for it? Taint Analysis Challenges False Positives False Negatives No protection from logical vulnerabilities IAST Time to discover vs. time to fix Instrumentation of the production code Has all the limitation of DAST
  • 29. QA