Login
You're viewing the code4lib.social public feed.
  • Nov 10, 2026, 9:00 PM

    The (somewhat late) #eMudhra incident report just got posted (~1 hour ago).

    TL;DR: they were attempting to move the private keys cross (national) border, cross HSM vendor, due to “supply chain constraints”. To do so, they wrote a custom script (Python?) to export the key material in one format and save it in another format, which (accidentally) only captured one byte of the key. Then they failed to do anything to verify the key was correctly copied 🤦🏻‍♂️

    bugzilla.mozilla.org/show_bug.

    💬 5🔄 10⭐ 0

Replies

  • Nov 10, 2026, 9:06 PM

    Reception of the eMudhra incident report has been fairly “raises more questions than it answers” 😬 (So there’s already a bunch more questions, including again asking for the key transfer scripts, which I too would like to see.)

    Reading between the lines I’m left thinking maybe they attempted to get the first key out of a structure with:

    key[0]

    But due to the way the data was structured that actually read the first byte of the key 🤔

    If so the transfer script seems poorly audited / reviewed 😢

    💬 1🔄 1⭐ 0
  • Nov 10, 2026, 9:07 PM

    @ewenmcneill that does sound like an argument for it having been in Python, since the type you get from indexing a string is still a string -- I've seen programs make this mistake before.

    💬 2🔄 0⭐ 0
  • Gusprojectgus@aus.social
    Nov 10, 2026, 10:26 PM

    @cliffle @ewenmcneill I had the same thought, in fact the vague certainty that I have written this exact bug in Python more than once before (in less important circumstances).

    However, isn't that then a bug on a bug? Raw key data should be bytes, not a utf8 str. Indexing a bytes object in Python returns an int...

    💬 0🔄 0⭐ 0
  • Nov 11, 2026, 11:00 AM

    @cliffle @ewenmcneill that seems like a mistake more likely to occur with Python 2 than any modern versions.

    Indexing into a bytes object will give you integers, and you'd be fighting a lot of the APIs to use the string type for binary data.

    💬 0🔄 0⭐ 0
  • 💬 0🔄 0⭐ 0
  • 💬 0🔄 0⭐ 0
  • Nov 10, 2026, 11:07 PM

    @sharkfie it’s definitely possible to make an equivalent mistake in C, typically by doing sizeof() on a (byte) element instead of a whole structure, and copying too little. (With the fun C variant bug of doing sizeof() on the pointer instead of the data to copy and instead copying 4 or 8 bytes.)

    (But given their reference to “scripts” at this point I think it’s unlikely to be C.)

    💬 0🔄 0⭐ 0
  • __Miguel_nanianmichaels@tech.lgbt
    Nov 11, 2026, 8:35 AM

    @ewenmcneill I am very much not a cryptography expert, nor an expert on certificate generation.

    But from that report, and the questions it raises, I have a couple of questions:

    - Why were you trying to "beat the clock" and risk making mistakes (which were clearly made in droves) instead of doing things properly? (Kind of a rhetorical question, capitalism is most likely the answer)

    - How did you manage to avoid/sidestep what appears to be SO MANY standard key generation steps without the auditor noticing, or with the auditor going along with it? Was there even an auditor present? If so, who was it, and why are they still allowed to audit key generation ceremonies?

    - How can you implement non-standard key generation steps and skip validation that everything actually works by checking the resulting keys?

    - If you've played this fast and loose at least once, what else have you played fast and loose with?

    Of course given the report, eMudhra exiting the SSL space makes even more sense.

    💬 0🔄 0⭐ 0
  • Nov 11, 2026, 8:53 AM

    @nanianmichaels these are good questions, and if you read further down past the incident report into the follow up questions, you’ll find others asking many of them too!

    I agree based on what we’ve learned since that it’s a relief they decided to exit the CA business.

    (FWIW the “beat the clock” part seems related to getting grandfathered into some favourable CA usage rules. But their approach to trying to do so seems quite… reckless.)

    💬 1🔄 0⭐ 0
  • 💬 0🔄 0⭐ 0
  • 💬 0🔄 0⭐ 0