Skip to content

๐Ÿ›ก๏ธ Sentinel: [security improvement] ERD ๋ชจ๋ธ๋ง ๋„๊ตฌ ๊ธฐ๋Šฅ ํ™•์žฅ ๋ฐ ๋ฌด๊ฒฐ์„ฑ ๊ฐ•ํ™”#289

Open
seonghobae wants to merge 2 commits into
developmentalfrom
feature/erd-tool-enhancements-6382498498086559751
Open

๐Ÿ›ก๏ธ Sentinel: [security improvement] ERD ๋ชจ๋ธ๋ง ๋„๊ตฌ ๊ธฐ๋Šฅ ํ™•์žฅ ๋ฐ ๋ฌด๊ฒฐ์„ฑ ๊ฐ•ํ™”#289
seonghobae wants to merge 2 commits into
developmentalfrom
feature/erd-tool-enhancements-6382498498086559751

Conversation

@seonghobae

Copy link
Copy Markdown

๐Ÿšจ Severity: MEDIUM
๐Ÿ’ก Vulnerability: ERD ๋„๊ตฌ์˜ ์‚ญ์ œ ๊ธฐ๋Šฅ ๋ถ€์žฌ๋กœ ์ธํ•œ ๋ฐ์ดํ„ฐ ๋ถˆ์ผ์น˜ ์œ„ํ—˜
๐ŸŽฏ Impact: ์™ธ๋ž˜ํ‚ค ์ฐธ์กฐ ๋ฌด๊ฒฐ์„ฑ์ด ๊นจ์งˆ ์ˆ˜ ์žˆ์Œ
๐Ÿ”ง Fix: ์‚ญ์ œ ์ „ ์ฐธ์กฐ ๊ฒ€์ฆ์„ ํฌํ•จํ•œ ๊ธฐ๋Šฅ ํ™•์žฅ (removeTable, removeColumn, removeForeignKey ๋ฐ isUnique, defaultValue ์ง€์›)
โœ… Verification: ํ…Œ์ŠคํŠธ ์ฝ”๋“œ ๋ฐ pnpm coverage:erd 100% ๋‹ฌ์„ฑ


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

@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.

Copilot AI review requested due to automatic review settings July 21, 2026 00:45

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

Note

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

ERD ๋ชจ๋ธ๋ง ๋„๊ตฌ์— ์‚ญ์ œ API ๋ฐ DDL ์ƒ์„ฑ ์˜ต์…˜(UNIQUE/DEFAULT)์„ ์ถ”๊ฐ€ํ•ด ์ฐธ์กฐ ๋ฌด๊ฒฐ์„ฑ ๊นจ์ง์„ ๋ฐฉ์ง€ํ•˜๋ ค๋Š” PR์ž…๋‹ˆ๋‹ค.

Changes:

  • Column ํ™•์žฅ(isUnique, defaultValue) ๋ฐ DDL ์ƒ์„ฑ ์‹œ UNIQUE/DEFAULT ์ง€์›
  • ์‚ญ์ œ ๊ธฐ๋Šฅ ์ถ”๊ฐ€(removeTable, removeColumn, removeForeignKey) + ์ฐธ์กฐ ๋ฌด๊ฒฐ์„ฑ ๊ฒ€์ฆ
  • Vitest ํ…Œ์ŠคํŠธ ํ™•์žฅ ๋ฐ ๊ด€๋ จ ๋ฌธ์„œ/์˜์กด์„ฑ ์—…๋ฐ์ดํŠธ

Reviewed changes

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

Show a summary per file
File Description
packages/web/src/lib/erd.ts ERD ๋ชจ๋ธ ์‚ญ์ œ API ๋ฐ DDL ์ƒ์„ฑ ๊ธฐ๋Šฅ ํ™•์žฅ
packages/web/src/lib/erd.test.ts ์‚ญ์ œ/DDL ์‹ ๊ทœ ๋™์ž‘ ๋ฐ ์˜ˆ์™ธ ์ผ€์ด์Šค ํ…Œ์ŠคํŠธ ์ถ”๊ฐ€
package.json ์˜์กด์„ฑ ๋ฒ„์ „ ์—…๋ฐ์ดํŠธ/์ถ”๊ฐ€
CHANGELOG.md ERD ๊ธฐ๋Šฅ ํ™•์žฅ ๋‚ด์šฉ ๊ธฐ๋ก
.jules/sentinel.md Sentinel ํ•™์Šต ๋กœ๊ทธ(๋ณด์•ˆ) ํ•ญ๋ชฉ ๊ฐฑ์‹ 
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

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

Comment on lines +175 to 177
if (col.defaultValue !== undefined) {
def += ` DEFAULT ${col.defaultValue}`;
}
Comment on lines +66 to +70
removeTable(name: string): void {
const table = this.tables.get(name);
if (!table) {
throw new Error(`Table '${name}' does not exist.`);
}
Comment thread .jules/sentinel.md
Comment on lines +1 to +9
## 2024-07-21 - [ERD ๋ชจ๋ธ๋ง ๋„๊ตฌ ๋ณด์•ˆ ๊ฐ•ํ™” ํ•™์Šต]
**Vulnerability:** ERD ๋ชจ๋ธ์—์„œ ํ…Œ์ด๋ธ”, ์ปฌ๋Ÿผ, ์™ธ๋ž˜ํ‚ค ๋ช…์นญ์— ๋Œ€ํ•œ ๊ธฐ๋ณธ์  ๊ฒ€์ฆ(snake_case)๋งŒ ์กด์žฌํ•˜๋ฉฐ, ์‚ญ์ œ๋‚˜ ๋ณ€๊ฒฝ ๊ฐ™์€ ๊ณ ๊ธ‰ ๊ธฐ๋Šฅ์ด ๋ถ€์žฌ. ์™ธ๋ถ€ ์ž…๋ ฅ์— ๋Œ€ํ•ด ๊ฐ•๊ฑดํ•œ ์—๋Ÿฌ ์ฒ˜๋ฆฌ๋„ ๋‹ค์†Œ ๋ถ€์กฑํ•  ์ˆ˜ ์žˆ์Œ.
**Learning:** DDL ์ƒ์„ฑ์„ ์œ„ํ•ด ์ž…๋ ฅ๋ฐ›๋Š” ํ…Œ์ด๋ธ”๋ช…๊ณผ ์ปฌ๋Ÿผ๋ช…์— ๋Œ€ํ•ด ์—„๊ฒฉํ•œ ์‹๋ณ„์ž ๊ทœ์น™์„ ์ ์šฉํ•˜์ง€ ์•Š๊ฑฐ๋‚˜ ๊ฒ€์ฆ์ด ๋ฏธํกํ•˜๋ฉด, ํ–ฅํ›„ ๋ณต์žกํ•œ SQL ์ธ์ ์…˜ ๊ณต๊ฒฉ ๋˜๋Š” ์˜ˆ๊ธฐ์น˜ ์•Š์€ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์˜ค๋ฅ˜๋ฅผ ์œ ๋ฐœํ•  ์ˆ˜ ์žˆ์Œ.
**Prevention:** ๋ชจ๋“  ์ž…๋ ฅ ์‹๋ณ„์ž์— ๋Œ€ํ•ด ๋ช…ํ™•ํ•œ ๊ฒ€์ฆ(`assertSnakeCaseIdentifier`)์„ ๊ฑฐ์น˜๊ณ , ๋ชจ๋ธ ๋‚ด ์˜์กด์„ฑ ๋ฌด๊ฒฐ์„ฑ์„ ํ›ผ์†ํ•˜๋Š” ์‚ญ์ œ ์ž‘์—…(์ฐธ์กฐ๋˜๋Š” ํ…Œ์ด๋ธ” ์‚ญ์ œ ๋ฐฉ์ง€ ๋“ฑ)์— ๋Œ€ํ•œ ๋ฐฉ์–ด ๋กœ์ง์„ ๋งˆ๋ จํ•ด์•ผ ํ•จ.

## 2026-07-10 - DoS via slow PBKDF2 hashing for environment secrets
**Vulnerability:** Slow PBKDF2 hashing was applied to an in-memory plain text environment variable (`ADMIN_PASSWORD`).
**Learning:** Applying slow cryptographic hashing to secrets originating from and remaining in memory provides zero additional security (since the secret is already accessible) but introduces a critical Denial-of-Service (DoS) risk, as attackers can force the server to execute expensive hash updates.
**Prevention:** Use fast uniform hashes (like SHA-256) when comparing plain text environment secrets to avoid timing attacks, rather than slow key derivation functions like PBKDF2. Always enforce length checking on inputs before hashing.

## 2025-07-08 - [Fix timing attack vulnerability in signature verification]
**Vulnerability:** A custom buffer length check (`if (signatureBytes.length !== expectedSignatureBytes.length) return false`) before calling `crypto.timingSafeEqual()` leaked the length of the expected signature, enabling timing attacks.
**Learning:** Never use custom 'homebrew' buffer-padding logic to match lengths for `crypto.timingSafeEqual()`, as early returns leak the length of the secret.
**Prevention:** Ensure inputs are hashed to a uniform length (e.g., using `crypto.createHash('sha256')`) before comparison.
## 2024-07-21 - [ERD ๋ชจ๋ธ๋ง ๋„๊ตฌ ๋ฌด๊ฒฐ์„ฑ ๊ฐ•ํ™”]
**Vulnerability:** ERD ๋ชจ๋ธ์— ์‚ญ์ œ ๊ธฐ๋Šฅ์ด ์ถ”๊ฐ€๋  ๊ฒฝ์šฐ ์ฐธ์กฐ ๋ฌด๊ฒฐ์„ฑ ๊ฒ€์ฆ ๋ถ€์žฌ ์‹œ ๋ฐ์ดํ„ฐ ๋ถˆ์ผ์น˜ ๋ฐ ์˜ˆ์™ธ ๋ฐœ์ƒ ๊ฐ€๋Šฅ์„ฑ
**Learning:** `removeTable`์ด๋‚˜ `removeColumn` ๊ฐ™์€ ํŒŒ๊ดด์  ๋™์ž‘ ์‹œ, ํ•ญ์ƒ ํ…Œ์ด๋ธ” ๋‚ด์™ธ์˜ `foreignKeys` ์˜์กด์„ฑ์„ ํ™•์ธํ•˜์—ฌ ์ฐธ์กฐ ์ค‘์ธ ๊ฐ์ฒด์˜ ์‚ญ์ œ๋ฅผ ๋ฐฉ์ง€ํ•ด์•ผ ํ•จ
**Prevention:** ์‚ญ์ œ ์ „ ์˜์กด์„ฑ ํŠธ๋ฆฌ ์Šค์บ” ๋ฐ ์˜ˆ์™ธ๋ฅผ ๋ฐœ์ƒ์‹œํ‚ค๋Š” ๋ฐฉ์–ด์  ์‚ญ์ œ ๋ฉ”์„œ๋“œ ๊ตฌํ˜„ (`removeTable`, `removeColumn`)
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