Giter VIP home page Giter VIP logo

gabi's People

Contributors

bobhageman avatar confiks avatar davidv1992 avatar dependabot[bot] avatar ivard avatar kidandcat avatar leonbotros avatar mhe avatar sietseringers avatar synaptic-cleft avatar weichweich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gabi's Issues

Weak timing side-channel due to Exp/Mul/Gcd

In go neither of modular exponentiation, multiplication nor gcd are constant time, and thus they can aid an attacker at recovering sensitive information.

In gabi in most instances there is a random element in the functions using the non-const time arithmetic, thus if an attacker is only able to invoke and measure the gabi function (for example over the network), they all have considerable noise due to the random elements and most of the time their sample size is limited to one, since the random element is unique for each invocation. Thus such an attacker has a negligible chance of succeeding. However an attacker that is hosted on the same CPU and can do more precise measurements only targeting the exp/mul/gcd without the added noise around them, has a good chance of exploiting this. It is thus recommended to implement (and possibly upstream) const-time exp/gcd arithmetic.

One instance of timing sensitive mul is when the modulus n is being computed from the issuers secret key q' and p' by multiplying them. Since these two values are not needed for anything else, it is recommended to replace them with the calculated value of n and thus eliminate the multiplication of them and storing them altogether.

Sensitive information is not protected

The secret key of the issuer, the private attributes of the prover are not protected in RAM from being swapped to disk and they are not sanitized after they are not needed anymore, and thus they can linger for an attacker with a appropriate info leak vulnerability to extract this information. It is recommended to use memguard https://spacetime.dev/memory-security-go - to store all sensitive information and to limit any kind of exposure to info leaks.

Keyshare server introduces new security issues

  1. The keyshare server can sample statistics about the times a user shows credentials and track the users IP address'
  2. The keyshare server can act as a target for Denial of Service for all IRMA users.

User Statistics

Each user has one "record" stored at the keyshare server and this record is accessed every time the user shows their credentials. Thus even a honest-but-curious server can learn when a user shows their credentials. In the worst case this can lead to time correlation attacks and break anonymity/unlinkability. Furthermore the keyshare server learns the IP address of the user.

Target for Denial of Service attacks

The keyshare server breaks decentralization of the protocol and acts as a possible target for DoS attacks which will have as a result that none of the users will be able to show their credentials.

Private key is world read/write

In ./gabi/keys.go func (privk *PrivateKey) WriteToFile() writes privkey to file, permissions are not set at all, or to 0666 which is very lax.

Recommendation: change the access rights to 0600.

Public keys are world-writeable

In file keys.go:315 in the function func (pubk *PublicKey) WriteToFile(filename string, forceOverwrite bool) (int64, error)

    os.OpenFile(filename, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0666)

This makes it trivially easy for an attacker to change the public keys to some values controlled by them.

Recommendation: change this to 0644.

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.