Windows: existing UNC paths are denied by content exclusion on 1.0.114 (regression from 1.0.108)

未关闭
#5,586 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
领域
security

调研方向

The report identifies content exclusion preflight as the failing area, but names no source files or tests. Start by tracing how Copilot CLI classifies paths for content exclusion on Windows, then compare handling of the drive-letter and existing UNC forms and review related issue #5521. Done when unmatched UNC paths receive the same exclusion decision as the equivalent drive-letter path, with regression coverage for the reported cases.

由索引模型根据 Issue 内容生成。

描述

area:permissions area:platform-windows
Describe the bug

On Windows, Copilot CLI 1.0.114 rejects shell tool calls that reference an existing UNC path during preflight, with:

Access denied: "\\localhost\C$\Temp\plain" is excluded by organization content policy. Do not attempt to access this file.

No configured exclusion rule matches these paths. The same folder accessed via its drive-letter path (C:\Temp\plain) is allowed in the same session. A UNC path to a non-existent host is also allowed. The denial happens before PowerShell starts (no shell ID or exit code is recorded), so Windows/SMB permissions are never involved. The user can open the same network folders in File Explorer.

The same organization policy did not produce these denials on 1.0.108. This looks like a regression in how 1.0.114 classifies Windows UNC paths for content exclusion, and it may be related to #5521 (Perforce //depot/... paths misclassified as UNC paths on Linux, also 1.0.114).

Affected version
GitHub Copilot CLI 1.0.114-unstable.r45286541461.g05667ac (via VS Code 1.148.0, Windows x64)

Not reproduced on 1.0.108-0 (also via VS Code, Windows x64).

Steps to reproduce the behavior
  1. Use Windows with an organization account that has content exclusions enabled. Both machines below log [ContentExclusionService] Loaded 2 exclusion rule(s) for 1 repo(s), and the rules are for an unrelated repository.
  2. Create a local folder: New-Item -ItemType Directory -Force C:\Temp\plain
  3. Ask Copilot to run each command below through its PowerShell tool, as separate tool calls:
Command 1.0.114 result
Test-Path -LiteralPath 'C:\Temp\plain' allowed (True)
Test-Path -LiteralPath '\\localhost\C$\Temp\plain' (same folder via UNC) denied (code denied)
Test-Path -LiteralPath '\\nonexistent-host.invalid\share\plain' allowed (False)
Test-Path -LiteralPath 'C:\Temp\SAV\x' (local control) allowed (True)

On 1.0.114, an existing directory on a corporate DFS share and its parent folder were both denied with the same message. The user can open both in File Explorer.

On 1.0.108-0, a different machine using the same organization policy could list that same corporate share directory through the PowerShell tool. Test-Path '\\localhost\C$\Temp', Test-Path '\\nonexistent-host.invalid\share\plain' and Test-Path 'C:\Temp\SAV\x' were also allowed. Caveat: on 1.0.108 the PowerShell sandbox was disabled for these runs. With it enabled, every command failed earlier with an unrelated Invalid sandbox host rule error. The sandbox state of the 1.0.114 machine was not recorded.

Expected behavior

UNC paths that don't match any configured exclusion rule should not be denied. The same folder should get the same decision regardless of whether it's referenced by drive letter or UNC path.

Additional context
  • In the session log, the preToolUse hook completes without a decision or output before each denial. The tool result carries error code denied.
  • In the 1.0.114 process log, no ContentExclusion, rt_git, or denied lines appear around the local, allowed calls. Process log lines around the denied UNC calls have not been collected yet.
  • git -C '\\localhost\C$\Temp' rev-parse --show-toplevel (and the \\?\UNC\localhost\C$\Temp form) returns the normal not a git repository result, the same as for C:\Temp, so repository discovery via git does not appear to fail on these paths.
主要语言
Python
星标
11.5k
派生
2k
平均合并
6 小时 34 分钟
30 天内合并 PR
3

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/copilot-cli 的其他 Issue

查看 github/copilot-cli 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。