Change formatting to prevent UI redressing attacks (#17611)

This commit is contained in:
Tommaso Sciortino
2026-01-27 08:56:01 -08:00
committed by GitHub
parent 6be42be575
commit 8b2b71c8ef
6 changed files with 26 additions and 24 deletions

View File

@@ -9,7 +9,7 @@ import { Box, Text } from 'ink';
import { theme } from '../semantic-colors.js';
import { type SlashCommand, CommandKind } from '../commands/types.js';
import { KEYBOARD_SHORTCUTS_URL } from '../constants.js';
import { sanitizeForListDisplay } from '../utils/textUtils.js';
import { sanitizeForDisplay } from '../utils/textUtils.js';
interface Help {
commands: readonly SlashCommand[];
@@ -79,7 +79,7 @@ export const Help: React.FC<Help> = ({ commands }) => (
<Text color={theme.text.secondary}> [MCP]</Text>
)}
{command.description &&
' - ' + sanitizeForListDisplay(command.description, 100)}
' - ' + sanitizeForDisplay(command.description, 100)}
</Text>
{command.subCommands &&
command.subCommands
@@ -91,7 +91,7 @@ export const Help: React.FC<Help> = ({ commands }) => (
{subCommand.name}
</Text>
{subCommand.description &&
' - ' + sanitizeForListDisplay(subCommand.description, 100)}
' - ' + sanitizeForDisplay(subCommand.description, 100)}
</Text>
))}
</Box>