fix: close Ticket 11 hardening review gaps

This commit is contained in:
proxyctl coordinator
2026-07-18 02:04:26 +08:00
parent f15ffc2301
commit ed8b527f1f
15 changed files with 1045 additions and 175 deletions
+4 -1
View File
@@ -87,7 +87,7 @@ func (f *formState) rebuildInputs(focus int) tea.Cmd {
input.Placeholder = fieldPlaceholder(definition.field)
input.CharLimit = 4096
input.Width = 48
input.SetValue(definition.value)
input.SetValue(sanitizeUntrustedControls(definition.value))
input.CursorEnd()
f.inputs[i] = formInput{label: definition.label, field: definition.field, input: input}
}
@@ -122,6 +122,9 @@ func (f *formState) updateInput(key tea.KeyMsg) tea.Cmd {
if len(f.inputs) == 0 {
return nil
}
if key.Type == tea.KeyRunes {
key.Runes = []rune(sanitizeUntrustedControls(string(key.Runes)))
}
// Bubbles textinput intentionally collapses pasted newlines. Bypass uses
// canonical comma/newline delimiters, so preserve that boundary as commas.
if f.inputs[f.field].field == profile.BypassField && key.Type == tea.KeyRunes {