mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-08-09 16:36:40 -07:00
fix(a2a-server): enforce workspace trust and task isolation to prevent RCE (#28470)
This commit is contained in:
@@ -39,6 +39,10 @@ vi.mock('child_process', () => ({
|
||||
spawnSync: vi.fn(() => ({ error: null, status: 0 })),
|
||||
}));
|
||||
|
||||
vi.mock('./headless.js', () => ({
|
||||
isHeadlessMode: vi.fn(() => false),
|
||||
}));
|
||||
|
||||
const originalPlatform = process.platform;
|
||||
|
||||
describe('editor utils', () => {
|
||||
|
||||
@@ -9,6 +9,7 @@ import { promisify } from 'node:util';
|
||||
import { once } from 'node:events';
|
||||
import { debugLogger } from './debugLogger.js';
|
||||
import { coreEvents, CoreEvent, type EditorSelectedPayload } from './events.js';
|
||||
import { isHeadlessMode } from './headless.js';
|
||||
|
||||
const GUI_EDITORS = [
|
||||
'vscode',
|
||||
@@ -404,6 +405,13 @@ export async function openDiff(
|
||||
newPath: string,
|
||||
editor: EditorType,
|
||||
): Promise<void> {
|
||||
if (isHeadlessMode()) {
|
||||
debugLogger.warn(
|
||||
'External editor spawning is disabled in headless/server mode.',
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const diffCommand = getDiffCommand(oldPath, newPath, editor);
|
||||
if (!diffCommand) {
|
||||
debugLogger.error('No diff tool available. Install a supported editor.');
|
||||
|
||||
Reference in New Issue
Block a user