Skip to content

Workspace skill descriptions can alter customization-index structure and suppress external-file confirmation #327467

Closed

Description

@sricursion
  • Copilot Chat Extension Version: 0.59.0
  • VS Code Version: latest main, commit dd862885ff5fbd279747c793e18105e6b7ddc805
  • OS Version: Windows 11 10.0.26200 build 26200
  • Feature: Agent mode, workspace skills, ReadFile tool
  • Selected model: No live model is required for the deterministic test
  • Logs: Local unit-test output only; no production service was contacted

Summary

A workspace skill description is inserted into the XML-like chat customizations index without structural escaping. The generated text is later parsed back into instruction and skill file sets used by the external-file ReadFile confirmation logic.

As a result, delimiter characters in workspace-controlled skill metadata can alter the generated index structure and cause an outside-workspace URI to be classified as an instruction file. ReadFile then omits the confirmation that the safe control receives.

Steps to Reproduce

  1. Check out commit dd862885ff5fbd279747c793e18105e6b7ddc805.
  2. Create a workspace SKILL.md whose valid frontmatter description contains XML delimiter characters that terminate the generated description element and introduce a synthetic instruction/file record.
  3. Build the customizations index through AutomaticInstructionsCollector.
  4. Parse the generated index through CustomInstructionsService.parseInstructionIndexFile.
  5. Prepare a ReadFile invocation for the synthetic outside-workspace URI.
  6. Compare it with an otherwise identical control using a normal skill description.

Local deterministic test result on latest main:

Test Files  1 passed (1)
Tests       1 passed (1)

The control produced confirmation messages. The structurally altered index did not.

Expected Behavior

Workspace-controlled skill names, descriptions, and paths should be encoded as data and must not be able to add records to the generated customization index or influence external-file authorization.

Actual Behavior

The skill description is interpolated as markup. The later index parser accepts the additional structure, and the resulting URI is treated as an external instruction file for which ReadFile confirmation is not shown.

Relevant Source

  • extensions/copilot/src/platform/promptFiles/node/automaticInstructionsCollector.ts:497-504 constructs the skill entry and interpolates skill.description.
  • extensions/copilot/src/platform/customInstructions/common/customInstructionsService.ts:501-585 parses the model-facing text back into instruction and skill URI sets.
  • extensions/copilot/src/extension/tools/node/toolUtils.ts:217-233 exempts URIs present in those parsed sets from the normal outside-workspace rejection.
  • extensions/copilot/src/extension/tools/node/readFileTool.tsx:207-244 prepares the ReadFile confirmation.

Impact and Scope

This is a confirmation/security-boundary consistency issue. It can cause a file outside the workspace to be returned to the configured model without the expected external-file confirmation.

The reproduced behavior requires the outer Copilot/workspace-trust requirements and an agent ReadFile request for the affected path. The test does not demonstrate command execution or direct exfiltration to a workspace-controlled server.

Suggested Fix

  • Escape every dynamic field before including it in the model-facing XML-like representation.
  • Prefer a structured, non-text authorization object rather than reparsing prompt text.
  • Do not derive external-file authorization from a representation containing workspace-controlled display metadata.
  • Add a regression test with delimiter characters in skill metadata and assert that the safe and adversarial cases both require confirmation for the same outside-workspace URI.

Existing-Issue Review

I searched issues and pull requests in microsoft/vscode and microsoft/vscode-copilot-release using the relevant class names, parser names, external-file confirmation terminology, and skill-description wording.

Adjacent issues #292297, #295643, and #305168 concern legitimate skill files incorrectly receiving confirmation or being inaccessible. They do not describe workspace metadata altering the customization-index structure or suppressing confirmation. Issue #301966 concerns losing the index during context compaction.

Activity

  1. vs-code-engineering commented on Jul 25, 2026

    @vs-code-engineering
    Contributor

    Thanks for creating this issue! It looks like you may be using an old version of VS Code; the latest stable release is 1.130.0. Please try upgrading to the latest version and checking whether this issue remains.

    Happy Coding!

  2. added
    bug
    on Jul 25, 2026
  3. added
    unreleased
    on Jul 30, 2026
  4. added this to the 1.132.0 milestone on Jul 30, 2026
  5. added
    insiders-released
    and removed
    unreleased
    on Jul 30, 2026
  6. locked and limited conversation to collaborators on Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

buginsiders-releasedverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions