Skip to content

*: harden schema rendering and test connections - #29

Merged
kennedy8312 merged 1 commit into
masterfrom
codex/security-response-fixes
Nov 4, 2026
Merged

kennedy8312 merged 1 commit into
masterfrom
codex/security-response-fixes

Conversation

@kennedy8312

Copy link
Copy Markdown
Collaborator

Schema metadata could change the structure of emitted SQL, connection logs exposed passwords, and both CLI entry points changed server-global SQL mode. The integration binary also replaced a hardcoded database without an opt-in.

This change quotes identifiers in AST and string builders, omits optimizer hints containing a comment terminator, and binds the schema filter used for introspection. Connection settings now use mysql.NewConnector directly, so special database names cannot become DSN parameters. SQL mode is configured for every physical session, including worker connections and reconnects, without SUPER or a global SET.

The public SQL generation signatures and support for valid special identifiers are preserved. Password files and SQLSMITH_PASSWORD are supported; passwords are omitted from connection logs. Empty-password instances require -allow-empty-password, remote plaintext test networks require -allow-insecure-transport, and the integration binary requires -clear and consistently honors -db. TLS verifies the CA and hostname. README includes migration examples.

Also fixes schema row cleanup, CLI generator/reload synchronization, table reservation enforcement, the empty stable-function catalog, batch literal rendering, and two integration failures found during validation (empty UPDATE assignments and inverted new-table collision checks). CI uses read-only token permissions, pinned actions, no persisted checkout credentials, and a generated schema-scoped database account.

Validation:

  • Baseline unit suite passed at 334484c before changes.
  • Full go test -race ./... passed against disposable MySQL 5.7.24, MySQL 8.4.8, and TiDB 8.5.7 (standalone unistore), using schema-scoped users.
  • Integration binary passed on all three engines; a database name containing a DSN query delimiter was also exercised on MySQL 8.4.
  • Verified the no--clear guard, preservation of an unrelated test database sentinel, unchanged global SQL mode, and absence of the test password in logs.
  • Verified trusted TLS succeeds and wrong hostname / untrusted certificate fail on MySQL 8.4; ran the four-worker race-instrumented fuzzer.
  • go vet ./... and git diff --check passed.

SQLSmith remains a mutable library object: external callers must synchronize shared instances and direct access to exported schema maps. This change synchronizes the CLI's shared instance; it does not promise safe execution of arbitrary caller-constructed malformed ASTs. No dependency versions were changed.

@ti-chi-bot

ti-chi-bot Bot commented Nov 4, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added the size/XXL label Nov 4, 2026
@kennedy8312
kennedy8312 marked this pull request as ready for review November 4, 2026 14:03
@kennedy8312
kennedy8312 merged commit c8be989 into master Nov 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant