← Back to verifying a finding

eMudhra G3CA key compromiseOctober 2026

Guide  ·  Incident  ·  Affected software  ·  Fixes  ·  Checker rules  ·  Proof  ·  References

Flow D
A certificate inside a binary

One of four flows for verifying a finding by hand, from the original sources. Find the removed root compiled into a uv binary, and show Bun 1.4.4 holds neither its key nor its name.

About this flow

Flow D checks one FAIL line for a binary by reading the binary as data. It finds the removed root's public key and name inside uv 0.10.10, matches them to the certificate rules/iocs.csv names, and shows that Bun 1.4.4 holds neither. The only commands that run either binary are uv --version and bun --version.

The check reaches its verdict from rules in this repository. These steps rebuild the evidence for one finding from primary artifacts, so you can confirm it without trusting the checker. Setup lists the tools this flow needs.

The line being checked

On a Mac with uv 0.10.10 and Bun 1.4.4 the check printed these lines:

PASS  bun [host] found 1.4.4, fixed 1.4.4
PASS  bun [/opt/homebrew/Cellar/bun/1.4.4/bin/bun] contains no compromised eMudhra certificate
FAIL  uv [host uv] found 0.10.10, fixed 0.13.4 (vendors its own CA bundle)
FAIL  uv [~/.local/bin/uv] contains the public key of emSign ECC Root CA - G3 (removed root) as a trust anchor

The flow checks the last line.

What the steps do

Byte offsets depend on the build of each binary. The test file's offset depends on the size of the file it copies.

Step 1. Make an empty work directory

mktemp -d makes a new empty directory. Step 3 writes a hex copy of each binary into it, about twice the binary's size.

cd "$(mktemp -d)"
ls -A | wc -l
       0

Step 2. Get the root certificate

This is the same certificate and the same comparison as Flow A steps 5 and 7. crt.sh gives the certificate, and line 18 of rules/iocs.csv gives its hash.

curl -sS -o iocs.csv https://raw.githubusercontent.com/fieldse/emudhra-ca-compromise-check/v2.0.0/rules/iocs.csv
curl -sS -o root.pem 'https://crt.sh/?d=713604941'
a=$(openssl x509 -in root.pem -noout -fingerprint -sha256 | cut -d= -f2 | tr -d ':' | tr 'a-f' 'A-F')
b=$(sed -n 18p iocs.csv | cut -d, -f5)
echo "$b"
[ "$a" = "$b" ] && echo match || echo differ
86A1ECBA089C4A8D3BBE2734C612BA341D813E043CF9E8A862CD5C57A36BBE6B
match

The check searches a binary for two forms of the certificate:

root.hex holds the DER bytes as hex digits, for the search in step 4.

openssl x509 -in root.pem -outform der -out root.der
xxd -p root.der | tr -d '\n' > root.hex
sed -n 2p root.pem > line.txt
wc -c < root.der
cat line.txt
     594
MIICTjCCAdOgAwIBAgIKPPYHqWhwDtqLhDAKBggqhkjOPQQDAzBrMQswCQYDVQQG

Step 3. Write each binary out as hex

grep searches text, and the macOS grep cannot search for raw bytes. xxd -p writes each byte as two hex digits, and tr -d '\n' joins the result into one line that grep can search for a hex string.

xxd -p "$(command -v uv)" | tr -d '\n' > uv.hex
xxd -p "$(command -v bun)" | tr -d '\n' > bun.hex

Both commands read the binaries as files and print nothing.

Step 4. Search for the full certificate

The loop counts matches of the DER bytes in each hex copy and of the first base64 line in each binary.

for t in uv bun; do
  echo "$t DER: $(grep -c -F "$(cat root.hex)" $t.hex)  base64 line: $(grep -c -F "$(cat line.txt)" "$(command -v $t)")"
done
uv DER: 0  base64 line: 0
bun DER: 0  base64 line: 0

Neither binary holds the full certificate in either form.

Step 5. Search for the root's public key

The public key is stored in a certificate as its subject public key info (SPKI), a DER structure that names the key type and holds the key. openssl pkey writes it out on its own.

openssl x509 -in root.pem -noout -pubkey | openssl pkey -pubin -outform der -out key.der
wc -c < key.der
xxd -l 2 key.der
     120
00000000: 3076                                     0v

The first two bytes are its DER header:

uv's root list stores the 118 bytes without the header, and the check searches for the same 118 bytes. tail -c +3 drops the header.

tail -c +3 key.der | xxd -p | tr -d '\n' > key.hex
grep -c -F "$(cat key.hex)" bun.hex
grep -o -b -F "$(cat key.hex)" uv.hex | cut -d: -f1
0
72766028

Step 6. Cut the key out of uv and compare it

dd copies the 118 bytes at that offset. printf '\060\166' writes the two header bytes 30 76 in front, which makes a standard key file.

off=$((72766028 / 2))
echo $off
dd if="$(command -v uv)" of=carved-key.bin bs=1 skip=$off count=118 2>/dev/null
{ printf '\060\166'; cat carved-key.bin; } > carved-key.der
cmp carved-key.der key.der && echo same
openssl pkey -pubin -inform der -in carved-key.der -noout -text | sed -n '1p;$p'
36383014
same
Public-Key: (384 bit)
NIST CURVE: P-384

The project's list also identifies the key directly. Its seventh column, subject_key_identifier, is the SHA-1 hash of the key's last 97 bytes. Those bytes are the key value, without the fields that name the key type.

tail -c 97 carved-key.bin | openssl dgst -sha1 -r | cut -c1-40 | tr 'a-f' 'A-F'
sed -n 18p iocs.csv | cut -d, -f7
7C5D028413D4CC8A9B81CE171C2E291E9C486342
7C5D028413D4CC8A9B81CE171C2E291E9C486342

Step 7. Read the name stored before the key

A trust anchor pairs the key with the root's name. In uv the name sits in the 107 bytes just before the key.

openssl asn1parse shows the certificate's subject name at byte 178, with a 2-byte header and 107 bytes of content. The commands cut the 107 bytes from the certificate and from uv and compare them.

openssl asn1parse -in root.pem | grep '^ *178:'
dd if=root.der of=name-cert.bin bs=1 skip=180 count=107 2>/dev/null
dd if="$(command -v uv)" of=name-uv.bin bs=1 skip=$((off - 107)) count=107 2>/dev/null
cmp name-cert.bin name-uv.bin && echo same
tr -c '[:print:]' '.' < name-uv.bin; echo
  178:d=2  hl=2 l= 107 cons: SEQUENCE          
same
1.0...U....IN1.0...U....emSign PKI1%0#..U....eMudhra Technologies Limited1 0...U....emSign ECC Root CA - G3

The last command prints the name with each non-text byte shown as a dot. uv holds the name and key of emSign ECC Root CA - G3 next to each other.

Step 8. Cut a full certificate out of a test file

Neither binary holds the full certificate, so this step builds a test file that does. It appends the certificate's DER bytes to a copy of /bin/ls, then runs the search from step 4 on it.

cp /bin/ls control.bin
wc -c < control.bin
cat root.der >> control.bin
xxd -p control.bin | tr -d '\n' > control.hex
grep -o -b -F "$(cat root.hex)" control.hex | cut -d: -f1
  154208
308416

The match starts at hex digit 308416, which is byte 154208. That is the size of the copy before the append. The certificate's first four bytes give its length.

coff=$((308416 / 2))
echo $coff
xxd -s $coff -l 4 control.bin
154208
00025a60: 3082 024e                                0..N

The certificate is the 4 header bytes plus 590, 594 bytes in all. dd cuts them out, and openssl fingerprints the cut bytes.

len=$((4 + 0x024e))
echo $len
dd if=control.bin of=carved.der bs=1 skip=$coff count=$len 2>/dev/null
a=$(openssl x509 -inform der -in carved.der -noout -fingerprint -sha256 | cut -d= -f2 | tr -d ':' | tr 'a-f' 'A-F')
echo "$a"
[ "$a" = "$(sed -n 18p iocs.csv | cut -d, -f5)" ] && echo match || echo differ
594
86A1ECBA089C4A8D3BBE2734C612BA341D813E043CF9E8A862CD5C57A36BBE6B
match

The search from step 4 finds the certificate when a file holds it, and dd cuts it out. The same search found nothing in uv or Bun.

Step 9. Check the uv version against its advisory

uv's advisory on GitHub, GHSA-hq85-5cpj-mr62, gives the affected range and the first fixed release.

uv --version
curl -sS https://api.github.com/advisories/GHSA-hq85-5cpj-mr62 | grep -E '"(summary|vulnerable_version_range|first_patched_version)"'
uv 0.10.10 (8c730aaad 2026-03-13)
  "summary": "uv's bundled CA store trusts an emSign root whose intermediate CA keys are compromised",
      "vulnerable_version_range": "< 0.13.4",
      "first_patched_version": "0.13.4",

uv 0.10.10 is below 0.13.4, so the root found in steps 5 to 7 is the one the advisory describes.

The advisory says uv checks TLS against webpki-root-certs, a Rust crate of full certificates. uv 0.10.10 locks webpki-roots 1.0.2 instead, a crate that stores each root as a TrustAnchor of name and key, so steps 4 and 5 found the key without the full certificate.

curl -sS https://raw.githubusercontent.com/astral-sh/uv/0.10.10/Cargo.lock | grep -A1 '^name = "webpki-roots"'
curl -sS https://raw.githubusercontent.com/rustls/webpki-roots/v/1.0.2/webpki-roots/src/lib.rs | grep -A24 'Label: "emSign ECC Root CA - G3"' | grep -o -E '^ *(TrustAnchor|subject|subject_public_key_info|name_constraints)\b[^(]*'
name = "webpki-roots"
version = "1.0.2"
  TrustAnchor {
    subject: Der::from_slice
    subject_public_key_info: Der::from_slice
    name_constraints: None

Step 10. Check the Bun version against its release

Bun's release notes for 1.4.4 say it updates its root certificates to NSS 3.131.1, the Mozilla release that removed the root (Flow B). Bun's own root list holds the root at bun-v1.4.3 and not at bun-v1.4.4.

bun --version
curl -sS https://bun.com/blog/bun-v1.4.4 | grep -o 'root certificates are[^<"]*' | sort -u
for t in bun-v1.4.3 bun-v1.4.4; do
  echo "$t $(curl -sS https://raw.githubusercontent.com/oven-sh/bun/$t/packages/bun-usockets/root_certs.txt | grep -c 'emSign ECC Root CA - G3')"
done
1.4.4
root certificates are updated to NSS 3.131.1.
bun-v1.4.3 1
bun-v1.4.4 0

Bun 1.4.4 is the first release without the root, which matches the zero counts in steps 4 and 5.

Result

Each claim in Flow D rests on one of these original sources:

ClaimStepSource and what to look for
The project's list names the G3 rootStep 2rules/iocs.csv at release v2.0.0. Line 18, sha256 column: 86A1ECBA089C4A8D3BBE2734C612BA341D813E043CF9E8A862CD5C57A36BBE6B
uv below 0.13.4 trusts the G3 rootStep 9GHSA-hq85-5cpj-mr62. Affected versions < 0.13.4, patched version 0.13.4
uv 0.10.10 locks webpki-roots 1.0.2Step 9uv's Cargo.lock at tag 0.10.10. name = "webpki-roots" followed by version = "1.0.2"
webpki-roots 1.0.2 stores the G3 root as a name and a keyStep 9webpki-roots/src/lib.rs at tag v/1.0.2. Label: "emSign ECC Root CA - G3", followed by TrustAnchor { with subject and subject_public_key_info
Bun 1.4.4 updates its roots to NSS 3.131.1Step 10Bun v1.4.4 release post. "root certificates are updated to NSS 3.131.1." Archived copy
Bun's root list holds the G3 root at bun-v1.4.3Step 10root_certs.txt at tag bun-v1.4.3. emSign ECC Root CA - G3
Bun's root list drops the G3 root at bun-v1.4.4Step 10root_certs.txt at tag bun-v1.4.4. No emSign ECC Root CA - G3