Exploit databaseDownload repository ZIP
GH-562a516151f045835c0ee477b90de486
barrersoftware/opencode-secure
Sources for CVE-2026-22812
6 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files44
barrersoftware/opencode-secureRevision 806a6c7399a1
- ↑..Parent directory
- apply_patch.ts
- apply_patch.txt
- bash.ts
- bash.txt
- batch.ts
- batch.txt
- codesearch.ts
- codesearch.txt
- edit.ts
- edit.txt
- external-directory.ts
- glob.ts
- glob.txt
- grep.ts
- grep.txt
- invalid.ts
- ls.ts
- ls.txt
- lsp.ts
- lsp.txt
- multiedit.ts
- multiedit.txt
- plan-enter.txt
- plan-exit.txt
- plan.ts
- question.ts
- question.txt
- read.ts
- read.txt
- registry.ts
- skill.ts
- task.ts
- task.txt
- todo.ts
- todoread.txt
- todowrite.txt
- tool.ts
- truncation.ts
- webfetch.ts
- webfetch.txt
- websearch.ts
- websearch.txt
- write.ts
- write.txt
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
packages/opencode/src/tool/multiedit.ts
TypeScript · 1,523 bytesimport z from "zod"
import { Tool } from "./tool"
import { EditTool } from "./edit"
import DESCRIPTION from "./multiedit.txt"
import path from "path"
import { Instance } from "../project/instance"
export const MultiEditTool = Tool.define("multiedit", {
description: DESCRIPTION,
parameters: z.object({
filePath: z.string().describe("The absolute path to the file to modify"),
edits: z
.array(
z.object({
filePath: z.string().describe("The absolute path to the file to modify"),
oldString: z.string().describe("The text to replace"),
newString: z.string().describe("The text to replace it with (must be different from oldString)"),
replaceAll: z.boolean().optional().describe("Replace all occurrences of oldString (default false)"),
}),
)
.describe("Array of edit operations to perform sequentially on the file"),
}),
async execute(params, ctx) {
const tool = await EditTool.init()
const results = []
for (const [, edit] of params.edits.entries()) {
const result = await tool.execute(
{
filePath: params.filePath,
oldString: edit.oldString,
newString: edit.newString,
replaceAll: edit.replaceAll,
},
ctx,
)
results.push(result)
}
return {
title: path.relative(Instance.worktree, params.filePath),
metadata: {
results: results.map((r) => r.metadata),
},
output: results.at(-1)!.output,
}
},
})