You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[P1] [security] Boolean edit accepts 'true' string but saves as 0 — silent data loss #421
[P1] [security] Boolean edit accepts 'true'/'false' strings but emits them as 'true'/'false' literals — silent 0
Context
parseEditValue (EditableCell.tsx:55-71) handles numeric types by parsing Number(rawValue); for boolean types (BOOLEAN | TINYINT(1) | BOOL) the function returns the raw string.
Problem
Per docs/audits/results.md F24.
If the user manually types true in a TINYINT(1) cell, parseEditValue returns the string true. Save emits UPDATE ... SET is_active = 'true' → MySQL accepts as a string and converts to 0 (since 'true' isn't numeric). Silent data loss.
Files
src/components/grid/EditableCell.tsx:55-71
Repro (if applicable)
Static analysis only.
Expected
Type true → cell becomes checked checkbox (1). Type false → unchecked (0). Type yes → inline error "expected 0 or 1".
Proposed fix
Scope S. In parseEditValue, if isBooleanType(dataType), return parseInt(rawValue, 10) === 1 ? 1 : 0; reject other inputs with inline error.
Acceptance
Boolean values coerce correctly; invalid strings rejected with inline error.
Fixed by #531 (commit b4297c1). parseBooleanInput in src/lib/sql-types.ts returns 0 | 1 | undefined, and an unrecognised string now yields undefined — rejected — instead of silently coercing to 0. Typing true into a boolean cell no longer writes false.
Not auto-closed because the PR body wrote Refs #421 rather than a closing keyword.
Activity
fix(grid): stop a typed boolean becoming 0, and widen the production …
EVWorth commentedon Sep 4, 2026
Fixed by #531 (commit b4297c1).
parseBooleanInputin src/lib/sql-types.ts returns0 | 1 | undefined, and an unrecognised string now yieldsundefined— rejected — instead of silently coercing to 0. Typingtrueinto a boolean cell no longer writes false.Not auto-closed because the PR body wrote
Refs #421rather than a closing keyword.fix(routine): close the parameter injection, and put DROP behind the …