Slashdot Mirror


GitHub Accidentally Exposes Some Plaintext Passwords In Its Internal Logs (zdnet.com)

GitHub has sent an email to some of its 27 million users alerting them of a bug that exposed some user passwords in plaintext. "During the course of regular auditing, GitHub discovered that a recently introduced bug exposed a small number of users' passwords to our internal logging system," said the email. "We have corrected this, but you'll need to reset your password to regain access to your account." ZDNet reports: The email said that a handful of GitHub staff could have seen those passwords -- and that it's "unlikely" that any GitHub staff accessed the site's internal logs. It's unclear exactly how this bug occurred. GitHub's explanation was that it stores user passwords with bcrypt, a stronger password hashing algorithm, but that the bug "resulted in our secure internal logs recording plaintext user passwords when users initiated a password reset." "Rest assured, these passwords were not accessible to the public or other GitHub users at any time," the email said. GitHub said it "has not been hacked or compromised in any way."

16 of 151 comments (clear)

  1. Umm... how's this possible? by Opportunist · · Score: 4, Insightful

    How can a clear text password be available to them at all to record it in a log?

    --
    We used to have a Bill of Rights. Now, with the rights gone, all we have left is the bill.
    1. Re:Umm... how's this possible? by Opportunist · · Score: 4, Insightful

      What should happen is that a hash gets calculated on client AND server side, you don't want to store the client's hash directly in the database... for obvious reasons.

      --
      We used to have a Bill of Rights. Now, with the rights gone, all we have left is the bill.
    2. Re:Umm... how's this possible? by TheRaven64 · · Score: 4, Insightful

      If you hash on the client, then you're not really hashing, you're just using a different password and the thing in your database is now the real password, because that's what the client presents to log in. If you really want to do it properly, there are zero-knowledge protocols that allow it, but simply hashing on the client is not sufficient.

      --
      I am TheRaven on Soylent News
    3. Re: Umm... how's this possible? by art123 · · Score: 4, Interesting

      Every single web site you use including Slashdot, Gmail, etc etc has the plain text password available to the server. The hashing of the password with a salt runs on the server. This Github bug was simply that a developer wrote the plain text password to a log file during the authentication process. They didnâ(TM)t store the plain text password in a database.

    4. Re:Umm... how's this possible? by DonkeyG5 · · Score: 3, Funny

      <noscript>This website requires Javascript enabled in your browser, you fucking twat. Please enable it and try again. If you don't wanna enable Javascript you can go and fuck yourself with a cactus.</noscript>

      Problem solved.

    5. Re:Umm... how's this possible? by TheRaven64 · · Score: 2

      There are a couple of reasons, but the main one is that if you're able to run code on both the client and server then there are much smarter ways of doing this. The simplest way is to store a public key on the server and store the corresponding private key on the client. Then the server sends some data to the client, which encrypts it with the private key and sends it to the server, which decrypts it with the public key. If the encrypted data matches the data provided by the server, this proves that the client has the private key. There are more complex protocols, such as the Secure Remote Password protocol that do something equivalent to this but using a password rather than a stored private key. The basic idea is the same: you send something that proves that you have the password, not the password itself.

      In most cases on the web, it's usually because you want to support browsers with JavaScript disabled, so you must support a simple submit-the-password-via-a-form mechanism. That may change as the WebAuthn standard becomes more widely deployed.

      --
      I am TheRaven on Soylent News
    6. Re:Umm... how's this possible? by beelsebob · · Score: 2

      Double hashing does effectively nothing useful. The correct solution if you don't trust that the tunnel is encrypted is to use a zero knowledge password exchange protocol like SRP.

    7. Re: Umm... how's this possible? by lgw · · Score: 2

      Let's say your password is X, and you hash it locally to Y. You still have to send Y to the server to be validated. There's no way around this.

      You don't ever need to send the password, X or Y, if you can depend on running some JS on the client: just use a zero-knowledge proof of identity. However, it's pointless overkill, as man-in-the-browser attacks are more common than MITM attacks these days. Complicated login approaches don't really help against the common attack, so there's little point in getting clever - just make sure you're using HTTPS and POST not GET.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    8. Re: Umm... how's this possible? by lgw · · Score: 2

      Protip: when you don't understand the words being used in the post you're responding to, you might develop the habit of looking them up, rather than continuing to demonstrate your ignorance.

      FFS, at least understand what a replay attack is, and what a non-replay-able protocol is, before wittering on about them.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    9. Re: Umm... how's this possible? by fisted · · Score: 2

      This entire thread is a fucking trainwreck but your comment takes the cake. Hashing with a key?! Hashing locally and sending the hash to the server so that it compares hashes? Then your hash is the damn password and you're back at sending your password to the server, who stores it in plaintext. Yay.

  2. Password reset by gringer · · Score: 3, Insightful

    the bug "resulted in our secure internal logs recording plaintext user passwords when users initiated a password reset."

    ...

    "We have corrected this, but you'll need to reset your password to regain access to your account."

    Er... are you really sure that this has been corrected?

    --
    Ask me about repetitive DNA
  3. DO NOT USE HASH!!!! by DrYak · · Score: 4, Informative

    you feed the string and the salt into an encryption algorythm like sha512 which produces a HASH this is what gets stored

    Argh!
    No!
    NO!!!
    NO-NO-NO-NO!!!!
    DO NOT USE HASHES ! (like Sha512).

    These are designed to be *fast* (1), meaning that it could be not impossible for an attacker to guess the password out of the hash simply by brute forcing all the most common password and variations thereof into the same salt and see if they match.

    (1 - And remember that the "tera hash" that ASIC bitcoinminer are reporting are exactly that : trillion of SHA256-like computation per second.)

    USE KEY-DERIVATION FUNCTIONS (KDF) INSTEAD !

    Like the Bcrypt use by github as mentionned in the summary. Or Scrypt (same used by tarsnap). Or Argon2. etc.
    These also produce a value out of a password and a salt, but they are on purpose extremely slow (E.g.: by repeating a hash function over and over for a high number of iteration).
    If each computation takes some time, it doesn't impact login that much (After all, you only need to log in once at the beginning of your session), but it hinders anyone wanting to brute force your password out of a stolen hash.

    It makes data breaches that managed to steal your user database a lot less dangerous (because once you have successfully guessed the password from the hash, the next step is to see all the other places where the user has re-used the same password).

    --
    "Sufficiently advanced satire is indistinguishable from reality." - [Tips: 1DrYakQDKCQ6y52z6QbnkxHXAocMZJE61o ]
  4. Re:How did this happen? by Big+Hairy+Ian · · Score: 2

    3) you feed the string and the salt into an encryption algorythm like sha512 which produces a HASH this is what gets stored

    Except sha512 is a hashing algorythm not an ecryption algorythm.

    --

    Build a Man a Fire, and He'll Be Warm for a Day. Set a Man on Fire, and He'll Be Warm for the Rest of His Life.

  5. Stored in the data base by DrYak · · Score: 5, Informative

    So how is this "random salt" recovered when you need to check the password's validity?

    It's stored along in the data base.
    Most stored password have a form like :

    ${type of algorithm used}${parameters used}${data}

    where:
    - "type of the algorithm used" tell you what was used to generate this (e.g: using Bcrypt, like GitHub as mentioned in the summary).
    - "data" is the actual salted-output that you need to replicate to successfully log-in
    - "parameters" is any extra-data that the algorithm needs to generate password checks.
    Like the salt.
    Or like the number of iterations. Because nobody sane actually use a hash function such as SHA512 anymore. Instead you use a Key Derivation Function (KDF) such as Bcrypt (or Scrypt or Argon2) and those are *slow* on purpose, to make brute-forcing much less likely (e.g.: they slow down by repeating a hash for large number of iterations).

    The exact implementation vary (the above is typically used by the "crypt" function used, e.g., on Linux log-ins),
    but basically are the same : the salt (and iterations) are stored together with the "hash" that you need to test.

    And most of the KDF function can work as "hash_to_compare = KDF(password_login_attempt, old_hash_from_database)", ie.: they can automatically extract the parameters if you give them the string that is in the database, and generate the hash the exact same way.
    They'll invent a new salt (and guess the optimal number of iterations) only if you omit the old hash and give the new password as the single parameter.

    --
    "Sufficiently advanced satire is indistinguishable from reality." - [Tips: 1DrYakQDKCQ6y52z6QbnkxHXAocMZJE61o ]
  6. Re:How did this happen? by TheRaven64 · · Score: 4, Insightful

    The salt isn't secret, it's just used to prevent rainbow tables from being useful. If you store passwords as unsalted hashes, then an attacker can construct a large table of all of the hashes of 8-character inputs and compare each of your hashes against their table. If there's a match, then they have a password that will work. If you add a salt, then they can't use such a table, because they have to check each 8-character sequence with the hash prepended. If the salt is different for each password (as it should be), then there's no benefit from pre-calculating the table. If it takes 2 hours of GPU time to compute the table, then with unsalted passwords that's a one-time cost and you can then crack any weak password in a leaked password database almost instantly. In contrast, it will take you 2 hours to attempt each password and crack each weak one in a leaked salted password database.

    --
    I am TheRaven on Soylent News
  7. Basic auth no worse than input type=password by tepples · · Score: 2

    Basic auth is an HTTP header, and HTTP headers are just as protected by TLS as response headers and bodies. Otherwise, HTTPS would be ineffective against Firesheep-style attacks that clone a session cookie. The other common means of authentication is submitting a password that has been entered into a field of an HTML form as part of an HTTP POST request body. What's any more "in the clear" with HTTP basic authentication than with the form route?

    And in case you believe both forms and basic authentication ought to be replaced, what other means would you prefer? I can think of three, each with serious drawbacks:

    HTTP Digest authentication This does hashing using a random initialization vector. However, it requires the server to store the password rather than only an irreversible hash for verification. Some zero-knowledge proof means Because this is not built into the HTML5 standard, it requires running script in the browser. Though web browsers by default run all scripts, many users change this for security and data cap reasons. Extensions exist to restrict script execution to a domain whitelist (JavaScript Switcher), a fine-grained whitelist (NoScript), or only those scripts whose source code is machine-readably available to the public under a free software license (LibreJS). Some go so far as to regularly browse the web with all scripts turned off. Client certificates TLS supports the use of a client certificate that identifies a user, which is exactly analogous to key-based authentication in SSH. However, browser publishers have thus far given no significant attention to usability of common use cases, such as choosing the right client certificate for a particular origin, synchronizing client certificates across devices that a user uses, or even something as simple as logging out.