Change:
The new "security.allowedUNCHosts" in 1.78.1 setting breaks our workflow. We edit a lot of files on a lot of UNC hosts (around ~3k hosts per user, many users). How can the feature be disabled or all/regex hosts be allowed? Alternatively, we could try to add all our UNC hosts. The list ist around 5mb (now) and changes on a hourly basis - editing this manually is nonsense, but neither nor allows for centralized (and realtime) management. Using a match pattern like 10.2.. or (.).* would be our preferred method.
We currently do not support glob patterns for UNC paths, specifically because of the security attack: every UNC host name must be individually and explicitly. Every UNC path that is allowed exposes a risk of disclosing information as outlined by
The current state of this is completely unmaintainable. Having to enter every single server to browse to is not realistic. I use VS Code multiple times a day to open to files on servers. There should be a way to either provide a wildcard or disable this allowing people to accept the risk.
For those unable to view the content of their folder in . In JSON settings, I : This can be found in the following link: After rebooting VSCode, the changes will take effect and the folder's content will be viewable again.
I second 's comment. I have the same problem here. Also, I tried to list the most used servers and IP addresses, but I still get the warning when opening a file. Is there a special format for the entries? Couldn't find any examples. My settings file looks like this: "security.allowedUNCHosts": [ "ABC", "10.1.2.3", "DEF" ] EDIT: Got it: I put server names like "ABC" (upper-case) into settings, but it seems it has to be like "abc" (lower-case) Still just a temporary workaround...
is right and we do understand the risk of this Information Disclosure Vulnerability. UNC retrieval and meta data access (... NTLM delegation ...) is a hot mess in Windows anyway. We need a way to be able to "willingly accept this risk". In a closed environment like ours (telko stuff) the risk is more a theoretical one anyway. So a "disable" setting or "enable glob patterns", if global matching is "not enough", would be extremely helpful.
I am going to stop using VS Code if this issue is not resolved.
Hello, I did have a question here as to why the environment variable did not work "NODEUNCHOST_ALLOWLIST", but after making sure all running "" process were killed, it worked. So I guess, also make sure there are no running "" process while one is making these changes to test. So far.. all good now.
I didn't really want to start a new issue just for this comment, but this really just breaks the WSL integration experience. I develop from my Windows OS on files inside my WSL2 VM. Previously, the experience was seamless in being able to open files from the WSL2 environment. Now instead of working by default, I have to allow wsl.localhost? That seems like an unnecessary security impediment for very little security gain. Please add wsl.localhost to the allowed list by default.
this update broke everything
This is absurd and completely broke our workflow, Microsoft you need to be better.
At the minimum, It would be good to see this as a button prompt like you get for specific workspaces. A button to Trust the location. Which, isn't that really the same thing?
This has completely broken our workflow and required us to make an emergency change to another editor to continue working. While we would love to continue using VS Code, we cannot return to using it until something is changed with this implementation. Ideally the option to disable this would work best, perhaps even an opt-in/out on first launch, but other means to mitigate it would be welcome in the short term at least. Seeing as this breaking change was implemented quickly, an update to the behavior can come just as swiftly.
Not exactly related to the topic, but I think in any case this change regarding UNC path issue should be very carefully designed and visibly announced and notified to end users. I just spent an hour figuring out why many extensions that are critical to my workflow stopped working, including the built-in TypeScript language service (it keeps crashing). Turns out these extensions cannot access any UNC path in any way (whether introduced by user configuration, or because the text file itself is actually using UNC path). I only accidentally discovered the cause when I tried to explicitly open a text file on a UNC path and saw an "allowed host" warning and was able to track it down. Even though there is a page that explains the issue, that is far from complete -- after adding our "main" host to the allowed host list, the TS server still keeps crashing, and there is nothing in the TS server log that says anything. I ended up finding that TS server tries to use the "real path" (also mentioned in ) for some files which end up having a hostname different from the "main" one. This is a hostname that user never directly interacts with on the daily basis. I got it from the console of developer tools by using "Toggle Developer Tools" (and alternatively log of "Extension Host" in "Output" window), and did it only because I had some experience there. Do you expect every developer to do this? I consider myself an expert VSCode user and developer (I have explored a lot of the codebase, written several VSCode extensions and language clients/servers and have done a ton of customization), and if it takes me an hour to understand what is happening to resolve all the issues, it will only take other people a much longer time to figure this out.
for those of you. still get message error. try to open your file from visual studio code. after that add code like this for example i have two diffrent path: add symbol $ in the end of that path. after that save it.
I am connecting remotly by default to //GIOVANNI but it still wont work even with the setting set on both ends (local VSCode and remote ) ! ! What am I doing wrong?
No it does not. Do i need to add something else like my local domain () or something? I also dont know how to access VSCode logs ...
This "fix" just complicated me life way too much. (and my coworkers) Not the best solution. But it worked for us. Roll back to 1.77.3, disable auto update and wait for MS to give us a working solution.
Guess you will need a local mapping to the drive first to access to remote file server..
What worked for me was to write the server name exactly the same as in the UNC warning message, and one entry for each syntax I use. In my case, it was both FILESERVER and FileServer, without any prefix nor suffix symbol.
I am doing the same. Was about to go back to Sublime.
Unfortunately this is also what I have done.
It was solved with this: Shift + p settings (UI) item .localhost I hope you can solve your problem!
I just wanna leave comment in disagree with this uncontrollable update. Some new troubles right before passing done work to my boss in the morning - nice big thank you!
I've just updated, got annoyed, and now reverted to 1.78. I have a few servers (not hundreds) and no way am I going to list all in VSCode just for some file editing maybe once a day. Windows uses UNC paths all the time, and (when configured properly) that doesn't come up with warnings. Need an option to add regex, or wildcard, or just accept the Windows domain trusts - no expert, but assume that can be found and used. Or, something that would go towards helping users is a "Add to exception" button on the warning popup, rather than just yes and no. For reference, this version works fine:
We will push a change to disable UNC access restrictions. This will be behind a setting and/or a new environment variable.
I'd love to see how many hits the 1.78.0 download link has gotten in the last 24 hours compared to a few weeks ago. This breaks our workflow as well since a lot of our code is on SMB file servers. Will be using 1.78 until this update gets pushed and documented.
Does anyone know if 1.78.2 fixed this issue or is it randomly happening to users? I have a Co-Worker using 1.78.2 and he can open files from the server with no issues. I am still on 1.77 and do not want to deal with the hassle of uninstalling 1.78.2 if the issues still persist for some users.
I do agree that the user should be given a button or something to opt-out of UNC security fix and accept "risk".
I noticed that 1.78.2 do have a boolean configuration (security.restrictUNCAccess) to disable the UNCAccess ! This issue can be closed then.
We still need an upstream change before this will work. We plan for having it for our next stable release early June.
I find it concerning that it is going to take so long for a proper fix for this issue to be implemented and make its way into the live environment. Though even the current changes appears to be only a half measure and not a true proper fix. After the relatively short turnaround time for a massive breaking change to have been implemented and pushed live, I would have hoped for a faster resolution here. Being able to open a UNC path file is a basic feature that any file editor from Visual Studio down to even basic Notepad supports out of the box, but now VS Code seemingly can't support that by default? To me at least, it seems baffling that VS Code will not be able to do this anymore as the previously mentioned change will also still default to UNC being blocked. ! This type of sudden breaking change with no warning has unfortunately eroded a significant amount of confidence we once had in VS Code for being a primary tool in our workflows.
the change for blocking UNC paths in VS Code is a response to a severe security vulnerability and was done after careful and long discussions in our team. Please see for more information.
I just read the information disclosure vulnerability. If I understand correctly, one of my servers would have to be compromised, plus I would have to download and run an unknown/malicious EXE from one of my shares for this to be a thing. We are developers, and we're not careless enough not to run a random EXE that we don't recognize or trust. Not running an unknown application should be part of Internet common sense 101. If one of my servers are compromised I've got way bigger problems on my hands than whether or not VS Code will allow me to connect to my SMB shares. Come on guys, just remove this feature. Or at least show the user a dialog to let them decide whether or not they want you to hold their hand.
I was thinking the exact same thing. We have an entire team devoted to security and servers. If there is something malicious on our servers we have much bigger problems than VS code. I can still open up files on my server with The Enterprise Version of Visual Studio. How come Visual Studio allows it but not VS Code? I can do way more Damage with Visual Studio than VS Code. This seems like a knee jerk reaction with VS Code.
The fix for this change will go out at the end of this week in our insiders build [1] and early June in stable build. A new setting can be used to disable the UNC access checks. [1] Insiders builds normally release every day but are currently on-hold given the MSBuild conference that takes place.
Thank you. This worked great.
Many settings in VS Code take effect immediately. Why do you have to restart (closing everything you already have open - remote connections, debug sessions...) in order to add a server to the allow list?
This setting is driving me crazy! Let us disable it please.
Thank you this saved me tonight trying to find which version I had to go back to.
It's already June, when will the update roll out? I don't want to click "Yes" tens of times whenever I start VSCode anymore Or anyone has suggestions of better tools that won't just break your workflow without any warning like this?
Looks like the UNC security stuff is still enabled by default in 1.79.0. You'll have to manually go to settings on every VS Code install that you use and turn it off. I prefer VS Code's log file syntax highlighting over other text editors, and I have it installed on a bunch of machines just to view log files. 99% of the files we work with are on SMB shares. It's frustrating but at least we can disable the setting now. Find the "Security: Restrict UNCAccess" setting and uncheck it. And of course restart VS Code. Reminds me of the days of Win95 when you had to restart the whole machine every time you changed a setting. I hope future VS Code updates don't reset it back to default.
Still broken in 1.79.1, neither setting or adding hostnames/IP addresses to works. It seems like having a working way to add allowed hosts should have been a pre-requisite to disabling UNC, even if it's a critical security issue, not being able to use VSCode with any UNC paths is also a big issue. Edit: I have restarted several times, and tried various combinations of case for the hostnames, as well as adding $, etc.

Discussion:
disturl "https://electronjs.org/headers" <del> target "22.3.5" </del> <ins> target "22.3.10" </ins> runtime "electron" build_from_source "true"

}); } exports.config = { <del> version: product.electronRepository ? '22.5.2' : util.getElectronVersion(), </del> <ins> version: product.electronRepository ? '22.5.3' : util.getElectronVersion(), </ins> productAppName: product.nameLong, companyName: 'Microsoft Corporation', copyright: 'Copyright (C) 2023 Microsoft. All rights reserved',

}; } async function main(arch = process.arch) { <del> const version = product.electronRepository ? '22.5.2' : util.getElectronVersion(); </del> <ins> const version = product.electronRepository ? '22.5.3' : util.getElectronVersion(); </ins> const electronPath = path.join(root, '.build', 'electron'); const versionFile = path.join(electronPath, 'version'); const isUpToDate = fs.existsSync(versionFile) && fs.readFileSync(versionFile, 'utf8') === `${version}`;

} export const config = { <del> version: product.electronRepository ? '22.5.2' : util.getElectronVersion(), </del> <ins> version: product.electronRepository ? '22.5.3' : util.getElectronVersion(), </ins> productAppName: product.nameLong, companyName: 'Microsoft Corporation', copyright: 'Copyright (C) 2023 Microsoft. All rights reserved',

} async function main(arch = process.arch): Promise<void> { <del> const version = product.electronRepository ? '22.5.2' : util.getElectronVersion(); </del> <ins> const version = product.electronRepository ? '22.5.3' : util.getElectronVersion(); </ins> const electronPath = path.join(root, '.build', 'electron'); const versionFile = path.join(electronPath, 'version'); const isUpToDate = fs.existsSync(versionFile) && fs.readFileSync(versionFile, 'utf8') === `${version}`;

"git": { "name": "electron", "repositoryUrl": "https://github.com/electron/electron", <del> "commitHash": "0b17a201195ae6445e11cee50e436a3511717600" </del> <ins> "commitHash": "b07f2f0f42a1483cd2e5ec8fa3c77ebaa0507069" </ins> } }, "isOnlyProductionDependency": true, "license": "MIT", <del> "version": "22.3.5" </del> <ins> "version": "22.3.10" </ins> }, { "component": {

"cssnano": "^4.1.11", "debounce": "^1.0.0", "deemon": "^1.8.0", <del> "electron": "22.3.5", </del> <ins> "electron": "22.3.10", </ins> "eslint": "8.36.0", "eslint-plugin-header": "3.1.1", "eslint-plugin-jsdoc": "^39.3.2",

resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.207.tgz#9c3310ebace2952903d05dcaba8abe3a4ed44c01" integrity sha512-piH7MJDJp4rJCduWbVvmUd59AUne1AFBJ8JaRQvk0KzNTSUnZrVXHCZc+eg+CGE4OujkcLJznhGKD6tuAshj5Q== <del> electron@22.3.5: version "22.3.5" resolved "https://registry.yarnpkg.com/electron/-/electron-22.3.5.tgz#a53a318cbb25a44914dfedd30a9ad6120632197f" integrity sha512-CTdnoTbO3sDiMv47TX3ZO640Ca57v1qpiqGChFF8oZbtfHuQjTPPaE4hsoynf22wwnBiyJNL41DpB/pfp9USnA== </del> <ins> electron@22.3.10: version "22.3.10" resolved "https://registry.yarnpkg.com/electron/-/electron-22.3.10.tgz#bf2b98fbb452f41b057ffcd4e57678e363f9735c" integrity sha512-gh7PtSh+rfxHfM4dzPiEO+k1NRo07FvaK/jXG3HzuODrpTTEhC9rsE+AJGrTKQU6Nz7GorseMvnvs8PnUQPPTw== </ins> dependencies: "@electron/get" "^2.0.0" "@types/node" "^16.11.26"