You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Address code review: security, timeout, and error handling
Four fixes from code review:
1. Token exfiltration prevention: require wss:// (reject cleartext ws://)
and restrict tunnel hosts to *.devtunnels.ms. The GitHub auth token
is only sent to known-good tunnel domains.
2. Token no longer in DebugConfiguration: store the access token in an
extension-private Map keyed by a one-time nonce. The nonce is placed
in the configuration (readable by other extensions) but the token
itself is consumed and deleted on first use in the factory. Other
extensions can never read the token from session.configuration.
3. Connection timeout: add a 30s timeout to the WebSocket connect. If
the handshake stalls (proxy, firewall, DNS), the socket is
terminated and the promise rejects with a clear error.
4. ws.send() error handling: wrap send() in try/catch. On failure, fire
a DAP terminated event and dispose the adapter so the debug session
tears down cleanly instead of leaving the extension host in a bad
state.
Co-authored-by: Copilot <[email protected]>
0 commit comments