๐ก๏ธ Sentinel: [CRITICAL] ERD ๋ชจ๋ธ์ DDL ์ธ์ ์ ์ทจ์ฝ์ ์์ #278
๐ก๏ธ Sentinel: [CRITICAL] ERD ๋ชจ๋ธ์ DDL ์ธ์ ์
์ทจ์ฝ์ ์์ #278seonghobae wants to merge 1 commit into
Conversation
|
๐ 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
๐จ Severity: CRITICAL
๐ก Vulnerability: ERDModel์ addColumn์์ column type์ ๋ํ ๊ฒ์ฆ์ด ์์ด ์ฌ์ฉ์๊ฐ ์์์ ๋ฌธ์๋ฅผ ํฌํจํ ํ์ (์: TEXT\n);\nDROP TABLE users;--)์ ์ฝ์ ํ์ฌ DDL์ ์กฐ์ํ ์ ์์์ต๋๋ค.
๐ฏ Impact: ๊ณต๊ฒฉ์๊ฐ ์ ์์ ์ธ DDL(DROP TABLE ๋ฑ)์ ์คํํ๊ฑฐ๋ SQL ๋ฌธ๋ฒ์ ํ๊ดดํ ์ ์์ต๋๋ค.
๐ง Fix: ์ ๊ท์ /^[a-zA-Z0-9_(),\s]+$/ ์ ์ฌ์ฉํ๋ assertValidColumnType ๊ฒ์ฆ ํจ์๋ฅผ ์ถ๊ฐํ๊ณ , addColumn ํธ์ถ ์ ๊ฒ์ฆํ์ฌ ์ ํจํ ๋ฌธ์(์์ซ์, ๊ดํธ, ๋ฐ์ค, ๊ณต๋ฐฑ)๋ง ํ์ฉํ๋๋ก ์์ ํ์ต๋๋ค.
โ Verification: pnpm test src/lib/erd.test.ts๋ฅผ ์คํํ์ฌ ํ ์คํธ ํต๊ณผ๋ฅผ ํ์ธํ์ต๋๋ค.
PR created automatically by Jules for task 15353617119944385829 started by @seonghobae