Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ jobs:
- name: Test cli works in cached runtime image
run: docker run --rm tag_for_testing uvx pycowsay 'hello ubuntu-devcontainer!'

- name: Checkout the test script
uses: actions/checkout@v5

- name: Test compromised eMudhra CAs are rejected
run: docker run --rm -v ${{ github.workspace }}/tests:/tests:ro tag_for_testing /tests/emudhra.sh

- name: Log in to GitHub Docker Registry
if: github.ref_type == 'tag'
uses: docker/login-action@v4
Expand Down
39 changes: 39 additions & 0 deletions tests/emudhra.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash
# Check that this image no longer trusts the compromised eMudhra intermediate CAs.
# See https://emudhra.we-have-a-problem.com/
#
# The host serves a certificate chained through one of the compromised intermediates.
# A client that still trusts them connects fine, so a certificate verification failure
# is the PASS condition here. A failure for any other reason (DNS, network) is a FAIL,
# so a broken network cannot make this test pass by accident.
#
# Fixed by the Ubuntu ca-certificates 20260816ubuntu0.* update (system roots, used by
# curl) and uv >= 0.13.4 (updated bundled roots). Each check below fails on an image
# without its fix.
set -u

host=dv-g3b-emudhra.we-have-a-problem.com
rc=0

# curl uses the system trust store; exit code 60 is "certificate verify failed"
curl -sS -m 30 -o /dev/null "https://$host/" 2>/dev/null
if [ $? -eq 60 ]; then
echo "PASS curl rejects $host"
else
echo "FAIL curl did not reject $host with a certificate error"
rc=1
fi

# uv with its bundled roots
out=$(UV_DEFAULT_INDEX="https://$host/simple" uvx --no-cache pycowsay 2>&1)
if grep -q "invalid peer certificate" <<< "$out"; then
echo "PASS uvx rejects $host"
else
echo "FAIL uvx did not reject $host with a certificate error:"
echo "$out" | tail -5
rc=1
fi

echo "uv: $(uv --version)"
echo "ca-certificates: $(dpkg-query -W -f='${Version}' ca-certificates)"
exit $rc
Loading