microsoft / microsoft/vscode-remote-release

CANNOT Disable Credential Forwarding Git GnuPG SSH

Open
#11,014 10 comments 25 reactions 1 assignee View on GitHub

@chrmarti is already working on this.

Since Jun 11, 2025.

containers feature-request
Dominant language
Dockerfile
Stars
4.2k
Forks
469
Avg merge
1d 1h
Merged PRs (30d)
1

Description

  • VSCode Version: 1.99.3 17baf841131aa23349f217ca7c570c76ee87b957 x64
  • Local OS Version: WSL 2 (Debian Bookworm) Windows 11 x64
  • Remote OS Version: Debian Bookworm amd64
  • Remote Extension/Connection Type: Dev Containers

There is no way to disable credential forwarding to devcontainer. Not for Git, not for GnuPG, not for SSH.

The fact that this is enabled by default and there's no way to opt-out at all, it's almost a malware behavior.

These are credentials that we are dealing with, SECRETS! It's not something that should be willy nilly be touched by VSCode or any extensions for that matter.

Steps to Reproduce:

  1. Configure Git, GnuPG, and SSH in WSL 2

  2. Create a project in WSL 2 with the following devcontainer:

.devcontainer/devcontainer.json

{
    "build": {
        "dockerfile": "Dockerfile"
    }
}

.devcontainer/Dockerfile

FROM debian:bookworm
RUN apt-get update && apt-get -y install git gnupg openssh-client
RUN useradd 'dev' -ms '/bin/bash'
USER "dev"
RUN touch ~/.config ~/.gnupg ~/.ssh
  1. Open the project in devcontainer. It will clearly fail because none of ~/.config, ~/.gnupg, and ~/.ssh are folders.

Does this issue occur when you try this locally?: Yes
Does this issue occur when you try this locally and all extensions are disabled?: Yes

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.