aws / aws/aws-toolkit-vscode

FileSearch tool grants access to read all files in the searched path.

Open
#8,692 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
2k
Forks
807
Avg merge
10h 12m
Merged PRs (30d)
7

Description

## Problem

When trying to access files out of my workspace i get prompted if Amazon Q is allowed to read the file. When i however ask him top open a file in the file tree that he previously did a filesearch in, i do not get asked anymore.

Not 100% sure if its a bug, but its certainly concerning in my eyes. If it does a file search in home or whereever for some reason every single file in that tree is exposed with its content being able to land in the context at any time.

Additionally the filesearch tool call does not even state which path it wants to search in, so until the file search was allowed I dont even knwo which file path is compromised now.

Image

Maybe additionally the question there is really no

## Steps to reproduce the issue

Ask to open ´../.env´

You are prompted if its ok to read the file.
Do not accept.

Ask to do a filesearch in .. for whatever

Allow the file search.

Ask to open ´../.env´ again, it will read it and can print its content without another prompt.

Image

As side question: There is really no "deniedPath" or any of those settings in the IDE just for CLI? is there a reason for that?

## Expected behavior
finds the files expected but does not have automatic access to all files in the tree
(or even better supports the smae settings the CLI does because I am missing many of the settings available there)

## System details (run `AWS: About` and/or `Amazon Q: About`)

OS: Linux x64 6.17.0-19-generic
Visual Studio Code extension host: 1.112.0
Amazon Q: 1.112.0
node: 22.22.0
electron: 39.8.0

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the VS Code extension flow described: deny access to ../.env, approve a FileSearch in .., then request ../.env again. Trace the FileSearch permission handling and compare the resulting access scope with the requested path; done means searched files do not grant unrestricted reads and the search path is shown before approval.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
devtools, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.