Giter VIP home page Giter VIP logo

volley-public-key-pinning's Introduction

Public Key Pinning with Android Volley library

How to use

Change "SECURE_URL" and "PUBLIC_KEY" fields to your secure url and your server public key. That's all.

Tip: How to find Public key url

  • Set your url
  • Put a breakpoint to line 55 of PubKeyManager.java file and run your app
  • Value of "encoded" string is your public key.

Source: https://www.owasp.org/index.php/Certificate_and_Public_Key_Pinning

volley-public-key-pinning's People

Contributors

faruktoptas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

volley-public-key-pinning's Issues

Potentialy vulnerable to CVE-2016-2402

According to this blog post this demo have a security vulnerability:

The Github project Public Key Pinning with Android Volley library shows how you setup an SSLSocketFactory to pin against the SPKI however suffers from security issues such as using the certificates returned by the server without cleaning those first, as outlined above for HttpUrlConnection.

So it seems the this demo is vulnerable to certificate injection in the chain, by a MitM attack, during the handshake phase, thus rendering certificate pinning useless, once is not using a clean chain, but instead the raw chain it received from the handshake.

Another blog post from the author that disclosed this type of vulnerability in the OkHttp library, the CVE-2016-2402, says that we should instead use net.http.X509TrustManagerExtensions.checkServerTrusted():

If implementing this on Android, there are a few new APIs that can help, such as: net.http.X509TrustManagerExtensions.checkServerTrusted(). This returns the clean chain, however it is only available on devices running Android 4.2 or newer.

And this seems to be the same exact approach used by TrustKit for Android.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.