SlideShare a Scribd company logo
Insecure Implementation of
     Security Practices
        Karmendra Kohli
      Director, Co-founder
Agenda
• Talk about insecure implementation of
  security practices for
  – Salted Hashing
  – CAPTCHA
  – Browser Caching
Why do we need authentication
• Abstraction of Lock and Key
  – Humans are used to and comfortable with the
    concept
• Explicit Authentication happens only once
  – Implicit authentication with each request
Threats to passwords
• In the Host
  – Can be found in Memory or Browser History
• Network
  – Can be sniffed or found in proxy logs
• Database
  – If stored in clear-text, compromise of DB leads to
    complete compromise
  – Backup tapes etc
Securing Credentials
• Denote password by ******** in the form field
  – Can be guessed
• Implement strong password policy
  – Can be stolen
• Base64 Encoding
  – Can be decoded
• Encrypting the password
  – Can be decrypted
• Hashing the password
  – Our story begins from here…
Hashing
• Cryptographic Hash Function is a
  transformation that takes an input and returns
  a fixed-size string, which is called the hash
  value. – From Wikipedia
• One way hashes cannot be reversed, they can
  only be compared
  – Just like finger prints
• A strong one-way hash will have minute
  probability of collision
Use of hashing
• Authentication
• Message Integrity
• Digital Signatures
Is just a hash secure?
• Hash can be stolen from the
  – memory
  – browser history
  – network by sniffing
  – proxy logs
• We can replay the hash instead of the clear
  text password
  – Does not need to be reversed for authentication
Hash with a pinch of salt
• Salted hash
  – Aims at implementing a one time password
    scheme
  – Each time the password of the user transmitted
    from the client is different
  – Even if stolen cannot be reused/replayed
  Well That Is The Aim!!
The Working Steps
1. With each request to the login page by the user,
   the server generates a random number, the salt,
   and sends it to the client along with the login
   page.
2. A JavaScript code on the client computes the
   hash of the password entered by the user.
3. The salt is concatenated with the computed
   hash of the password to re-compute the hash of
   the concatenated string (let this salted hash be
   ‘A’).
4. The result i.e. ‘A’ generated in the previous step
   is sent to the server along with the username.
The Working Steps
5. On the server side - the application retrieves the
   hashed password for the corresponding
   username from the database.
6. The hashed password fetched from the database
   is concatenated with the salt (which was earlier
   sent to the client) stored at the server. Hash of
   the concatenated string is calculated at the
   server (let this salted hash be B).
7. If the user entered the correct password then
   these two hashes (A & B) should match. The
   server compares these two hashes and if they
   match, the user is authenticated.
8. The salt is then deleted from the server side
Insecure Implementations
1. Generating salt on client side
Generating salt on client side
Generating salt on client side
• So we have all values that server needs to
  calculate the salted hash
• It is enough to replay the values
• Beats goal of using salts
2. Using a limited set of salts
• The number of salts being used by the server
  is fixed
• Above replay technique works
  – We just need to try multiple number of times
3. Using same salt for same user
• In this case the salted hash was stored by the
  developer in the DB
  – Gives a ‘feeling’ of more security
• If salted hash is stored as password, then salt
  too needs to be stored ☺
• Hence same salt is sent each time - replay
4. Not re-initializing the salt for login
                  pages
• Multiple logins from the same browser
  resulted in same salt being used
• Salt not deleted from the server side on
  successful or unsuccessful authentication
• Problem is also related to not re-initializing
  the session after successful or unsuccessful
  authentication
• Attack window is small, but still…
5. Transmitting clear text password
         along with salted hash
• Many implementations observed
• The salted hash is sent along with clear text
  form input fields
• The salted hash is computed using different
  set of hidden variables
Transmitting clear text along with
           salted hash
6. Not re-initializing the java script
                 variables
• Uname = Document.form1.textbox1.value
• Pwd = Document.form1.textbox2.value
• Use the and ‘pwd’ variable for salted hash
  calculation
  – Hash = Hfx (pwd)
  – Hash = Hfx (Hash + salt)
• The uname and pwd can be found as clear text
  in memory
Not re-initializing the java script
            variables
7. Storing password in clear text in
                database
• Hash = hash (password + salt)
• Server does not store salt in the database
• Clearly implies that server also does not store
  hash of password in database
Salted Hash Best Practices
• Salt
  – Generated on server side
  – Must be highly random. Must use cryptographically
    strong PRNG algorithm
  – Must never be stored in the database
  – Must be re-generated after each successful
    /unsuccessful attempt
  – All temporary Form Field or JS variables must be set to
    null before submitting the request
• Passwords must be stored in hashed format in
  the database
CAPTCHA
• Completely Automated Public Turing Tests to Tell
  Computers and Humans Apart




• Aim is to introduce an entity that requires human
  intervention
• Protection against DOS or Brute force or Misuse
  – Avoiding automating submissions
Typical uses
• Public Forms
  – Registration
  – Feedback / Rating
  – Survey
  – Blog post
  – Appointment/Slot booking
CAPTCHA - Implementation
• Initiate a session for the page rendered
• Request for image
• Generate unique string randomly on server side
• Generate image with string embedded
• Remember the string in Session Object and send
  CAPTCHA to client
• For each client request, validate the sent value with the
  one in the session object
• Invalidate session after each attempt
    – Both successful and unsuccessful
• Generate new CAPTCHA for each new page request
Insecure Implementation
• We are not focusing weakness of CAPTCHA
  generation
  – It’s a different ball game
• We will discuss common implementation
  flaws of using CAPTCHA’s
1. Verifying CAPTCHA on client side
• The client side JavaScript verifies the CAPTCHA
  value
• Server trusts the decision of client
  strPassFlag=True;
• Completely bypass enforcement
• Automate submission
2. Having a limited set words
• Small fixed pool of CAPTCHA words
• Automated tools will have high probability of
  hits
• Bypass goal of implementing CAPTCHA
What better than a COMBO




                   Limited pool of
               CAPTCHA values with
               client side verification
3. Validate CAPTCHA on server but
         value sent from client
• Actual value of CAPTCHA sent as hidden
  variable
  – Hmmmmm, “hidden” does not mean “secure”
• Replay request with value of our choice
4. Session is not re-initialized
• Session not re-initialized after form
  submission
• Refresh on submitted page works
• Automate replay of requests using assigned
  session ID
• Multiple registrations
  – Treasure trove for spammers
5. Image ID can be replayed
• The request for image is of the form
• <img src =
  http://www.testserver.com/image_draw.jsp?I
  D=23erdfret45ffrsd4g3fd3sa3a4d5a
• The image_draw.jsp decrypts the value to get
  the word
• For the same value the same word is rendered
  ALWAYS
• Replay image request
Image ID can be replayed
 Client                                             Server
          Step#1: Request for Public FORM



          Step#2: Form with
          <img src=http://…/image_draw.php?id=X1>

                                                     Step#4: Generate an image
          Step#3: Request for Image                  based on unique token (X1) &
                                                     store in the session object.

          Step#5: Form rendered with image


                                                     Step#7: Validation with string
          Step#6: FORM Submission                    stored in the session object.




• Step 2 can be replayed
6. CAPTCHA is not an image
• One application had a ‘feeling’ of an image
• Java Script used for rendering the text on the
  page in a “different” font
• Tools can read such text easily


                                    Text can be selected ☺
CAPTCHA implementation best
             practices
CAPTCHA:
  – Generated on server side
  – Verified on server side
  – Strings must be randomly generated
  – Images must not be generated based on token
    from ‘hidden’ client side
  – Must be bound to a session
  – Must be re-generated after each successful
    /unsuccessful attempt
Caching Issues
• Unauthorized access to information


  User Name              CC No                      User
                         SB Account No              Logged off
  Password
                                          Back

              Submit                     Submit
   Sign In
                                         Sign Out

    Login              Account Details              Thank You
Browser Cache
• A local store
  – Aims to improve performance
  – Renders pages locally, fast user experience
  – Support across browsers
• Controlled by a lot many directives
  – Pragma: no-cache
  – Cache-control: no-cache
  – Expires: Mon, 03 Jul 2000 9:30:41 GMT
Caching
• Relevant HTTP fields
  •   Request
      o If-Modified-Since
      o Pragma: no-cache

  •   Response
      o Last-Modified
      o Expires: Mon, 03 Apr 2009 9:30:41 GMT
      o Cache-Control: no-cache, no-store
Caching
• Relevant HTTP fields
  •   Request
      o If-Modified-Since – Recheck for fresh content
      o Pragma: no-cache – HTTP 1.0

  •   Response
      o Last-Modified – Confirm fresh content
      o Expires: ………… – HTTP 1.0
      o Cache-Control: no-cache – Pages will not be
         displayed, but will still be stored
      o Cache-Control: no-store – Pages will not be stored
Caching best practice
• For critical applications
   • Cache-Control: no-cache and Cache-
     Control: no-store must be set for ALL pages
Example Implementation flaw
• Banking application
   – Ideally all pages must be fetched fresh
   – Clicking on ‘back’ must not render page
   – All pages set with Cache-Control: no-cache,
     no-store
      – excepting logout page
   – On logout, an intermediate proxy used to
     serve logout page
   – Session was not invalidated as request did
     not reach server
karmendra.kohli@secureyes.net

More Related Content

Viewers also liked

Sd kad sik dapat baca
Sd kad sik dapat bacaSd kad sik dapat baca
Sd kad sik dapat bacamanzuna
 
Melihat Nama PC Menggunakan Aplikasi Pemograman Java
Melihat Nama PC Menggunakan Aplikasi Pemograman JavaMelihat Nama PC Menggunakan Aplikasi Pemograman Java
Melihat Nama PC Menggunakan Aplikasi Pemograman Javayoyomay93
 
Michelle
MichelleMichelle
Michelle
michellecdc
 
Yelena Voloshina 15
Yelena Voloshina   15Yelena Voloshina   15
Yelena Voloshina 15
Brady Miller
 
Jamaica land tour 2014 bahia principe
Jamaica land tour 2014 bahia principeJamaica land tour 2014 bahia principe
Jamaica land tour 2014 bahia principeFabrizzio Gallegos
 
Reunions d'avaluació setembre 2014
Reunions d'avaluació setembre 2014Reunions d'avaluació setembre 2014
Reunions d'avaluació setembre 2014iesramonllull
 
Semantico
SemanticoSemantico
Semantico
quetzalmbv
 
Trabajo practico ecologia
Trabajo practico ecologiaTrabajo practico ecologia
Trabajo practico ecologia
32405135
 
Presentation1 Foobar411 249zmh7u '"&lt;asdf>
Presentation1 Foobar411 249zmh7u  '"&lt;asdf>Presentation1 Foobar411 249zmh7u  '"&lt;asdf>
Presentation1 Foobar411 249zmh7u '"&lt;asdf>
cruoho
 
Presentation1 Foobar411 bcumj7my '"&lt;asdf>
Presentation1 Foobar411 bcumj7my '"&lt;asdf>Presentation1 Foobar411 bcumj7my '"&lt;asdf>
Presentation1 Foobar411 bcumj7my '"&lt;asdf>
cruoho
 
Firefox security (prasanna)
Firefox security (prasanna) Firefox security (prasanna)
Firefox security (prasanna) ClubHack
 
Blogguide superstar media
Blogguide superstar mediaBlogguide superstar media
Blogguide superstar media
Webbstjarnan |.SE
 
108190 texaco
108190 texaco108190 texaco
108190 texacocmiguel7
 
88 Gibraltar Stock Availability
88 Gibraltar Stock Availability 88 Gibraltar Stock Availability
88 Gibraltar Stock Availability
88gibraltar
 
Revisão para a Prova de FTG
Revisão para a Prova de FTGRevisão para a Prova de FTG
Revisão para a Prova de FTGHugo Santos
 

Viewers also liked (20)

Poly0000
Poly0000Poly0000
Poly0000
 
Sd kad sik dapat baca
Sd kad sik dapat bacaSd kad sik dapat baca
Sd kad sik dapat baca
 
Melihat Nama PC Menggunakan Aplikasi Pemograman Java
Melihat Nama PC Menggunakan Aplikasi Pemograman JavaMelihat Nama PC Menggunakan Aplikasi Pemograman Java
Melihat Nama PC Menggunakan Aplikasi Pemograman Java
 
Michelle
MichelleMichelle
Michelle
 
Inscripciones estres
Inscripciones estresInscripciones estres
Inscripciones estres
 
Yelena Voloshina 15
Yelena Voloshina   15Yelena Voloshina   15
Yelena Voloshina 15
 
Jamaica land tour 2014 bahia principe
Jamaica land tour 2014 bahia principeJamaica land tour 2014 bahia principe
Jamaica land tour 2014 bahia principe
 
Reunions d'avaluació setembre 2014
Reunions d'avaluació setembre 2014Reunions d'avaluació setembre 2014
Reunions d'avaluació setembre 2014
 
888
888888
888
 
Semantico
SemanticoSemantico
Semantico
 
Umar
UmarUmar
Umar
 
Trabajo practico ecologia
Trabajo practico ecologiaTrabajo practico ecologia
Trabajo practico ecologia
 
Market report 1 5-2010
Market report 1 5-2010Market report 1 5-2010
Market report 1 5-2010
 
Presentation1 Foobar411 249zmh7u '"&lt;asdf>
Presentation1 Foobar411 249zmh7u  '"&lt;asdf>Presentation1 Foobar411 249zmh7u  '"&lt;asdf>
Presentation1 Foobar411 249zmh7u '"&lt;asdf>
 
Presentation1 Foobar411 bcumj7my '"&lt;asdf>
Presentation1 Foobar411 bcumj7my '"&lt;asdf>Presentation1 Foobar411 bcumj7my '"&lt;asdf>
Presentation1 Foobar411 bcumj7my '"&lt;asdf>
 
Firefox security (prasanna)
Firefox security (prasanna) Firefox security (prasanna)
Firefox security (prasanna)
 
Blogguide superstar media
Blogguide superstar mediaBlogguide superstar media
Blogguide superstar media
 
108190 texaco
108190 texaco108190 texaco
108190 texaco
 
88 Gibraltar Stock Availability
88 Gibraltar Stock Availability 88 Gibraltar Stock Availability
88 Gibraltar Stock Availability
 
Revisão para a Prova de FTG
Revisão para a Prova de FTGRevisão para a Prova de FTG
Revisão para a Prova de FTG
 

Similar to Karmendra - Hashing, CAPTCHA's and Caching - ClubHack2008

Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...
Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...
Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...amiable_indian
 
CNIT 129S: Ch 7: Attacking Session Management
CNIT 129S: Ch 7: Attacking Session Management CNIT 129S: Ch 7: Attacking Session Management
CNIT 129S: Ch 7: Attacking Session Management
Sam Bowne
 
Ch 7: Attacking Session Management
Ch 7: Attacking Session ManagementCh 7: Attacking Session Management
Ch 7: Attacking Session Management
Sam Bowne
 
Authentication in Node.js
Authentication in Node.jsAuthentication in Node.js
Authentication in Node.jsJason Pearson
 
CNIT 129S: Ch 6: Attacking Authentication
CNIT 129S: Ch 6: Attacking AuthenticationCNIT 129S: Ch 6: Attacking Authentication
CNIT 129S: Ch 6: Attacking Authentication
Sam Bowne
 
Ch 6: Attacking Authentication
Ch 6: Attacking AuthenticationCh 6: Attacking Authentication
Ch 6: Attacking Authentication
Sam Bowne
 
CNIT 129S Ch 7: Attacking Session Management
CNIT 129S Ch 7: Attacking Session ManagementCNIT 129S Ch 7: Attacking Session Management
CNIT 129S Ch 7: Attacking Session Management
Sam Bowne
 
CNIT 129S - Ch 6a: Attacking Authentication
CNIT 129S - Ch 6a: Attacking AuthenticationCNIT 129S - Ch 6a: Attacking Authentication
CNIT 129S - Ch 6a: Attacking Authentication
Sam Bowne
 
CNIT 129: 6. Attacking Authentication
CNIT 129: 6. Attacking AuthenticationCNIT 129: 6. Attacking Authentication
CNIT 129: 6. Attacking Authentication
Sam Bowne
 
Brute Force - Lior Rotkovitch - f5 SIRT v5.pdf
Brute Force - Lior Rotkovitch - f5 SIRT v5.pdfBrute Force - Lior Rotkovitch - f5 SIRT v5.pdf
Brute Force - Lior Rotkovitch - f5 SIRT v5.pdf
Lior Rotkovitch
 
Ntu workshop : REST, PayPal APIs & Async
Ntu workshop : REST, PayPal APIs & AsyncNtu workshop : REST, PayPal APIs & Async
Ntu workshop : REST, PayPal APIs & Async
Aeshan Wijetunge
 
Logical Attacks(Vulnerability Research)
Logical Attacks(Vulnerability Research)Logical Attacks(Vulnerability Research)
Logical Attacks(Vulnerability Research)
Ajay Negi
 
Creating RESTful API’s with Grails and Spring Security
Creating RESTful API’s with Grails and Spring SecurityCreating RESTful API’s with Grails and Spring Security
Creating RESTful API’s with Grails and Spring Security
Alvaro Sanchez-Mariscal
 
Ruby on Rails Security Guide
Ruby on Rails Security GuideRuby on Rails Security Guide
Ruby on Rails Security Guide
ihji
 
CNIT 129S: Ch 5: Bypassing Client-Side Controls
CNIT 129S: Ch 5: Bypassing Client-Side ControlsCNIT 129S: Ch 5: Bypassing Client-Side Controls
CNIT 129S: Ch 5: Bypassing Client-Side Controls
Sam Bowne
 
Cookies authentication
Cookies authenticationCookies authentication
Cookies authentication
Rsilwal123
 
Kerberos survival guide
Kerberos survival guideKerberos survival guide
Kerberos survival guideJ.D. Wade
 
Secured REST Microservices with Spring Cloud
Secured REST Microservices with Spring CloudSecured REST Microservices with Spring Cloud
Secured REST Microservices with Spring Cloud
Orkhan Gasimov
 
authentication.ppt
authentication.pptauthentication.ppt
authentication.ppt
AchinikeWinifred
 
Application and Server Security
Application and Server SecurityApplication and Server Security
Application and Server Security
Brian Pontarelli
 

Similar to Karmendra - Hashing, CAPTCHA's and Caching - ClubHack2008 (20)

Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...
Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...
Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...
 
CNIT 129S: Ch 7: Attacking Session Management
CNIT 129S: Ch 7: Attacking Session Management CNIT 129S: Ch 7: Attacking Session Management
CNIT 129S: Ch 7: Attacking Session Management
 
Ch 7: Attacking Session Management
Ch 7: Attacking Session ManagementCh 7: Attacking Session Management
Ch 7: Attacking Session Management
 
Authentication in Node.js
Authentication in Node.jsAuthentication in Node.js
Authentication in Node.js
 
CNIT 129S: Ch 6: Attacking Authentication
CNIT 129S: Ch 6: Attacking AuthenticationCNIT 129S: Ch 6: Attacking Authentication
CNIT 129S: Ch 6: Attacking Authentication
 
Ch 6: Attacking Authentication
Ch 6: Attacking AuthenticationCh 6: Attacking Authentication
Ch 6: Attacking Authentication
 
CNIT 129S Ch 7: Attacking Session Management
CNIT 129S Ch 7: Attacking Session ManagementCNIT 129S Ch 7: Attacking Session Management
CNIT 129S Ch 7: Attacking Session Management
 
CNIT 129S - Ch 6a: Attacking Authentication
CNIT 129S - Ch 6a: Attacking AuthenticationCNIT 129S - Ch 6a: Attacking Authentication
CNIT 129S - Ch 6a: Attacking Authentication
 
CNIT 129: 6. Attacking Authentication
CNIT 129: 6. Attacking AuthenticationCNIT 129: 6. Attacking Authentication
CNIT 129: 6. Attacking Authentication
 
Brute Force - Lior Rotkovitch - f5 SIRT v5.pdf
Brute Force - Lior Rotkovitch - f5 SIRT v5.pdfBrute Force - Lior Rotkovitch - f5 SIRT v5.pdf
Brute Force - Lior Rotkovitch - f5 SIRT v5.pdf
 
Ntu workshop : REST, PayPal APIs & Async
Ntu workshop : REST, PayPal APIs & AsyncNtu workshop : REST, PayPal APIs & Async
Ntu workshop : REST, PayPal APIs & Async
 
Logical Attacks(Vulnerability Research)
Logical Attacks(Vulnerability Research)Logical Attacks(Vulnerability Research)
Logical Attacks(Vulnerability Research)
 
Creating RESTful API’s with Grails and Spring Security
Creating RESTful API’s with Grails and Spring SecurityCreating RESTful API’s with Grails and Spring Security
Creating RESTful API’s with Grails and Spring Security
 
Ruby on Rails Security Guide
Ruby on Rails Security GuideRuby on Rails Security Guide
Ruby on Rails Security Guide
 
CNIT 129S: Ch 5: Bypassing Client-Side Controls
CNIT 129S: Ch 5: Bypassing Client-Side ControlsCNIT 129S: Ch 5: Bypassing Client-Side Controls
CNIT 129S: Ch 5: Bypassing Client-Side Controls
 
Cookies authentication
Cookies authenticationCookies authentication
Cookies authentication
 
Kerberos survival guide
Kerberos survival guideKerberos survival guide
Kerberos survival guide
 
Secured REST Microservices with Spring Cloud
Secured REST Microservices with Spring CloudSecured REST Microservices with Spring Cloud
Secured REST Microservices with Spring Cloud
 
authentication.ppt
authentication.pptauthentication.ppt
authentication.ppt
 
Application and Server Security
Application and Server SecurityApplication and Server Security
Application and Server Security
 

More from ClubHack

India legal 31 october 2014
India legal 31 october 2014India legal 31 october 2014
India legal 31 october 2014
ClubHack
 
Cyberlaw by Mr. Pavan Duggal at ClubHack Infosec KeyNote @ Bangalore
Cyberlaw by Mr. Pavan Duggal at ClubHack Infosec KeyNote @ BangaloreCyberlaw by Mr. Pavan Duggal at ClubHack Infosec KeyNote @ Bangalore
Cyberlaw by Mr. Pavan Duggal at ClubHack Infosec KeyNote @ Bangalore
ClubHack
 
Cyber Insurance
Cyber InsuranceCyber Insurance
Cyber Insurance
ClubHack
 
Summarising Snowden and Snowden as internal threat
Summarising Snowden and Snowden as internal threatSummarising Snowden and Snowden as internal threat
Summarising Snowden and Snowden as internal threat
ClubHack
 
Fatcat Automatic Web SQL Injector by Sandeep Kamble
Fatcat Automatic Web SQL Injector by Sandeep KambleFatcat Automatic Web SQL Injector by Sandeep Kamble
Fatcat Automatic Web SQL Injector by Sandeep Kamble
ClubHack
 
The Difference Between the Reality and Feeling of Security by Thomas Kurian
The Difference Between the Reality and Feeling of Security by Thomas KurianThe Difference Between the Reality and Feeling of Security by Thomas Kurian
The Difference Between the Reality and Feeling of Security by Thomas Kurian
ClubHack
 
Stand Close to Me & You're pwned! Owning Smart Phones using NFC by Aditya Gup...
Stand Close to Me & You're pwned! Owning Smart Phones using NFC by Aditya Gup...Stand Close to Me & You're pwned! Owning Smart Phones using NFC by Aditya Gup...
Stand Close to Me & You're pwned! Owning Smart Phones using NFC by Aditya Gup...
ClubHack
 
Smart Grid Security by Falgun Rathod
Smart Grid Security by Falgun RathodSmart Grid Security by Falgun Rathod
Smart Grid Security by Falgun Rathod
ClubHack
 
Legal Nuances to the Cloud by Ritambhara Agrawal
Legal Nuances to the Cloud by Ritambhara AgrawalLegal Nuances to the Cloud by Ritambhara Agrawal
Legal Nuances to the Cloud by Ritambhara Agrawal
ClubHack
 
Infrastructure Security by Sivamurthy Hiremath
Infrastructure Security by Sivamurthy HiremathInfrastructure Security by Sivamurthy Hiremath
Infrastructure Security by Sivamurthy Hiremath
ClubHack
 
Hybrid Analyzer for Web Application Security (HAWAS) by Lavakumar Kuppan
Hybrid Analyzer for Web Application Security (HAWAS) by Lavakumar KuppanHybrid Analyzer for Web Application Security (HAWAS) by Lavakumar Kuppan
Hybrid Analyzer for Web Application Security (HAWAS) by Lavakumar Kuppan
ClubHack
 
Hacking and Securing iOS Applications by Satish Bomisstty
Hacking and Securing iOS Applications by Satish BomissttyHacking and Securing iOS Applications by Satish Bomisstty
Hacking and Securing iOS Applications by Satish Bomisstty
ClubHack
 
Critical Infrastructure Security by Subodh Belgi
Critical Infrastructure Security by Subodh BelgiCritical Infrastructure Security by Subodh Belgi
Critical Infrastructure Security by Subodh Belgi
ClubHack
 
Content Type Attack Dark Hole in the Secure Environment by Raman Gupta
Content Type Attack Dark Hole in the Secure Environment by Raman GuptaContent Type Attack Dark Hole in the Secure Environment by Raman Gupta
Content Type Attack Dark Hole in the Secure Environment by Raman Gupta
ClubHack
 
XSS Shell by Vandan Joshi
XSS Shell by Vandan JoshiXSS Shell by Vandan Joshi
XSS Shell by Vandan Joshi
ClubHack
 
Clubhack Magazine Issue February 2012
Clubhack Magazine Issue  February 2012Clubhack Magazine Issue  February 2012
Clubhack Magazine Issue February 2012
ClubHack
 
ClubHack Magazine issue 26 March 2012
ClubHack Magazine issue 26 March 2012ClubHack Magazine issue 26 March 2012
ClubHack Magazine issue 26 March 2012
ClubHack
 
ClubHack Magazine issue April 2012
ClubHack Magazine issue April 2012ClubHack Magazine issue April 2012
ClubHack Magazine issue April 2012
ClubHack
 
ClubHack Magazine Issue May 2012
ClubHack Magazine Issue May 2012ClubHack Magazine Issue May 2012
ClubHack Magazine Issue May 2012
ClubHack
 
ClubHack Magazine – December 2011
ClubHack Magazine – December 2011ClubHack Magazine – December 2011
ClubHack Magazine – December 2011
ClubHack
 

More from ClubHack (20)

India legal 31 october 2014
India legal 31 october 2014India legal 31 october 2014
India legal 31 october 2014
 
Cyberlaw by Mr. Pavan Duggal at ClubHack Infosec KeyNote @ Bangalore
Cyberlaw by Mr. Pavan Duggal at ClubHack Infosec KeyNote @ BangaloreCyberlaw by Mr. Pavan Duggal at ClubHack Infosec KeyNote @ Bangalore
Cyberlaw by Mr. Pavan Duggal at ClubHack Infosec KeyNote @ Bangalore
 
Cyber Insurance
Cyber InsuranceCyber Insurance
Cyber Insurance
 
Summarising Snowden and Snowden as internal threat
Summarising Snowden and Snowden as internal threatSummarising Snowden and Snowden as internal threat
Summarising Snowden and Snowden as internal threat
 
Fatcat Automatic Web SQL Injector by Sandeep Kamble
Fatcat Automatic Web SQL Injector by Sandeep KambleFatcat Automatic Web SQL Injector by Sandeep Kamble
Fatcat Automatic Web SQL Injector by Sandeep Kamble
 
The Difference Between the Reality and Feeling of Security by Thomas Kurian
The Difference Between the Reality and Feeling of Security by Thomas KurianThe Difference Between the Reality and Feeling of Security by Thomas Kurian
The Difference Between the Reality and Feeling of Security by Thomas Kurian
 
Stand Close to Me & You're pwned! Owning Smart Phones using NFC by Aditya Gup...
Stand Close to Me & You're pwned! Owning Smart Phones using NFC by Aditya Gup...Stand Close to Me & You're pwned! Owning Smart Phones using NFC by Aditya Gup...
Stand Close to Me & You're pwned! Owning Smart Phones using NFC by Aditya Gup...
 
Smart Grid Security by Falgun Rathod
Smart Grid Security by Falgun RathodSmart Grid Security by Falgun Rathod
Smart Grid Security by Falgun Rathod
 
Legal Nuances to the Cloud by Ritambhara Agrawal
Legal Nuances to the Cloud by Ritambhara AgrawalLegal Nuances to the Cloud by Ritambhara Agrawal
Legal Nuances to the Cloud by Ritambhara Agrawal
 
Infrastructure Security by Sivamurthy Hiremath
Infrastructure Security by Sivamurthy HiremathInfrastructure Security by Sivamurthy Hiremath
Infrastructure Security by Sivamurthy Hiremath
 
Hybrid Analyzer for Web Application Security (HAWAS) by Lavakumar Kuppan
Hybrid Analyzer for Web Application Security (HAWAS) by Lavakumar KuppanHybrid Analyzer for Web Application Security (HAWAS) by Lavakumar Kuppan
Hybrid Analyzer for Web Application Security (HAWAS) by Lavakumar Kuppan
 
Hacking and Securing iOS Applications by Satish Bomisstty
Hacking and Securing iOS Applications by Satish BomissttyHacking and Securing iOS Applications by Satish Bomisstty
Hacking and Securing iOS Applications by Satish Bomisstty
 
Critical Infrastructure Security by Subodh Belgi
Critical Infrastructure Security by Subodh BelgiCritical Infrastructure Security by Subodh Belgi
Critical Infrastructure Security by Subodh Belgi
 
Content Type Attack Dark Hole in the Secure Environment by Raman Gupta
Content Type Attack Dark Hole in the Secure Environment by Raman GuptaContent Type Attack Dark Hole in the Secure Environment by Raman Gupta
Content Type Attack Dark Hole in the Secure Environment by Raman Gupta
 
XSS Shell by Vandan Joshi
XSS Shell by Vandan JoshiXSS Shell by Vandan Joshi
XSS Shell by Vandan Joshi
 
Clubhack Magazine Issue February 2012
Clubhack Magazine Issue  February 2012Clubhack Magazine Issue  February 2012
Clubhack Magazine Issue February 2012
 
ClubHack Magazine issue 26 March 2012
ClubHack Magazine issue 26 March 2012ClubHack Magazine issue 26 March 2012
ClubHack Magazine issue 26 March 2012
 
ClubHack Magazine issue April 2012
ClubHack Magazine issue April 2012ClubHack Magazine issue April 2012
ClubHack Magazine issue April 2012
 
ClubHack Magazine Issue May 2012
ClubHack Magazine Issue May 2012ClubHack Magazine Issue May 2012
ClubHack Magazine Issue May 2012
 
ClubHack Magazine – December 2011
ClubHack Magazine – December 2011ClubHack Magazine – December 2011
ClubHack Magazine – December 2011
 

Recently uploaded

Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 

Recently uploaded (20)

Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 

Karmendra - Hashing, CAPTCHA's and Caching - ClubHack2008

  • 1. Insecure Implementation of Security Practices Karmendra Kohli Director, Co-founder
  • 2. Agenda • Talk about insecure implementation of security practices for – Salted Hashing – CAPTCHA – Browser Caching
  • 3. Why do we need authentication • Abstraction of Lock and Key – Humans are used to and comfortable with the concept • Explicit Authentication happens only once – Implicit authentication with each request
  • 4. Threats to passwords • In the Host – Can be found in Memory or Browser History • Network – Can be sniffed or found in proxy logs • Database – If stored in clear-text, compromise of DB leads to complete compromise – Backup tapes etc
  • 5. Securing Credentials • Denote password by ******** in the form field – Can be guessed • Implement strong password policy – Can be stolen • Base64 Encoding – Can be decoded • Encrypting the password – Can be decrypted • Hashing the password – Our story begins from here…
  • 6. Hashing • Cryptographic Hash Function is a transformation that takes an input and returns a fixed-size string, which is called the hash value. – From Wikipedia • One way hashes cannot be reversed, they can only be compared – Just like finger prints • A strong one-way hash will have minute probability of collision
  • 7. Use of hashing • Authentication • Message Integrity • Digital Signatures
  • 8. Is just a hash secure? • Hash can be stolen from the – memory – browser history – network by sniffing – proxy logs • We can replay the hash instead of the clear text password – Does not need to be reversed for authentication
  • 9. Hash with a pinch of salt • Salted hash – Aims at implementing a one time password scheme – Each time the password of the user transmitted from the client is different – Even if stolen cannot be reused/replayed Well That Is The Aim!!
  • 10. The Working Steps 1. With each request to the login page by the user, the server generates a random number, the salt, and sends it to the client along with the login page. 2. A JavaScript code on the client computes the hash of the password entered by the user. 3. The salt is concatenated with the computed hash of the password to re-compute the hash of the concatenated string (let this salted hash be ‘A’). 4. The result i.e. ‘A’ generated in the previous step is sent to the server along with the username.
  • 11. The Working Steps 5. On the server side - the application retrieves the hashed password for the corresponding username from the database. 6. The hashed password fetched from the database is concatenated with the salt (which was earlier sent to the client) stored at the server. Hash of the concatenated string is calculated at the server (let this salted hash be B). 7. If the user entered the correct password then these two hashes (A & B) should match. The server compares these two hashes and if they match, the user is authenticated. 8. The salt is then deleted from the server side
  • 13. 1. Generating salt on client side
  • 14. Generating salt on client side
  • 15. Generating salt on client side • So we have all values that server needs to calculate the salted hash • It is enough to replay the values • Beats goal of using salts
  • 16. 2. Using a limited set of salts • The number of salts being used by the server is fixed • Above replay technique works – We just need to try multiple number of times
  • 17. 3. Using same salt for same user • In this case the salted hash was stored by the developer in the DB – Gives a ‘feeling’ of more security • If salted hash is stored as password, then salt too needs to be stored ☺ • Hence same salt is sent each time - replay
  • 18. 4. Not re-initializing the salt for login pages • Multiple logins from the same browser resulted in same salt being used • Salt not deleted from the server side on successful or unsuccessful authentication • Problem is also related to not re-initializing the session after successful or unsuccessful authentication • Attack window is small, but still…
  • 19. 5. Transmitting clear text password along with salted hash • Many implementations observed • The salted hash is sent along with clear text form input fields • The salted hash is computed using different set of hidden variables
  • 20. Transmitting clear text along with salted hash
  • 21. 6. Not re-initializing the java script variables • Uname = Document.form1.textbox1.value • Pwd = Document.form1.textbox2.value • Use the and ‘pwd’ variable for salted hash calculation – Hash = Hfx (pwd) – Hash = Hfx (Hash + salt) • The uname and pwd can be found as clear text in memory
  • 22. Not re-initializing the java script variables
  • 23. 7. Storing password in clear text in database • Hash = hash (password + salt) • Server does not store salt in the database • Clearly implies that server also does not store hash of password in database
  • 24. Salted Hash Best Practices • Salt – Generated on server side – Must be highly random. Must use cryptographically strong PRNG algorithm – Must never be stored in the database – Must be re-generated after each successful /unsuccessful attempt – All temporary Form Field or JS variables must be set to null before submitting the request • Passwords must be stored in hashed format in the database
  • 25. CAPTCHA • Completely Automated Public Turing Tests to Tell Computers and Humans Apart • Aim is to introduce an entity that requires human intervention • Protection against DOS or Brute force or Misuse – Avoiding automating submissions
  • 26. Typical uses • Public Forms – Registration – Feedback / Rating – Survey – Blog post – Appointment/Slot booking
  • 27. CAPTCHA - Implementation • Initiate a session for the page rendered • Request for image • Generate unique string randomly on server side • Generate image with string embedded • Remember the string in Session Object and send CAPTCHA to client • For each client request, validate the sent value with the one in the session object • Invalidate session after each attempt – Both successful and unsuccessful • Generate new CAPTCHA for each new page request
  • 28. Insecure Implementation • We are not focusing weakness of CAPTCHA generation – It’s a different ball game • We will discuss common implementation flaws of using CAPTCHA’s
  • 29. 1. Verifying CAPTCHA on client side • The client side JavaScript verifies the CAPTCHA value • Server trusts the decision of client strPassFlag=True; • Completely bypass enforcement • Automate submission
  • 30. 2. Having a limited set words • Small fixed pool of CAPTCHA words • Automated tools will have high probability of hits • Bypass goal of implementing CAPTCHA
  • 31. What better than a COMBO Limited pool of CAPTCHA values with client side verification
  • 32. 3. Validate CAPTCHA on server but value sent from client • Actual value of CAPTCHA sent as hidden variable – Hmmmmm, “hidden” does not mean “secure” • Replay request with value of our choice
  • 33. 4. Session is not re-initialized • Session not re-initialized after form submission • Refresh on submitted page works • Automate replay of requests using assigned session ID • Multiple registrations – Treasure trove for spammers
  • 34. 5. Image ID can be replayed • The request for image is of the form • <img src = http://www.testserver.com/image_draw.jsp?I D=23erdfret45ffrsd4g3fd3sa3a4d5a • The image_draw.jsp decrypts the value to get the word • For the same value the same word is rendered ALWAYS • Replay image request
  • 35. Image ID can be replayed Client Server Step#1: Request for Public FORM Step#2: Form with <img src=http://…/image_draw.php?id=X1> Step#4: Generate an image Step#3: Request for Image based on unique token (X1) & store in the session object. Step#5: Form rendered with image Step#7: Validation with string Step#6: FORM Submission stored in the session object. • Step 2 can be replayed
  • 36. 6. CAPTCHA is not an image • One application had a ‘feeling’ of an image • Java Script used for rendering the text on the page in a “different” font • Tools can read such text easily Text can be selected ☺
  • 37. CAPTCHA implementation best practices CAPTCHA: – Generated on server side – Verified on server side – Strings must be randomly generated – Images must not be generated based on token from ‘hidden’ client side – Must be bound to a session – Must be re-generated after each successful /unsuccessful attempt
  • 38. Caching Issues • Unauthorized access to information User Name CC No User SB Account No Logged off Password Back Submit Submit Sign In Sign Out Login Account Details Thank You
  • 39. Browser Cache • A local store – Aims to improve performance – Renders pages locally, fast user experience – Support across browsers • Controlled by a lot many directives – Pragma: no-cache – Cache-control: no-cache – Expires: Mon, 03 Jul 2000 9:30:41 GMT
  • 40. Caching • Relevant HTTP fields • Request o If-Modified-Since o Pragma: no-cache • Response o Last-Modified o Expires: Mon, 03 Apr 2009 9:30:41 GMT o Cache-Control: no-cache, no-store
  • 41. Caching • Relevant HTTP fields • Request o If-Modified-Since – Recheck for fresh content o Pragma: no-cache – HTTP 1.0 • Response o Last-Modified – Confirm fresh content o Expires: ………… – HTTP 1.0 o Cache-Control: no-cache – Pages will not be displayed, but will still be stored o Cache-Control: no-store – Pages will not be stored
  • 42. Caching best practice • For critical applications • Cache-Control: no-cache and Cache- Control: no-store must be set for ALL pages
  • 43. Example Implementation flaw • Banking application – Ideally all pages must be fetched fresh – Clicking on ‘back’ must not render page – All pages set with Cache-Control: no-cache, no-store – excepting logout page – On logout, an intermediate proxy used to serve logout page – Session was not invalidated as request did not reach server