Sandbox credential proxy leaf certificates lack Authority Key Identifier, rejected by Python 3.13+ (`VERIFY_X509_STRICT`)
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 48/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- python
- Bereich
- networking, security
Rechercherichtung
The issue identifies the credential proxy’s generated leaf certificate and CA bundle, but names no source files or tests. Start by locating the code that creates proxy leaf certificates and inspect its certificate extensions alongside the CA’s subject key identifier. Add the required authority key identifier and verify that a Python 3.13 client using strict certificate verification accepts a masked host.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
With sandboxing enabled and a masked credential (sandbox.credentials.envVars.<NAME>.injectHosts), the local credential proxy intercepts HTTPS to the inject host and presents a leaf certificate issued by CN=Copilot temporary credential proxy. That leaf has no Authority Key Identifier (AKI) extension.
Python 3.13 enables ssl.VERIFY_X509_STRICT in ssl.create_default_context() (used by requests/urllib3/httpx), which requires AKI on non-self-signed certificates. Every Python 3.13+ client in the sandbox therefore fails against masked hosts even though the generated CA bundle (SSL_CERT_FILE / REQUESTS_CA_BUNDLE) is correctly trusted:
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Missing Authority Key Identifier (_ssl.c:1029)
Practical impact: Python-based local MCP servers fail to initialize inside the sandbox as soon as their token is configured as a masked credential. The only workarounds are to stop masking the token, set sandboxMcpServers: false, or patch the client to clear VERIFY_X509_STRICT. All three weaken security.
Affected version
Copilot CLI 1.0.116
Environment
- Debian GNU/Linux 13 (trixie), kernel 6.12.117
- bubblewrap 0.12.0, slirp4netns 1.2.1
- Python 3.13.5, OpenSSL 3.5.9
copilot sandbox ca status: "OS trust is not supported on this platform … the per-process CA bundle remains active." (so OS trust is not a workaround on Linux)
Steps to reproduce
~/.copilot/settings.json:
({ "sandbox": { "enabled": true, "credentials": { "envVars": { "MY_TOKEN": { "injectHosts": ["example.com"] } } } } }MY_TOKENmust be set in the environment.)- Start
copilot, then run in the sandboxed shell tool, Python 3.13+, stdlib only:import os, ssl, socket, urllib.parse host = "example.com" p = urllib.parse.urlparse(os.environ["HTTPS_PROXY"]) for strict in (True, False): ctx = ssl.create_default_context(cafile=os.environ["SSL_CERT_FILE"]) if not strict: ctx.verify_flags &= ~ssl.VERIFY_X509_STRICT s = socket.create_connection((p.hostname, p.port), timeout=10) s.sendall(f"CONNECT {host}:443 HTTP/1.1\r\nHost: {host}:443\r\n\r\n".encode()); s.recv(4096) try: with ctx.wrap_socket(s, server_hostname=host) as t: print(f"strict={strict}: OK", dict(x[0] for x in t.getpeercert()["issuer"])) except ssl.SSLError as e: print(f"strict={strict}: {e}")
Actual result
strict=True: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Missing Authority Key Identifier (_ssl.c:1029)
strict=False: OK {'commonName': 'Copilot temporary credential proxy'}
Proxy-issued leaf (openssl s_client -proxy … -showcerts | openssl x509 -noout -subject -issuer -ext authorityKeyIdentifier,subjectAltName):
subject=
issuer=CN=Copilot temporary credential proxy
X509v3 Subject Alternative Name: critical
DNS:<inject host>
(No Authority Key Identifier, and no other extensions besides SAN.)
Proxy CA (from SSL_CERT_FILE), for reference:
subject=CN=Copilot temporary credential proxy
issuer=CN=Copilot temporary credential proxy
X509v3 Key Usage: critical Certificate Sign
X509v3 Subject Key Identifier: present
X509v3 Basic Constraints: critical CA:TRUE, pathlen:0
When the host is removed from injectHosts (no interception), the same client connects successfully to the real server certificate.
Expected behavior
Proxy leaf certificates should be RFC 5280-conformant enough to pass Python's VERIFY_X509_STRICT, i.e. include at least:
authorityKeyIdentifier(keyid = the CA's SKI). This is the extension that fails today.- likely also
extendedKeyUsage: serverAuth,keyUsage: digitalSignature(critical), andbasicConstraints: CA:FALSE, for compatibility with other strict validators.
Additional context
Python change that introduced the strict default: https://docs.python.org/3/whatsnew/3.13.html#ssl (create_default_context() sets VERIFY_X509_PARTIAL_CHAIN and VERIFY_X509_STRICT).
- Vorherrschende Sprache
- Python
- Sterne
- 11.5k
- Forks
- 2k
- Ø Merge
- 6 Std. 34 Min.
- Gemergte PRs (30 T.)
- 3
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus github/copilot-cli
-
area:plugins
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
github/copilot-cli#5567 ·
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 78/100
github/copilot-cli#5489 ·
-
Built-in functions.view returns no content for large files despite documenting automatic truncationOffenarea:tools
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
github/copilot-cli#5476 ·
-
triage
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 74/100
github/copilot-cli#5377 ·
-
area:platform-windows area:tools
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 74/100
github/copilot-cli#5340 ·
Alle Issues in github/copilot-cli
Ähnliche Issues
-
fidelity
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
backlog
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
sagemathinc/sagebrush#3434 ·
Maintainer antworten meist innerhalb von 1 Tag
-
marketing
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 1 Tag
-
documentation good first issue help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
wuisabel-gif/MemWhale#576 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Status: Triage Suggestion
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
GTNewHorizons/GT-New-Horizons-Modpack#27957 ·
Maintainer antworten meist innerhalb von 1 Tag