Skip to content

Follow-ups from toolchain adoption (#98): accessibility pass + triage pre-existing CodeQL/Sonar findings #100

Description

@cevheri

Context

During the toolchain adoption in #98 (Biome, oxlint, type-aware ESLint, knip, attw) three sets of findings
were deliberately deferred or surfaced as advisory. This issue consolidates them into one tracked follow-up.

Important: the 461-file one-shot Biome reformat in #98 makes pre-existing lines count as "new code", so the
CodeQL "new alerts" check and the SonarCloud quality gate re-attribute PRE-EXISTING findings to that PR (their
own caveat: "code changes were too large"). The flagged files' diffs were verified to be formatting-only.
After #98 merges to main, the new-code baseline resets, so these stop blocking unrelated PRs - but the
underlying findings remain in the codebase and are tracked here for real resolution. None were introduced by
#98.

1. Accessibility pass (oxlint jsx-a11y) - 60 findings

In #98 the 8 firing jsx-a11y rules were set to warn (not disabled) to avoid turning a tooling PR into an
accessibility refactor of vendored shadcn/ui plus many components needing markup/behaviour changes.

Rules currently at warn in .oxlintrc.json: no-static-element-interactions, click-events-have-key-events,
label-has-associated-control, prefer-tag-over-role, no-autofocus, control-has-associated-label,
no-noninteractive-element-interactions, anchor-has-content.

Representative locations: ResultsGrid.tsx, DataImportModal.tsx, MaskingSettings.tsx, QueryHistory.tsx,
StudioTabBar.tsx, SnapshotTimeline.tsx, SavedQueries.tsx, DataCharts.tsx, VisualExplain.tsx, plus
vendored ui/* (calendar, carousel, breadcrumb, pagination, input-group, field, item, spinner, button-group).

2. Triage CodeQL alerts (11: 5 high, 6 medium)

  • js/sql-injection (high) x4 - src/lib/db/providers/sql/mssql.ts:222,
    src/lib/db/providers/document/mongodb.ts:277,281,287. Expected to be largely by-design (the product's
    purpose is executing user-supplied queries), but confirm each path is parameterised where it should be,
    then fix or dismiss-as-by-design with a written justification.
    Done: verified parameterisation (MSSQL binds via request.input; MongoDB uses the driver's structured
    API) and dismissed all four as by-design with written justifications.
  • js/log-injection (medium) x6 - src/lib/logger.ts:85,96,99,102, src/lib/db/base-provider.ts:261,
    src/lib/db/factory.ts:58. logger.ts already sanitises control chars/newlines; verify the sanitiser
    covers each sink (likely false-positive) and dismiss, or route remaining sinks through it.
    Done: verified every sink sanitises inline; five dismissed as false positive, the stack-trace one as
    by-design (multi-line stacks, non-production only).
  • js/tainted-format-string (high) x1 - src/lib/logger.ts:85. Confirm the format string is not
    user-controlled, or harden it.
    Done: real defect, fixed in fix(logger): use a constant console format string on the stack-trace path (#100) #204 (constant "%s\n%s" format string).
  • js/path-injection (high) x2 - src/lib/db/providers/sql/sqlite.ts:176,177 (surfaced after this issue
    was written). Dismissed as by-design: the SQLite path is user-configured trusted server-side input
    (docs/providers/sqlite.md); NUL bytes rejected, path resolved.

3. SonarCloud new-code quality gate

new_coverage 92.9%, new_maintainability_rating 1, duplications 1.3%, hotspots 100% are all OK. Two
conditions fail, both pre-existing:

Acceptance

  • jsx-a11y findings resolved and the 8 rules promoted to error.
  • Every CodeQL alert either fixed or dismissed with a written by-design justification.
  • SonarCloud quality gate green on a follow-up PR (Math.random hotspots reviewed; reliability bugs fixed).

Refs: #98

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions