Skip to content

security(dbml): enforce identifier-to-DDL trust boundary - #833

Open
seonghobae wants to merge 2 commits into
codex/sql-control-validationfrom
codex/dbml-identifier-boundary
Open

security(dbml): enforce identifier-to-DDL trust boundary#833
seonghobae wants to merge 2 commits into
codex/sql-control-validationfrom
codex/dbml-identifier-boundary

Conversation

@seonghobae

Copy link
Copy Markdown
Collaborator

Security outcome

  • parse PostgreSQL-compatible doubled quotes in DBML identifiers without losing Unicode, reserved words, whitespace, semicolons, or comment markers
  • fail closed on NUL, empty/unterminated identifiers, more than 63 UTF-8 bytes, empty path segments, over-deep table paths, and malformed references; the HTTP route returns 422 without a partial snapshot or DDL
  • centralize identifier validation and double-quote rendering for DDL export/migrations, index recommendations, Snowflake introspection, and DBML PK/FK constraint definitions
  • make statement splitting quote-aware so semicolons inside identifier or string tokens cannot be mistaken for appended SQL
  • add deterministic property fuzzing plus focused parser→snapshot→DDL/FK/API regressions
  • document authority, failure/recovery, limitations, and APA 7 primary sources

Stack

This PR is based on #832 (exact base 1f8b859c6a174c48e1fe0608cf9db1110cb252bb) because that predecessor closes the pre-existing owned branch-coverage gaps. Review this PR's two commits after that exact base. It must not merge before #832.

Verification

  • focused DBML/DDL/migration/index/Snowflake/apply suites: 59 passed
  • complete backend after the predecessor: 495 passed, 1 skipped
  • owned production statement/branch coverage: 100.00% (414 statements, 64 branches)
  • mypy: Success: no issues found in 69 source files
  • git diff --check: clean

No dependency, lockfile, database migration, frontend, or workflow changes.

Closes #747

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fd6ea362-64d7-48b0-a148-7720767b4470

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant