eMudhra TLS leak: Apple leaves macOS command-line issue unresolved | heise online

eMudhra TLS leak: Apple leaves macOS command-line issue unresolved

Browsers have long since been patched, but Apple has yet to fix cert.pem, used by various command-line tools. It does offer instructions.

listen Print view
macOS Terminal (illustration)

macOS Terminal (illustration).

(Image: Dragon Claws / Shutterstock.com)

3 min. read

Mac users who run command-line tools that rely on /etc/ssl/cert.pem to check certificates should follow Apple’s instructions to protect themselves against a major security incident at certificate authority eMuthra. The incident could allow attackers in certain network positions to impersonate servers online by breaking TLS encryption checks. In the worst case, users could be redirected to computers controlled by criminals. Apple fixed the problem server-side in the Safari browser long ago, as have nearly all other browser makers, from Firefox to Google Chrome. But the command line is a different matter. Observers are puzzled, since Apple released macOS 27.2 and other macOS updates just this week, which could have included the fix.

For now, Apple is providing instructions on how users can take action themselves. They are currently available only in English. The company says it will update the affected file “with a later software update”. Users of Apple’s Xcode Command Line Tools are affected, as are others who use various CLI tools such as curl, git, python3, ruby, perl or openssl. Some tools have their own fixes, but users must then update them manually, for example through Homebrew.

Videos by heise

It’s generally a good idea to check whether your machine is affected. To do so, open macOS Terminal and run the following command:

openssl crl2pkcs7 -nocrl -certfile /etc/ssl/cert.pem | openssl pkcs7 -print_certs -noout | grep -E 'emSign ECC Root CA - G3|AAA Certificate Services'

If the command still lists certificate authorities, they remain in /etc/ssl/cert.pem and should be removed. Apple explains how to do this manually in several steps. First, Apple recommends making a backup of cert.pem — this requires entering an administrator password:

[ -e /etc/ssl/cert.pem.orig ] || sudo cp -p /etc/ssl/cert.pem /etc/ssl/cert.pem.orig

Next, remove the problematic certificate authority:

t=$(mktemp) && awk -v s='=== /C=IN/OU=emSign PKI/O=eMudhra Technologies Limited/CN=emSign ECC Root CA - G3' '/^(===|###) /{skip=0} $0==s{skip=1} !skip' /etc/ssl/cert.pem > "$t" && [ -s "$t" ] && sudo install -m 0644 -o root -g wheel "$t" /etc/ssl/cert.pem; rm -f "$t"

You can also optionally remove another certificate authority that could — at least in theory — be used to further verify the problematic certificates:

t=$(mktemp) && awk -v s='=== /C=GB/ST=Greater Manchester/L=Salford/O=Comodo CA Limited/CN=AAA Certificate Services' '/^(===|###) /{skip=0} $0==s{skip=1} !skip' /etc/ssl/cert.pem > "$t" && [ -s "$t" ] && sudo install -m 0644 -o root -g wheel "$t" /etc/ssl/cert.pem; rm -f "$t"

AAA Certificate Services

You can then use the check command mentioned above to confirm that the affected certificate authorities have been removed. The output should be empty.

It’s unclear why Apple didn’t simply take these steps itself with macOS 27.2 and other updates by including a cleaned-up version of /etc/ssl/cert.pem. There should have been enough time. Users should therefore take action themselves and at least run the check mentioned above.

Empfohlener redaktioneller Inhalt

Mit Ihrer Zustimmung wird hier ein externer Preisvergleich (heise Preisvergleich) geladen.

Ich bin damit einverstanden, dass mir externe Inhalte angezeigt werden. Damit können personenbezogene Daten an Drittplattformen (heise Preisvergleich) übermittelt werden. Mehr dazu in unserer Datenschutzerklärung.

(bsc)

Don't miss any news – follow us on Facebook, LinkedIn or Mastodon.

This article was originally published in German. It was translated with technical assistance and editorially reviewed before publication.