From 8d53bb333da33ee1dd7891bcc58b049f67cd9b78 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Thu, 21 Aug 2025 17:33:12 -0700 Subject: [PATCH] fix: cleanup file security pr --- core/context/providers/FileContextProvider.ts | 15 --------------- core/context/providers/ProblemsContextProvider.ts | 8 -------- core/indexing/ignore.ts | 3 +++ extensions/cli/package-lock.json | 1 - extensions/cli/package.json | 1 - .../cli/src/tools/searchAndReplace/index.ts | 4 +--- extensions/cli/src/ui/UserInput.tsx | 2 -- 7 files changed, 4 insertions(+), 30 deletions(-) diff --git a/core/context/providers/FileContextProvider.ts b/core/context/providers/FileContextProvider.ts index 3ec1dad62..9e0455e54 100644 --- a/core/context/providers/FileContextProvider.ts +++ b/core/context/providers/FileContextProvider.ts @@ -37,21 +37,6 @@ class FileContextProvider extends BaseContextProvider { await extras.ide.getWorkspaceDirs(), ); - if (isSecurityConcern(relativePathOrBasename)) { - return [ - { - description: last2Parts, - content: - "Content redacted, this file cannot be viewed for security reasons", - name: baseName, - uri: { - type: "file", - value: fileUri, - }, - }, - ]; - } - return [ { name: baseName, diff --git a/core/context/providers/ProblemsContextProvider.ts b/core/context/providers/ProblemsContextProvider.ts index 4da64ace5..3d7f3fe7a 100644 --- a/core/context/providers/ProblemsContextProvider.ts +++ b/core/context/providers/ProblemsContextProvider.ts @@ -29,14 +29,6 @@ class ProblemsContextProvider extends BaseContextProvider { problem.filepath, workspaceDirs, ); - if (isSecurityConcern(relativePathOrBasename)) { - return { - description: "Problems in current file", - content: - "Content was redacted because the file is detected as a potential security concern", - name: `Warnings in ${baseName}`, - }; - } const content = await ide.readFile(problem.filepath); const lines = content.split("\n"); const rangeContent = lines diff --git a/core/indexing/ignore.ts b/core/indexing/ignore.ts index 74ac0f4be..dc237e590 100644 --- a/core/indexing/ignore.ts +++ b/core/indexing/ignore.ts @@ -95,6 +95,9 @@ export const DEFAULT_SECURITY_IGNORE_DIRS = [ ".gnupg/", ".gpg/", + // Application specific + ".continue/", + // Temporary directories that might contain sensitive data "tmp/secrets/", "temp/secrets/", diff --git a/extensions/cli/package-lock.json b/extensions/cli/package-lock.json index c3fe32630..b9645180f 100644 --- a/extensions/cli/package-lock.json +++ b/extensions/cli/package-lock.json @@ -53,7 +53,6 @@ "swr": "^2.3.4", "turndown": "^7.2.0", "typescript": "^5.8.3", - "uri-js": "^4.4.1", "uuid": "^9.0.1", "winston": "^3.17.0", "yaml": "^2.8.0" diff --git a/extensions/cli/package.json b/extensions/cli/package.json index 857938d2b..7376cc275 100644 --- a/extensions/cli/package.json +++ b/extensions/cli/package.json @@ -83,7 +83,6 @@ "swr": "^2.3.4", "turndown": "^7.2.0", "typescript": "^5.8.3", - "uri-js": "^4.4.1", "uuid": "^9.0.1", "winston": "^3.17.0", "yaml": "^2.8.0" diff --git a/extensions/cli/src/tools/searchAndReplace/index.ts b/extensions/cli/src/tools/searchAndReplace/index.ts index 63ff1c668..ddcffc7a7 100644 --- a/extensions/cli/src/tools/searchAndReplace/index.ts +++ b/extensions/cli/src/tools/searchAndReplace/index.ts @@ -1,7 +1,5 @@ import * as fs from "fs"; -import { throwIfFileIsSecurityConcern } from "core/indexing/ignore.js"; - import { telemetryService } from "../../telemetry/telemetryService.js"; import { calculateLinesOfCodeDiff, @@ -97,7 +95,7 @@ Each string in the diffs array can contain multiple SEARCH/REPLACE blocks, and a preprocess: async (args) => { // Get and validate args const { filepath, diffs } = parseSearchAndReplaceArgs(args); - throwIfFileIsSecurityConcern(filepath); + // Get current file contents if (!fs.existsSync(filepath)) { throw new Error(`file ${filepath} does not exist`); diff --git a/extensions/cli/src/ui/UserInput.tsx b/extensions/cli/src/ui/UserInput.tsx index ea213d383..bda7cb551 100644 --- a/extensions/cli/src/ui/UserInput.tsx +++ b/extensions/cli/src/ui/UserInput.tsx @@ -1,5 +1,4 @@ import { type AssistantConfig } from "@continuedev/sdk"; -import { throwIfFileIsSecurityConcern } from "core/indexing/ignore.js"; import { Box, Text, useApp, useInput } from "ink"; import React, { useCallback, useState } from "react"; @@ -255,7 +254,6 @@ const UserInput: React.FC = ({ // Read the file content and notify parent component if (onFileAttached) { try { - throwIfFileIsSecurityConcern(filePath); const fs = await import("fs/promises"); const content = await fs.readFile(filePath, "utf-8"); onFileAttached(filePath, content);