Skip to content

πŸ›‘οΈ Sentinel: [HIGH] Fix SQL Injection vulnerability in ERD Tool - #334

Closed
seonghobae wants to merge 3 commits into
developmentalfrom
sentinel-fix-sql-injection-erd-14276269119169641456
Closed

πŸ›‘οΈ Sentinel: [HIGH] Fix SQL Injection vulnerability in ERD Tool#334
seonghobae wants to merge 3 commits into
developmentalfrom
sentinel-fix-sql-injection-erd-14276269119169641456

Conversation

@seonghobae

Copy link
Copy Markdown

🚨 Severity: HIGH
πŸ’‘ Vulnerability: ERD λ„κ΅¬μ˜ DDL 생성 μ‹œ 컬럼 νƒ€μž…μ— λŒ€ν•œ 검증이 μ—†μ–΄ SQL μΈμ μ…˜ 취약점 λ°œμƒ κ°€λŠ₯.
🎯 Impact: μ‚¬μš©μžκ°€ μ•…μ˜μ μœΌλ‘œ μ„Έλ―Έμ½œλ‘ μ΄ ν¬ν•¨λœ 컬럼 νƒ€μž…μ„ μž…λ ₯ν•  경우, DDL 쿼리에 μ•…μ„± 쿼리가 μ‚½μž…λ˜μ–΄ 싀행될 μœ„ν—˜μ΄ μžˆμŠ΅λ‹ˆλ‹€.
πŸ”§ Fix: `assertValidSqlType` ν•¨μˆ˜λ₯Ό μΆ”κ°€ν•˜μ—¬ 컬럼 νƒ€μž…μ— μ„Έλ―Έμ½œλ‘ μ΄ 포함될 경우 μ—λŸ¬λ₯Ό λ˜μ§€λ„λ‘ ν•˜μ˜€μŠ΅λ‹ˆλ‹€.
βœ… Verification: κ΄€λ ¨ μœ λ‹› ν…ŒμŠ€νŠΈλ₯Ό `packages/web/src/lib/erd.test.ts`에 μΆ”κ°€ν•˜κ³  100% ν…ŒμŠ€νŠΈ 컀버리지λ₯Ό μœ μ§€ν•¨μ„ ν™•μΈν–ˆμŠ΅λ‹ˆλ‹€.


PR created automatically by Jules for task 14276269119169641456 started by @seonghobae

ERD λ„κ΅¬μ˜ DDL 생성 μ‹œ 컬럼 νƒ€μž…μ— λŒ€ν•œ 검증이 μ—†μ–΄ λ°œμƒν•  수 μžˆλŠ” SQL μΈμ μ…˜ 취약점을 μˆ˜μ •ν–ˆμŠ΅λ‹ˆλ‹€.
컬럼 νƒ€μž…μ— μ„Έλ―Έμ½œλ‘ μ΄ ν¬ν•¨λ˜μ–΄ μžˆλŠ”μ§€ κ²€μ¦ν•˜λŠ” ν•¨μˆ˜λ₯Ό μΆ”κ°€ν•˜κ³ , addColumn λ©”μ„œλ“œμ—μ„œ 이λ₯Ό κ²€μ¦ν•˜λ„λ‘ λ³€κ²½ν–ˆμŠ΅λ‹ˆλ‹€.
Copilot AI review requested due to automatic review settings July 27, 2026 21:48
@google-labs-jules

Copy link
Copy Markdown

πŸ‘‹ Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a πŸ‘€ emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@seonghobae, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 40 seconds

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
βš™οΈ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c54c660c-ed62-48a0-b5bf-c89e9df2cbec

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 9ef092b and a85d94d.

πŸ“’ Files selected for processing (3)
  • .jules/sentinel.md
  • packages/web/src/lib/erd.test.ts
  • packages/web/src/lib/erd.ts
✨ Finishing Touches
πŸ“ Generate docstrings
  • Create stacked PR
  • Commit on current branch
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sentinel-fix-sql-injection-erd-14276269119169641456

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the ERD DDL generator in @argos/web by adding validation for user-provided column SQL types to reduce the risk of DDL/SQL injection via column.type interpolation.

Changes:

  • Added assertValidSqlType and invoked it during ERDModel.addColumn() to reject semicolons in column.type.
  • Added a unit test covering semicolon-containing column types.
  • Documented the vulnerability and prevention note in .jules/sentinel.md.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/web/src/lib/erd.ts Adds SQL type validation and enforces it when adding columns.
packages/web/src/lib/erd.test.ts Adds a regression test for semicolon-based injection attempts.
.jules/sentinel.md Records the security learning/prevention note for this issue.

πŸ’‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/web/src/lib/erd.ts
Comment thread packages/web/src/lib/erd.test.ts Outdated

Copy link
Copy Markdown
Author

Superseded by #397. This predecessor only rejects semicolons in the ERD SQL type field. #397 is the current focused replacement on a newer base and fails closed with positive SQL-type/default grammar validation, identifier/foreign-key validation, protected validated state, and broader adversarial tests. Closing the stale competing fix; predecessor evidence is not reused.

@seonghobae seonghobae closed this Aug 7, 2026
@google-labs-jules

Copy link
Copy Markdown

Superseded by #397. This predecessor only rejects semicolons in the ERD SQL type field. #397 is the current focused replacement on a newer base and fails closed with positive SQL-type/default grammar validation, identifier/foreign-key validation, protected validated state, and broader adversarial tests. Closing the stale competing fix; predecessor evidence is not reused.

Understood. Acknowledging that this work is superseded by #397 and stopping work on this task.

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.

2 participants